Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

403 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

English | δΈ­ζ–‡θ―΄ζ˜Ž | EspaΓ±ol | Deutsch | ν•œκ΅­μ–΄


Generative Manim

Generative Manim

🎨 GPT-4o powered generative videos. Concept. ⚑️ Join our Discord server here!


Preview

πŸš€ Concept

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.

🎬 Animo

Animo is a lightweight desktop application that turns plain English descriptions into animated videos using AI and Manim. It is the natural evolution of Generative Manim, taking everything built in this repository and packaging it into a polished, self-contained desktop experience.

Key improvements over Generative Manim:

  • Desktop-first, local rendering: animations render on your machine with no cloud uploads, giving you full privacy and control over your work.
  • Unified workflow: everything lives in one app with no need to juggle a web UI, a separate API, and a render environment.
  • Zero extra cost: Animo uses your existing Claude or ChatGPT subscription with no additional fees on top of what you already pay.
  • Code ownership out of the box: generated Manim code is yours to export, version-control, and reuse without any platform lock-in.
  • Lower barrier to entry: no Manim knowledge required and no server setup or Docker container to run.

πŸ’» Models

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-5.6 Sol OpenAI's frontier model for complex professional and coding work gpt-5.6-sol βœ…
GM GPT-5.6 Terra Default OpenAI model, balances intelligence and cost gpt-5.6-terra βœ…
GM GPT-5.6 Luna Fastest, most cost-efficient OpenAI tier gpt-5.6-luna βœ…
GM GPT-4o Latest GPT model from OpenAI powered by a custom System Prompt GPT-4o βœ…
GM o1-mini Compact OpenAI reasoning model o1-mini βœ…
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-20241022 βœ…
GM Claude Sonnet 4.6 Claude Sonnet 4.6 adapted with our custom System Prompt claude-sonnet-4-6 βœ…
GM Claude Sonnet 5 Default Anthropic model, best combination of speed and intelligence claude-sonnet-5 βœ…
GM Claude Opus 4.7 Claude Opus 4.7 for highest-quality Anthropic generation claude-opus-4-7 βœ…
GM Claude Opus 4.8 Highest capability, state of the art on long-horizon agentic work claude-opus-4-8 βœ…
GM Claude Haiku 4.5 Claude Haiku 4.5 for fast, lightweight Anthropic generation claude-haiku-4-5-20251001 βœ…
GM Claude Fable 5 Most capable Anthropic model, for the most demanding reasoning claude-fable-5 βœ…
GM Featherless Open Models OpenAI-compatible access to hosted open-weight models via Featherless Qwen, DeepSeek, CodeLlama, etc. βœ…
GM LiteLLM Passthrough Accepts any model string supported by LiteLLM (e.g. openai/gpt-4o) litellm βœ…
GM Gemini 2.5 Flash Google's Gemini 2.5 Flash accessed via google-genai SDK gemini-2.5-flash βœ…
GM Gemini 2.5 Pro Google's Gemini 2.5 Pro accessed via google-genai SDK gemini-2.5-pro βœ…
GM Gemini 3 Flash Google's Gemini 3 Flash preview accessed via google-genai SDK gemini-3-flash-preview βœ…
GM Kimi K3 Moonshot AI's flagship model, 1M-token context with always-on thinking mode kimi-k3 βœ…
GM Kimi K2.7 Code Moonshot AI's coding-specialized agentic model kimi-k2.7-code βœ…
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 🚧

πŸ“‘ New Models

If you want to suggest a new model, please open an issue in the repository or talk with us in our Discord server.

🧠 Training Pipeline

We're training open-source models to generate Manim code using a 3-stage pipeline that distills from GPT-4o:

  1. SFT (Supervised Fine-Tuning): Train on 5,000+ validated prompt→code pairs
  2. DPO (Direct Preference Optimization): Learn from render success/failure pairs
  3. 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 use QLoRA (4-bit) to fit on free Kaggle T4 GPUs.

πŸ“ Benchmark

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.jsonl

Then 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,5

See 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_v1

Or run a whole benchmark matrix from a manifest:

cd training
python -m benchmarks.matrix --manifest benchmarks/manifests/open_source_core_v1.json --dry-run

You can also benchmark hosted open-weight models through Featherless:

export FEATHERLESS_API_KEY="your-featherless-key"
cd training
python -m benchmarks.matrix --manifest benchmarks/manifests/featherless_core_v1.json --only qwen2.5-coder-7b-instruct-featherless

See docs/featherless.md for API usage, smoke tests, and the full Featherless benchmark workflow.

✨ Sponsors

Generative Manim is currently sponsored by The Astronomical Software Company.

πŸ™Œ Contributors

Thank you to everyone who has contributed to Generative Manim!

Contributor Contribution
@abdullahsohaill Add Gemini 2.5 Flash and Gemini 3 Flash support via google-genai
@tranquac Fix command injection vulnerability in ffmpeg video export
@Wing900 Add Chinese README translation
@Puiching-Memory Formatter, config, and tooling improvements
@RheagalFire Add LiteLLM as AI gateway engine and streaming/edge case tests

🀲 Contributing

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.

Releases

Packages

Used by

Contributors

Languages