Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 3.89 KB

VISION.md

File metadata and controls

87 lines (62 loc) · 3.89 KB

Vision: image input

generate, chat and serve take images, on the CPU and on the GPU. The model needs its projector file (an mmproj GGUF). The general flag reference is in USAGE.md.

Models that take images

Model Checked with
Qwen3-VL projectors (qwen3vl_merger) qwen3.5-2b with qwen3.5-2b-mmproj.gguf, and the Qwen3.6-35B-A3B mmproj
Qwen3.8 Flash-Next (qwen4exp, same projector, projection_dim 2560) unsloth's UD-IQ2_XS with mmproj-F16.gguf
Gemma 4 (gemma4v) the gemma-4-26B-A4B mmproj-F16
Gemma 4 unified (gemma4uv) the gemma-4-unified-0.8B-tiny mmproj-f16 with its Q2_K text GGUF
Inkling 2 the Inkling 2 mmproj-F16

The target is the whole Qwen family: qwen35, qwen35moe, qwen4exp, qwen3next, qwen3, qwen3moe.

Commands

# The first mmproj*.gguf next to the model is used
rustingstrata generate --model model.gguf --image photo.png --prompt "Describe this picture: <image>"

rustingstrata chat --model model.gguf --mmproj mmproj.gguf --image photo.png

rustingstrata serve --model model.gguf --mmproj mmproj.gguf --gpu
Flag Default Meaning
--image SRC none A file path, a data URL or an http(s) URL. Repeatable.
--mmproj FILE the first mmproj*.gguf next to the model The projector file. none loads no projector.
  • In generate, each image goes where the prompt has <image>. Without <image>, all images go before the prompt.
  • generate is raw completion. A chat-tuned Gemma 4 needs its template in --prompt, or use chat.
  • chat and serve use the model's tokenizer.chat_template. --think turns Gemma 4 thinking on.
  • Image files are png, jpeg or webp.

Server requests

serve reads OpenAI image_url parts and Anthropic image blocks (base64 or URL):

{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}}
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "..."}}

The chat page has an attach button, paste and previews. It sends image_url parts with the message.

An http(s) image is fetched only from a public address:

  • Loopback, private, link-local, 100.64.0.0/10 and reserved addresses are refused. This also holds for IPv4-mapped, NAT64 and 6to4 IPv6 addresses, and for every redirect.
  • With HTTP(S)_PROXY or ALL_PROXY set, the download goes through the proxy (NO_PROXY applies). Redirects are not followed then.
  • The proxy resolves the host again. A DNS answer that changes after the check is not caught.

GPU

With --gpu the encoders (Qwen3-VL, Gemma 4, Inkling 2) run on the GPU, with CUDA or Vulkan.

  • A 1024x768 image with the Qwen3.6-35B-A3B mmproj-BF16 on the RTX 3060 encodes in 4.1 to 4.5 s with CUDA and 3.8 to 4.7 s with Vulkan, against 24 s on the CPU (12 threads).
  • An operation that fails on the GPU, for example for lack of VRAM, is reported once. It stays on the CPU for the rest of the run.
  • The GPU encoder rounds differently, so its embeddings differ slightly from the CPU ones.

Limits and errors

  • Without a projector, serve answers an image request with a 400 that names --mmproj.
  • Gemma 4 in chat and serve decodes greedily. Its serve rejects tools and answers on /v1/chat/completions only.
  • A Qwen3-VL image is resized with its aspect ratio kept, to a pixel count in [8*32*32, 4096*32*32].
  • A Gemma 4 image takes at least 40 tokens: a 64x64 image grows to 336x336.

Not working or planned

  • GLM-4V and DeepSeek-OCR projectors are rejected. RustingStrata has no matching text forward for them.
  • DeepSeek V4.1-Flash and GLM-5.3 are text-only upstream, so they take no images.
  • Audio projectors are out of scope.

Environment variables

Variable Meaning
STRATA_VISION_CPU=1 Keep the whole image encoder on the CPU.
STRATA_ALLOW_PRIVATE_IMAGE_URLS=1 Turn the address check off, for a trusted local setup.