English | δΈζθ―΄ζ
π¨ GPT-4o powered generative videos. Concept. β‘οΈ Join our Discord server here!
Generative Manim (GM) is a suite of tools that allows you to create videos with Manim using LLMs (Large Language Models) like GPT-4 or Claude. The idea is to enable anyone to create wonderful animations from text β¨.
It began as a prototype of a web app that uses GPT-4 to generate videos with Manim. The idea behind this project is taking advantage of the power of LLMs in programming, the understanding of human language and the animation capabilities of Manim to generate a tool that could be used by anyone to create videos. Regardless of their programming or video editing skills.
- ποΈ Generative Manim Demo: Check out the demo of Generative Manim!
- π¬ Generative Manim API: Build over the Animation Processing Interface, or API.
- π§βπ» Generative Manim Developers: Join our Discord server, learn new things, share your creations and more!
- π Generative Manim Streamlit (Legacy): First LLM exploration of LLMs and Animation.
Models are the core of Generative Manim. A model is a way to convert text to code, that can later be rendered in a video.
| Name | Description | Engine | Phase |
|---|---|---|---|
| GM GPT-4o | Latest GPT model from OpenAI powered by a custom System Prompt | GPT-4o | β |
| GM GPT-3.5 Fine Tuned | First Fine-tuned model of GPT-3.5 | GPT-3.5 | β |
| GM GPT-3.5 Physics Fine Tuned | Fine-tuned GPT-3.5 model trained to generate Physics animations | GPT-3.5 | β |
| GM Claude Sonnet | Claude Sonnet 3 model from Sonnet adapted with our custom System Prompt | claude-3-sonnet-20240229 | β |
| GM Claude Sonnet 3.5 | Claude Sonnet 3.5 model from Sonnet adapted with our custom System Prompt | claude-3-5-sonnet-20240620 | β |
| GM Qwen 2.5 Coder 7B | Open-source model fine-tuned with SFT + DPO + GRPO pipeline | Qwen2.5-Coder-7B-Instruct | π§ |
| GM DeepSeek Coder V2 Lite | Open-source model fine-tuned with SFT + DPO + GRPO pipeline | DeepSeek-Coder-V2-Lite | π§ |
| GM CodeLlama 7B | Open-source model fine-tuned with SFT + DPO + GRPO pipeline | CodeLlama-7b-Instruct | π§ |
If you want to suggest a new model, please open an issue in the repository or talk with us in our Discord server.
We're training open-source models to generate Manim code using a 3-stage pipeline that distills from GPT-4o:
- SFT (Supervised Fine-Tuning) β Train on 5,000+ validated promptβcode pairs
- DPO (Direct Preference Optimization) β Learn from render success/failure pairs
- GRPO (Group Relative Policy Optimization) β RL with the Manim renderer as a deterministic reward signal
The key insight: Manim is a deterministic verifier β code either renders or crashes. This replaces the need for a reward model, similar to how DeepSeek-R1 uses math answer checkers.
Base models: Qwen 2.5 Coder 7B, DeepSeek Coder V2 Lite, CodeLlama 7B β all using QLoRA (4-bit) to fit on free Kaggle T4 GPUs.
Generative Manim now includes an executable benchmark MVP for expert Manim code generation under training/benchmarks.
The benchmark is built around the right primitives for programming evaluation:
- a frozen task suite
- render-based scoring
- Manim-specific structural checks
- pass@k for stochastic code generation
- reproducible JSONL and JSON reports
Start here:
cd training
python -m benchmarks.run export \
--suite benchmarks/tasks/core_v1.jsonl \
--output ./outputs/benchmarks/core_v1_prompts.jsonlThen use the generated prompt file with python -m eval.generate_responses ..., or run the full flow with:
bash ./scripts/run_benchmark.sh qwen2.5-coder-7b ./outputs/grpo/qwen2.5-coder-7b benchmarks/tasks/core_v1.jsonl grpo 5 0.8 1,5See training/benchmarks/README.md for the benchmark design and workflow.
Once you have multiple benchmark runs, compare them with:
cd training
python -m benchmarks.compare --results-dir ./outputs/benchmarks --suite core_v1Or run a whole benchmark matrix from a manifest:
cd training
python -m benchmarks.matrix --manifest benchmarks/manifests/open_source_core_v1.json --dry-runGenerative Manim is currently sponsored by The Astronomical Software Company.
Generative Manim is an open source project.
If you want to be the author of a new feature, fix a bug or contribute with something new.
Fork the repository and make changes as you like. Pull requests are warmly welcome. Remember you can also join our Discord server to discuss new features, bugs or any other topic.

