Run this model with HF Jobs
Run AsadIsmail/SmolVLM2-2.2B-Instruct-ternary on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use AsadIsmail/SmolVLM2-2.2B-Instruct-ternary with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AsadIsmail/SmolVLM2-2.2B-Instruct-ternary with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AsadIsmail/SmolVLM2-2.2B-Instruct-ternary")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AsadIsmail/SmolVLM2-2.2B-Instruct-ternary", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AsadIsmail/SmolVLM2-2.2B-Instruct-ternary with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary
- SGLang
How to use AsadIsmail/SmolVLM2-2.2B-Instruct-ternary 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 "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AsadIsmail/SmolVLM2-2.2B-Instruct-ternary", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AsadIsmail/SmolVLM2-2.2B-Instruct-ternary with Docker Model Runner:
docker model run hf.co/AsadIsmail/SmolVLM2-2.2B-Instruct-ternary
SmolVLM2-2.2B-Instruct β Ternary Quantized (tritplane3)
Ternary-quantized version of HuggingFaceTB/SmolVLM2-2.2B-Instruct using ternary-quant.
Compact VLM designed for edge deployment, now even smaller with ternary quantization.
Model Specifications
| Property | Value |
|---|---|
| Base Model | HuggingFaceTB/SmolVLM2-2.2B-Instruct |
| Parameters | 2.2B |
| Architecture | VLM (image + text) |
| Quantization | tritplane3 (169 layers, 10.92 effective bits) |
| Vision Encoder | FP16 (preserved) |
| Compression | 1.47x |
| Avg Reconstruction Error | 0.1236 |
| License | Apache 2.0 |
Size Comparison
| Method | Size | VLM Support |
|---|---|---|
| FP16 (original) | ~4.4 GB | Yes |
| Ternary tritplane3 | 1.8 GB | Yes |
No GGUF alternative exists for SmolVLM2.
Quality Verification
Validated during quantization (collapse score: 0.009 β excellent):
| Test | Output |
|---|---|
| Image description (demo) | "A yellow circle with a diagonal line through it" (correct) |
| "What is machine learning?" | Correct, detailed explanation of ML, algorithms, training |
| "Explain gravity" | Accurate one-sentence explanation |
Memory Requirements
| Runtime | Min Memory | Hardware |
|---|---|---|
cached (CPU) |
~4 GB RAM | Any |
metal (Apple Silicon) |
~3 GB unified | M1+ |
cached (CUDA) |
~3 GB VRAM | Any NVIDIA GPU |
Ideal for edge deployment β runs on devices with 4 GB RAM.
Quickstart
pip install ternary-quant
from ternary_quant.inference import load_ternary_model
model, processor = load_ternary_model(
"AsadIsmail/SmolVLM2-2.2B-Instruct-ternary",
runtime_mode="cached", device="auto"
)
inputs = processor(text="Describe this image", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128)
print(processor.decode(outputs[0], skip_special_tokens=True))
Collection
Part of ternary-models.
GitHub: github.com/Asad-Ismail/ternary-models | Library: github.com/Asad-Ismail/ternary-quant
Model tree for AsadIsmail/SmolVLM2-2.2B-Instruct-ternary
Base model
HuggingFaceTB/SmolLM2-1.7B