Instructions to use vikramlingam/VLQM-1.5B-Coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vikramlingam/VLQM-1.5B-Coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vikramlingam/VLQM-1.5B-Coder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vikramlingam/VLQM-1.5B-Coder") model = AutoModelForCausalLM.from_pretrained("vikramlingam/VLQM-1.5B-Coder") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vikramlingam/VLQM-1.5B-Coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vikramlingam/VLQM-1.5B-Coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikramlingam/VLQM-1.5B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vikramlingam/VLQM-1.5B-Coder
- SGLang
How to use vikramlingam/VLQM-1.5B-Coder with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "vikramlingam/VLQM-1.5B-Coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikramlingam/VLQM-1.5B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "vikramlingam/VLQM-1.5B-Coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikramlingam/VLQM-1.5B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vikramlingam/VLQM-1.5B-Coder with Docker Model Runner:
docker model run hf.co/vikramlingam/VLQM-1.5B-Coder
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("vikramlingam/VLQM-1.5B-Coder")
model = AutoModelForCausalLM.from_pretrained("vikramlingam/VLQM-1.5B-Coder")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))🚀 VLQM-1.5B-Coder
A fine-tuned language model for generating Manim animation code from natural language descriptions.
📖 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.
⚠️ Limitations
Known Limitations
- Complex Animations: May struggle with multi-step animations involving many objects
- Advanced Manim Features: Less reliable with 3D scenes, complex graphs, or advanced camera movements
- API Hallucinations: Sometimes generates non-existent Manim methods (e.g.,
axes.get_sine()) - Indentation Issues: Occasionally produces incorrectly indented code
- 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
- Base Model: Qwen/Qwen2.5-Coder-1.5B-Instruct by Alibaba
- Dataset: generaleoley/manim-codegen
- Training Framework: Apple MLX
- Animation Engine: Manim Community
📬 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
- 6
Model tree for vikramlingam/VLQM-1.5B-Coder
Base model
Qwen/Qwen2.5-1.5B
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vikramlingam/VLQM-1.5B-Coder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)