ManimFlow turns a natural-language animation request into a rendered Manim video. The Streamlit app plans scenes, gives Pi an isolated project workspace, streams the agent's progress, renders the animation, and keeps repairing failures until it produces an MP4.
- Accepts a short topic or a detailed animation brief.
- Uses the selected model to create a complete scene plan.
- Starts Pi as an autonomous coding agent in a temporary workspace.
- Generates modular Manim source files and shows them in a live, read-only Monaco browser.
- Runs Manim, observes errors, edits the project, and retries until a valid MP4 is available.
- Displays the video for playback and download.
- Suggests editable YouTube metadata and can upload the result after browser-based YouTube authorization.
Long and detailed prompts receive longer scene plans. Mathematical and scientific animations use the installed LaTeX toolchain through MathTex and Tex.
The Streamlit interface currently supports:
| Provider | Authentication | Default model |
|---|---|---|
| GitHub Copilot | Deployment secret or GitHub device login | gpt-4o |
| Google Gemini | GEMINI_API_KEY in Streamlit Secrets |
gemini-2.5-flash |
| ChatGPT Codex | Pasted short-lived ChatGPT OAuth access token | gpt-5.4 |
| Anthropic | Pasted short-lived Anthropic OAuth access token | claude-haiku-4-5 |
| Exa | Public Exa endpoint through a custom Pi provider | google/gemini-2.5-flash |
Pasted OAuth access tokens remain in the active Streamlit session. ManimFlow does not write them to project files or repository configuration.
- Autonomous Pi coding and repair loop
- Live, filtered tool and render progress
- VS Code-style read-only Monaco file explorer
- Per-render isolated workspaces
- Full local Manim documentation checkout for providers using the documentation gate
- LaTeX, common TeX packages, recommended fonts, and
dvisvgm - MP4 playback and download
- Browser-persistent encrypted YouTube authorization
- LLM-suggested YouTube title, description, and tags
- Resumable YouTube uploads with editable privacy settings
- Serialized render queue for safe concurrent Streamlit sessions
- Isolated Node 22 and pinned Pi
0.80.6runtime installation when required
Animation prompt
|
v
Scene planner
|
v
plan.md and AGENTS.md
|
v
Pi coding agent
|
+--> reads local Manim documentation when required
+--> writes Python modules
+--> runs Manim
+--> diagnoses and repairs failures
|
v
animation.mp4
|
+--> browser playback and download
+--> optional YouTube upload
The app parses Pi's JSON event stream into useful progress messages. Large command and documentation results are shortened only in the frontend log. Files and tool results passed to Pi remain complete.
- Python 3.11 or newer
- Node.js 22 or newer
- The system packages listed in
packages.txt
Install the application dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
npm ciCopy the example secrets file and add the providers you intend to use:
cp .streamlit/secrets.toml.example .streamlit/secrets.tomlStart Streamlit:
streamlit run streamlit_app.py- Fork this repository.
- Create a Streamlit app with
streamlit_app.pyas the entry point. - Add the required values under App settings, then Secrets.
- Deploy the app. Streamlit installs Python dependencies from
requirements.txtand system packages frompackages.txt.
Example secrets:
COPILOT_TOKEN = "optional-copilot-token"
GEMINI_API_KEY = "optional-gemini-key"
YOUTUBE_CLIENT_ID = "your-client-id.apps.googleusercontent.com"
YOUTUBE_CLIENT_SECRET = "your-client-secret"
YOUTUBE_REDIRECT_URI = "https://your-app.streamlit.app/"
YOUTUBE_TOKEN_ENCRYPTION_KEY = "a-long-random-secret"COPILOT_TOKEN is optional because the app can use GitHub device login. GEMINI_API_KEY is required only when Google Gemini is selected. The four YouTube values are required only for YouTube uploads.
For YouTube OAuth, enable YouTube Data API v3, create a Google OAuth Web application, and register the exact deployed Streamlit URL as its redirect URI. The app encrypts OAuth credentials before storing them in that browser's local storage.
| Path | Purpose |
|---|---|
streamlit_app.py |
Main Streamlit product and render orchestration |
pi_extensions/exa_direct.ts |
Direct Exa provider with cleaned output and native Pi tool-call translation |
code_browser_component/ |
Read-only Monaco code browser |
browser_storage_component/ |
Browser-local encrypted credential storage bridge |
requirements.txt |
Python dependencies |
packages.txt |
Streamlit system packages, Manim libraries, FFmpeg, and TeX |
package.json |
Pinned Pi coding-agent dependency and Node requirement |
The repository contains earlier interfaces that are no longer the primary product:
.github/workflows/render.yml renders an issue after the repository owner applies the manim label. It runs the same six-attempt autonomous Pi pipeline with GitHub Copilot and gpt-4o, then publishes the resulting MP4 as a workflow artifact.
ManimFlow.ipynb provides an interactive Exa-only Colab workflow. It installs the pinned Pi runtime and uses the same hardened Exa provider extension and autonomous render loop as the Streamlit app.
The manimflow script launches the Exa and Pi pipeline in a temporary Colab session, streams useful progress, and downloads the rendered MP4. It requires colab-cli and an authenticated Colab session.
pip install colab-cli
colab login
./manimflow "doppler effect visualization"youtube_script.ipynb is the original standalone YouTube upload experiment. Its functionality is now integrated into the Streamlit app.
