Turns any math topic into a 3Blue1Brown-style animated video from your terminal. Real Manim renders, not AI slop. Works offline. Topic in, video out.
Manimator — 3Blue1Brown-Quality Math Video Generator from Your Terminal
Topic: Productivity and Automation
The Problem Statement
Berea students learn math better through visuals — but creating quality educational math animations is incredibly hard. Tools like 3Blue1Brown's Manim require deep Python expertise and hours of manual coding per scene. Meanwhile, "AI video generators" produce generic slideshow garbage with stock footage. There's nothing in between: either you spend 20 hours hand-coding a 5-minute Manim video, or you get AI slop. Berea students and tutors deserve a tool that produces real, beautiful math content — without the 20-hour barrier.
The Solution (How it Works)
Manimator is a fully automated pipeline that takes a math topic and produces a 3Blue1Brown-style animated video — complete with voiceover — entirely from your terminal.
A student launches manimator in their terminal, selects an LLM provider (Offline/Ollama for free local generation, OpenAI, or Claude), types a topic like "Trigonometry", picks difficulty, length, resolution, and voiceover toggle, then hits Start. The pipeline then:
- Plans a full video storyboard (scenes, narration, equations)
- Generates real Manim Python code — not slides, not stock footage
- Renders each scene with the actual Manim engine (the same tool 3Blue1Brown uses)
- Generates voiceover using Piper TTS (offline male voice) or macOS speech
- Stitches everything into a final MP4 with ffmpeg
The entire UI is a premium dark-themed TUI (Terminal User Interface) built with Textual. The video library displays real thumbnail previews inline in the terminal using the Kitty graphics protocol. You can browse, replay, and resume failed renders — all without leaving your shell.
Tech Stack
TUI Framework: Python, Textual (full-screen terminal app) Animation Engine: Manim Community Edition (the open-source 3Blue1Brown engine) LLM Providers: Anthropic Claude API (with prompt caching), OpenAI API, Ollama (local/offline) Text-to-Speech: Piper TTS (offline, open-source), macOS say Video Processing: ffmpeg (scene stitching, audio merge) Terminal Graphics: Kitty graphics protocol (inline image/video rendering in terminal) Rendering: Parallel scene rendering with Python concurrent.futures
Challenges We Ran Into
The biggest challenge was LLM code quality. The first version generated 1300-line Manim scripts where every scene class had 3 separate acts crammed in, duplicate constant blocks scattered everywhere, and wrong API calls like Axes.get_axis_label(font_size=...) which doesn't exist. All 5 scenes would fail to render.
We had to completely rethink the prompt engineering — adding strict rules about scene length (max 8 animations), explicit prohibited API patterns, and a deduplication pass that strips repeated import/constant blocks from LLM output. We also built an auto-fix loop: when a scene fails to render, the error is sent back to the LLM for a targeted fix, and only that scene gets re-rendered.
Another challenge was voiceover-animation sync. We solved this by measuring exact audio durations with ffprobe before writing animations, then calibrating self.wait() calls to match the narration timing.
Accomplishments We're Proud Of
Real Manim renders, not AI slop. Every frame is vector-rendered by the same engine 3Blue1Brown uses. The output is actual mathematical animation, not diffusion-model hallucinations.
Three LLM modes including fully offline. You can generate math tutorial videos on an airplane with Ollama. Zero API calls. Zero cost. Zero internet.
Prompt caching on Claude API — the massive knowledge base (3b1b aesthetic rules, Manim API constraints, gold-standard examples) gets cached, cutting cost by 90% on subsequent calls.
Inline terminal graphics. We render video thumbnails inside the terminal using the Kitty graphics protocol. A TUI that displays images.
A 2-call architecture. The entire video generation uses only 2 LLM calls (plan + code). Only failures trigger additional calls. This makes it fast and cheap.
Generated 6+ complete videos during the hackathon: Trigonometry, Law of Large Numbers, Fundamental Theorem of Calculus, Mathematical Induction, Stock Market Math, and more.
Setup Instructions
git clone https://github.com/chbayah-sudo/manimator.git cd manimator/manimator brew install cairo pkg-config ffmpeg pip install manim pip install -e . echo 'ANTHROPIC_API_KEY=your-key' > .env manimator
The Team
Oussema Chbayah — Solo developer. Full-stack: pipeline architecture, LLM integration, TUI design, Manim engine, voiceover system, prompt engineering.
Log in or sign up for Devpost to join the conversation.