Instructions to use kelnei/slugvision-2.2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kelnei/slugvision-2.2b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf kelnei/slugvision-2.2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf kelnei/slugvision-2.2b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kelnei/slugvision-2.2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf kelnei/slugvision-2.2b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf kelnei/slugvision-2.2b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf kelnei/slugvision-2.2b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf kelnei/slugvision-2.2b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf kelnei/slugvision-2.2b:Q4_K_M
Use Docker
docker model run hf.co/kelnei/slugvision-2.2b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use kelnei/slugvision-2.2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kelnei/slugvision-2.2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kelnei/slugvision-2.2b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/kelnei/slugvision-2.2b:Q4_K_M
- Ollama
How to use kelnei/slugvision-2.2b with Ollama:
ollama run hf.co/kelnei/slugvision-2.2b:Q4_K_M
- Unsloth Studio
How to use kelnei/slugvision-2.2b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kelnei/slugvision-2.2b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kelnei/slugvision-2.2b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kelnei/slugvision-2.2b to start chatting
- Atomic Chat new
- Docker Model Runner
How to use kelnei/slugvision-2.2b with Docker Model Runner:
docker model run hf.co/kelnei/slugvision-2.2b:Q4_K_M
- Lemonade
How to use kelnei/slugvision-2.2b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kelnei/slugvision-2.2b:Q4_K_M
Run and chat with the model
lemonade run user.slugvision-2.2b-Q4_K_M
List all available models
lemonade list
slugvision-2.2b
A 2.2B-parameter vision-language model that turns an uploaded image (plus an
optional article title) into a 3–5 word kebab-case permalink slug. It is the
quality-leader sibling of
slugvision-500m: on untitled
photos the blind LLM-judge gap to the 26B-class teacher drops from 1.1
(500M) to 0.63, at ~10x the CPU latency (16s vs 1.6s cold per image on 6
desktop threads).
LoRA fine-tune (r16, merged) of SmolVLM2-2.2B-Instruct, distilled from a Gemma teacher on ~31k image→slug pairs spanning five slices of an editorial-image distribution: everyday photos, conceptual editorial illustrations, product shots, clinical stock imagery, and web screenshots. Training data: kelnei/slugvision.
Pick this model if untitled-photo slug quality matters more than latency; pick the 500M if you serve on CPU and most uploads come with an article title (titled modes are near teacher parity at both sizes). The full pipeline (corpus generation, training, eval, export) is at github.com/kelnei/slugvision.
Input contract
Trained on exactly two prompt templates — use them verbatim.
Without a title (slug describes visible content):
Create a URL slug for this image: 3 to 5 lowercase words joined by hyphens. Reply with the slug only.
With an article title (slug reflects the article topic; image steers emphasis):
This image appears in an article titled: "{title}"
Create a URL slug for the image in this article's context: 3 to 5 lowercase words joined by hyphens. Reply with the slug only.
Images were preprocessed with size={"longest_edge": 1024} during training;
match it at inference (the bundled GGUF mmproj embeds this cap).
Usage
llama.cpp
llama-mtmd-cli -m slugvision-2.2b-q8_0.gguf --mmproj mmproj-f16.gguf \
--image photo.jpg -n 32 --temp 0 \
-p 'Create a URL slug for this image: 3 to 5 lowercase words joined by hyphens. Reply with the slug only.'
Transformers
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
processor = AutoProcessor.from_pretrained("kelnei/slugvision-2.2b", size={"longest_edge": 1024})
model = AutoModelForImageTextToText.from_pretrained(
"kelnei/slugvision-2.2b", torch_dtype=torch.bfloat16, device_map="auto"
)
messages = [{"role": "user", "content": [
{"type": "image", "url": "photo.jpg"},
{"type": "text", "text": "Create a URL slug for this image: 3 to 5 lowercase words joined by hyphens. Reply with the slug only."},
]}]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt"
).to(model.device, dtype=torch.bfloat16)
out = model.generate(**inputs, max_new_tokens=32, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Files
| File | Purpose |
|---|---|
model.safetensors + configs |
Merged bf16 checkpoint (LoRA already folded in) |
slugvision-2.2b-q8_0.gguf |
llama.cpp language model, Q8_0 (recommended) |
slugvision-2.2b-q4_k_m.gguf |
llama.cpp language model, Q4_K_M |
mmproj-f16.gguf |
llama.cpp vision projector, f16, 1024px cap |
Evaluation
Blind pairwise LLM-judge against the teacher on a frozen 1,000-image holdout (rubric 1–5 per slug; the judge never knows which is which). Token-F1 is overlap with the teacher's slug.
| Slice | Judge (student vs teacher) | Token-F1 |
|---|---|---|
| photo (untitled) | 3.87 vs 4.50 (wins/ties 45%) | 0.62 |
| illustration (titled) | 3.44 vs 3.65 | 0.71 |
| product (untitled) | 3.86 vs 4.55 | 0.66 |
| clinical (mixed) | 4.04 vs 4.68 | 0.66 |
| screenshot (titled) | 3.90 vs 4.12 | 0.72 |
Format validity ~99–100% across slices. In the 500M/2.2B capacity ladder, model size was the only lever that moved untitled-photo quality — 4x photo data, extra slices, and LoRA r64 all left the 500M's gap at ~1.0; this model cut it to 0.63 in one step.
CPU latency (llama.cpp, 6 threads, full cold start per image): ~16s at Q8_0 or Q4_K_M — image encode dominates (the 2.2B vision tower cuts ~9 crops per image at the 1024px cap). On any modest GPU it is sub-second.
Training
LoRA r16 on all linear layers, 1 epoch over 30,739 pairs, batch 8 with grad-accum 2, bf16, images capped at 1024px longest edge. Labels authored by a Gemma-family teacher (26B-class, locally hosted); titled-mode labels were generated with the source article headline in context.
License and provenance
- Base model: SmolVLM2-2.2B-Instruct, Apache-2.0.
- The fine-tuning labels are outputs of a Gemma-family model, so this
distilled model is distributed under the
Gemma Terms of Use with its
prohibited use policy;
hence the
gemmalicense tag. - Photo-slice training images came from COCO train2017 and are not redistributed here or in the dataset repo; all other training images are locally generated (FLUX.1-schnell renders, self-authored HTML screenshots) and ship with the dataset.
Limitations
- English slugs only.
- Tuned for editorial-image distributions (article cards); out-of-domain images (documents, memes, dense text) are untested.
- The slug is not guaranteed unique — collision handling belongs in your permalink generator.
- Downloads last month
- 121
Model tree for kelnei/slugvision-2.2b
Base model
HuggingFaceTB/SmolLM2-1.7B