SmolVLM-256M GGUF
GGUF build of HuggingFaceTB/SmolVLM-256M-Instruct (Idefics3: SigLIP-base tower + SmolLM2-135M), for the SkyVision.cpp inference engine.
At 403 MB (q8) this is the smallest model the engine supports, which is why it is the one bundled into the project's container image: an MCP server that can actually caption an image without mounting multi-gigabyte weights.
Files
| file | size | |
|---|---|---|
smolvlm-256m-q8_0.gguf |
403 MB | recommended, what the Docker image uses |
smolvlm-256m-f16.gguf |
515 MB | reference precision |
tokenizer.json |
3.4 MB | SmolLM2 tokenizer (GPT-2 regex + specials), required |
README.md |
this card |
Usage
git clone https://github.com/SkYContact/SkyVision.cpp && cd SkyVision.cpp
git clone --depth 1 https://github.com/ggml-org/ggml
cmake -B build -DGGML_AVX2=ON -DGGML_FMA=ON && cmake --build build --target vqa-cli
# vision Q&A
./build/vqa-cli --model smolvlm-256m-q8_0.gguf --tokenizer tokenizer.json \
--image photo.jpg --ask "How many people are in the image?"
# captioning / MCP server for agents
./build/vqa-cli ... --ask "Describe this image." --mode caption # (any prompt works)
./build/vqa-cli --mcp --models-dir .
Or straight from the published image: docker run --rm -i ghcr.io/skycontact/skyvision-mcp
(then send MCP JSON-RPC on stdin).
What it is
| stage | |
|---|---|
| vision | SigLIP-base: Conv2d(3,768,16,16) + bias, learned 32×32 positions (no cls), 12 layers of LayerNorm(with bias) + attention (qkv/out bias, no rope) + MLP (gelu_pytorch_tanh) |
| connector | 4×4 pixel shuffle → one Linear(12288→576), so a 512² tile becomes exactly 64 text tokens |
| text | SmolLM2-135M: 30 layers, d=576, GQA 9:3, head_dim 64, no biases, RMSNorm 1e-5, rope theta 1e5, untied lm_head |
Idefics3 preprocessing: resize the longest edge to 2048, resize again so both sides are
multiples of 512 (aspect deliberately not preserved), cut 512² tiles row-major and append
one global view; the prompt expands <image> into <fake><row_R_col_C><image>×64 per tile
plus <fake><global-img><image>×64<fake>.
Notes
- The official processor upscales every image to 2048, so a 960×504 photo becomes 13 crops
(832 image tokens). The engine caps it at 1024 by default (
SMOLVLM_MAX_EDGE), which is 2.3× faster with identical answers in our tests; setSMOLVLM_MAX_EDGE=2048to reproduce the official preprocessing exactly. - Each crop costs ~174 GFLOP of CPU work (the MLP dominates, not the attention), so time scales with the crop count: 5 crops ≈ 2.7 s on 19 threads, ≈ 22 s on one thread.
- Parity vs the official implementation: pixels corr 0.99997, last-position logits corr 0.99991, byte-identical answers.
- Weights are Apache-2.0 (inherited from SmolVLM); this GGUF conversion keeps that license.