ManimAI is a web application that uses AI to generate mathematical animations using Manim. Simply describe the mathematical concept you want to visualize, and ManimAI will generate a beautiful animation for you - no coding required!
- 🤖 AI-Powered Generation: Describe your desired animation in natural language
- 🎨 Visual Mathematics: Create stunning mathematical visualizations
- 💻 No Coding Required: Generate Manim animations without writing code
- ⚡ Instant Results: Get your animations in seconds
- 💬 Interactive Chat Interface: Conversational AI for creating animations
- 📚 Chat History & Sessions: Save and manage multiple conversation sessions
- 🎥 Video Downloads: Download animations as MP4 or GIF formats
- 🌙 Dark/Light Mode: Toggle between themes for comfortable viewing
- 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- ☁️ Cloud Storage: Animations stored securely with Cloudinary CDN
- FastAPI
- Google Gemini AI
- Manim
- Cloudinary
- MongoDB Atlas (Cloud database for chat persistence)
- Motor (Async MongoDB driver)
- Python 3.11+
- Node.js 18+
- Manim Dependencies
- Cloudinary Account
- Google Gemini API Key
- MongoDB Atlas
- Clone the repository
git clone https://github.com/roykhushi/llmanim.git
cd llmanim- Install Backend Dependencies
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Install Frontend Dependencies
cd frontend
npm install- Set up Environment Variables
Backend (.env):
GEMINI_API_KEY=your_gemini_api_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
MONGODB_URL=mongodb+srv://username:password@cluster.mongodb.net/
DATABASE_NAME=llmanimFrontend (.env):
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000-
Set up MongoDB Atlas
- Create a free account at MongoDB Atlas
- Create a new cluster
- Get your connection string and update the
MONGODB_URLin your.envfile - Make sure to whitelist your IP address in the Atlas dashboard
-
Start the Backend Server
cd backend
source venv/bin/activate # On Windows: venv\Scripts\activate
fastapi dev main.py- Start the Frontend Development Server
cd frontend
npm run dev- Open http://localhost:3000 in your browser
- Navigate to
/chatto access the interactive chat interface - Create new chat sessions or continue previous conversations
- Type your mathematical animation requests in natural language
- Download generated animations in MP4 or GIF format
- View and manage your chat history in the sidebar
- "Create an animation showing the quadratic formula derivation"
- "Animate the concept of integration by parts"
- "Show how matrix multiplication works with 2x2 matrices"
- "Visualize the Pythagorean theorem proof"
- "Create an animation of a sine wave transformation"
POST /api/generate- Generate animation from text prompt
GET /api/chat/sessions- Get all chat sessionsPOST /api/chat/sessions- Create new chat sessionGET /api/chat/sessions/{session_id}- Get specific session with messagesDELETE /api/chat/sessions/{session_id}- Delete chat sessionGET /api/chat/test-db- Test database connection
llmanim/
├── backend/
│ ├── app/
│ │ ├── lib/
│ │ │ ├── cloudinary.py
│ │ │ └── database.py
│ │ ├── models/
│ │ │ ├── chat_models.py
│ │ │ └── schema.py
│ │ ├── routes/
│ │ │ ├── chat.py
│ │ │ └── generate.py
│ │ └── services/
│ │ ├── chat_service.py
│ │ ├── gemini.py
│ │ └── manim.py
│ ├── videos/
│ │ ├── outputs/
│ │ └── scripts/
│ ├── main.py
│ └── requirements.txt
└── frontend/
├── app/
│ ├── chat/
│ │ └── page.tsx
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ ├── ui/
│ ├── ChatInput.tsx
│ ├── ChatMessage.tsx
│ ├── ChatSidebar.tsx
│ └── Navbar.tsx
├── lib/
│ └── utils.ts
└── public/
Contributions are welcome! Please feel free to submit a Pull Request.
- Manim Community
- Google Gemini
- 3Blue1Brown for inspiration
