How to use from
Docker Model Runner
docker model run hf.co/vikramlingam/VLQM-1.5B-Coder
Quick Links

๐Ÿš€ VLQM-1.5B-Coder

A fine-tuned language model for generating Manim animation code from natural language descriptions.

Base Model Framework License


๐Ÿ“– Model Description

VLQM-1.5B-Coder is a specialized language model fine-tuned to generate Manim Python code from natural language descriptions. Manim is the mathematical animation engine famously used by 3Blue1Brown.

What This Model Does

Given a natural language prompt:

"Create a blue circle that moves to the right"

The model generates valid Manim Python code:

from manim import *

class GenScene(Scene):
    def construct(self):
        circle = Circle(color=BLUE)
        self.add(circle)
        self.play(circle.animate.shift(RIGHT * 3))

๐ŸŽฏ Intended Use

  • Primary Use: Generating Manim animation code from text descriptions
  • Users: Developers, educators, content creators making math/science animations
  • Languages: English prompts, Python code output

Example Use Cases

  • Creating educational math animations
  • Generating visualizations for presentations
  • Prototyping Manim scenes quickly
  • Learning Manim syntax through examples

๐Ÿ“Š Training Details

Property Value
Base Model Qwen/Qwen2.5-Coder-1.5B-Instruct
Parameters 1.5 Billion
Training Method LoRA (Low-Rank Adaptation)
Dataset generaleoley/manim-codegen
Training Examples 1,459
Validation Examples 163
Training Framework Apple MLX
Hardware MacBook Pro (Apple Silicon)

Hyperparameters

Parameter Value
Iterations 300
Batch Size 2
Gradient Accumulation 8
Learning Rate 5e-5
LoRA Layers 16
Max Sequence Length 8,192


๐Ÿ“ˆ Model Performance

Training Loss Curve

The model shows a strong convergence pattern, with validation loss stabilizing around 0.71 and training loss reaching 0.48.

Training Loss Curve

โš ๏ธ Limitations

Known Limitations

  1. Complex Animations: May struggle with multi-step animations involving many objects
  2. Advanced Manim Features: Less reliable with 3D scenes, complex graphs, or advanced camera movements
  3. API Hallucinations: Sometimes generates non-existent Manim methods (e.g., axes.get_sine())
  4. Indentation Issues: Occasionally produces incorrectly indented code
  5. Long Prompts: Performance degrades with very long or complex descriptions

What This Model is NOT

  • โŒ Not a general-purpose code generator
  • โŒ Not trained for non-Manim Python code
  • โŒ Not suitable for production without human review
  • โŒ Not a replacement for learning Manim fundamentals

Recommended Practices

  • โœ… Always review and test generated code before use
  • โœ… Use simple, clear prompts for best results
  • โœ… Keep prompts focused on one animation at a time
  • โœ… Be prepared to make minor edits to fix issues

๐Ÿš€ Quick Start

Using with Transformers (Cross-Platform)

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "vikramlingam/VLQM-1.5B-Coder",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("vikramlingam/VLQM-1.5B-Coder")

prompt = "Create a red square that rotates"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0]))

Using with MLX (Apple Silicon)

python -m mlx_lm.generate \
    --model vikramlingam/VLQM-1.5B-Coder \
    --prompt "Create a circle animation" \
    --max-tokens 256

๐Ÿ“ Model Files

VLQM-1.5B-Coder/
โ”œโ”€โ”€ config.json              # Model configuration
โ”œโ”€โ”€ model.safetensors        # Model weights (~3 GB)
โ”œโ”€โ”€ tokenizer.json           # Tokenizer
โ”œโ”€โ”€ tokenizer_config.json
โ”œโ”€โ”€ vocab.json
โ”œโ”€โ”€ merges.txt
โ”œโ”€โ”€ generation_config.json
โ”œโ”€โ”€ special_tokens_map.json
โ””โ”€โ”€ README.md                # This file

๐Ÿ“œ License

This model is released under the Apache 2.0 License.

  • โœ… Commercial use allowed
  • โœ… Modification allowed
  • โœ… Distribution allowed
  • โš ๏ธ Must include license and copyright notice

๐Ÿ™ Acknowledgments


๐Ÿ“ฌ Citation

If you use this model, please cite:

@misc{vlqm-1.5b-coder,
  author = {Vikram Lingam},
  title = {VLQM-1.5B-Coder: Manim Code Generation Model},
  year = {2025},
  publisher = {Hugging Face},
  url = {https://huggingface.co/vikramlingam/VLQM-1.5B-Coder}
}

๐Ÿ“Š Model Card Contact

For questions or issues, please open a discussion on the model's Hugging Face page.

Downloads last month
17
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for vikramlingam/VLQM-1.5B-Coder

Finetuned
(230)
this model

Dataset used to train vikramlingam/VLQM-1.5B-Coder