Spaces:
Running
Running
π Quick Deployment Guide for Hugging Face Spaces
This is a quick reference for deploying NeuroAnim to Hugging Face Spaces.
Prerequisites
β You have created a Hugging Face Space β You have your API keys ready
Step-by-Step Deployment
1. Create Your Space
- Go to https://huggingface.co/spaces
- Click "Create new Space"
- Fill in:
- Owner: Your username
- Space name:
neuroanim(or your choice) - License: MIT
- Select the SDK: Gradio
- Space hardware: CPU basic (free) - can upgrade later
- Click "Create Space"
2. Configure Secrets (IMPORTANT!)
Go to your Space β Settings β Variables and secrets
Add these secrets:
HUGGINGFACE_API_KEY = your_huggingface_token_hereOptional (but recommended):
ELEVENLABS_API_KEY = your_elevenlabs_key_here BLAXEL_API_KEY = your_blaxel_key_here MANIM_SANDBOX_IMAGE = your_sandbox_image_hereClick "Save" for each secret
3. Push Your Code
You have two options:
Option A: Using Git (Recommended)
# Navigate to your project
cd "/media/bhaves/Volume 2/manim-agent"
# Add HF Space as remote (replace YOUR_USERNAME and YOUR_SPACE_NAME)
git remote add space https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
# Create a deployment branch (optional but recommended)
git checkout -b hf-deploy
# Copy the HF-specific README
cp README_HF.md README.md
# Add and commit deployment files
git add requirements.txt README.md app.py orchestrator.py
git add mcp_servers/ utils/ neuroanim/ manim_mcp/
git add pyproject.toml .gitignore
git commit -m "Initial Hugging Face Space deployment"
# Push to HF Space
git push space hf-deploy:main
Option B: Web Upload (Easier but slower)
- Go to your Space β Files and versions tab
- Click "Add file" β "Upload files"
- Upload these files/folders:
app.pyβ (main entry point)requirements.txtβ (dependencies)README_HF.mdβ rename toREADME.mdβorchestrator.pypyproject.toml- Folders:
mcp_servers/,utils/,neuroanim/,manim_mcp/
- Click "Commit changes to main"
4. Monitor Build
- Go to your Space β App tab
- Watch the build logs (bottom of page)
- Wait 5-10 minutes for first build
- Look for:
Running on public URL: https://...
5. Test Your Space
Once deployed:
- Enter a topic: "Pythagorean Theorem"
- Select audience: "high_school"
- Duration: 2 minutes
- Quality: "Medium"
- Click "Generate Animation"
- Wait for generation (may take 3-5 minutes)
- Verify video plays and downloads work
Troubleshooting
Build Fails
- Check Logs tab for errors
- Verify
requirements.txtis correct - Ensure all files are uploaded
"API Key Not Set" Error
- Go to Settings β Variables and secrets
- Add
HUGGINGFACE_API_KEY - Restart Space (Settings β Factory reboot)
Slow or Timeout
- Upgrade hardware: Settings β Change hardware
- Try GPU T4 for faster rendering
- Reduce animation duration for testing
Import Errors
- Check all folders are uploaded (
mcp_servers/,utils/, etc.) - Verify folder structure matches local
Hardware Recommendations
| Hardware | Cost | Best For |
|---|---|---|
| CPU basic | Free | Testing, demos |
| CPU upgrade | $0.03/hr | Light usage |
| GPU T4 | $0.60/hr | Production, fast rendering |
Next Steps
β Share your Space URL with others β Enable community features (Settings β Visibility) β Add example videos to README β Monitor usage in Analytics tab
Getting Your Space URL
Your Space will be available at:
https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
Share this link to let others use your animation generator!
Need help? Check the full deployment guide in implementation_plan.md