Skip to content

llama.cpp Vision Guide: Run Image and Audio Models Locally (2026)

6–9 minutes
Woman at a photo editing desk holding a tablet with a LLAMA.CPP VISION card, hook show your AI any image

llama.cpp is not just for text any more. With its multimodal library, libmtmd, you can show a local model an image, a screenshot, an audio clip or even a short video and ask questions about it, all offline on your own GPU or CPU.

This guide shows how to run vision and audio models with llama-server, llama-cli and llama-mtmd-cli: the one-line -hf method, using local GGUF and mmproj files, sending images through the OpenAI-compatible API, which models are ready to download, and how to fix the common errors.

It follows the llama.cpp docs/multimodal.md page and the tools/mtmd README as of November 2026.

TL;DR

  • Inputs: image, audio and video, through llama-server, llama-cli or llama-mtmd-cli.
  • Easiest: llama-server -hf ggml-org/gemma-3-4b-it-GGUF downloads the model and its projector together.
  • Local files: -m model.gguf --mmproj mmproj-model.gguf. You need both files.
  • API: send images to /v1/chat/completions in the OpenAI format.
  • Good picks: Gemma 4 and Gemma 3, Qwen2.5-VL, InternVL3, SmolVLM; Voxtral and Qwen3-ASR for audio; Qwen3 Omni and Gemma 4 E2B/E4B for both.
  • Note: multimodal support is under heavy development and breaking changes are expected.

How Multimodal Works in llama.cpp

A multimodal model in llama.cpp is split into two GGUF files:

File What it does
Language model (model.gguf) The normal LLM that reads and writes text
Multimodal projector (mmproj-*.gguf) Encodes images or audio into embeddings the LLM can understand

The projector is specific to each model architecture, so you must use the mmproj that matches your model. Keeping it separate lets the llama.cpp team add new vision models quickly without changing the core library.

A short history explains the names you may see in older guides: llava-cli came first, then model-specific tools such as qwen2vl-cli and gemma3-cli. These were all replaced by libmtmd and a single llama-mtmd-cli, and multimodal input now works directly in llama-server and llama-cli.

Quick Start With -hf

  1. Get a recent llama.cpp build (release download or source build). Older builds may not support newer models.
  2. Start a server with a vision model: llama-server -hf ggml-org/gemma-3-4b-it-GGUF
  3. The model and its matching mmproj download automatically (Q4_K_M by default for most ggml-org models).
  4. Open http://localhost:8080 in your browser, attach an image in the chat box and ask a question.
  5. Add -ngl 99 to put the whole model on your GPU and -c 8192 if the model needs a larger context.

Two useful switches: --no-mmproj loads an -hf model as text-only, and --mmproj local_file.gguf swaps in a custom projector.

Use Local GGUF and mmproj Files

If you downloaded files yourself, pass both:

llama-server -m gemma-3-4b-it-Q4_K_M.gguf \
  --mmproj mmproj-gemma-3-4b-it-Q4_K_M.gguf -ngl 99 -c 8192

The projector is offloaded to the GPU by default. To keep it on the CPU and save VRAM, add --no-mmproj-offload.

Choosing a quant for the language model? Our GGUF quantization guide explains the options. Keep the mmproj at F16, BF16 or Q8_0 where possible, because it is small and lower quants can hurt image understanding.

Send Images to llama-server

llama-server accepts images through its OpenAI-compatible /v1/chat/completions endpoint, so tools that speak the OpenAI API can use your local vision model.

curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What is in this picture?"},
        {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,BASE64_DATA_HERE"}}
      ]
    }]
  }'

In Python, use the official openai package with base_url="http://localhost:8080/v1" and any API key string, then send the same message structure. For all the server options, see our llama-server guide.

Use llama-mtmd-cli and llama-cli

  • llama-mtmd-cli is the testing and development tool: llama-mtmd-cli -hf ggml-org/gemma-3-4b-it-GGUF, then load an image and chat in the terminal.
  • llama-cli also supports multimodal input with the same -hf or -m/--mmproj flags.
  • Use the server for anything you want to connect to other apps; use the CLI for quick tests and scripts.

Ready-to-Use Vision, Audio and Omni Models

The ggml-org account on Hugging Face hosts pre-quantized multimodal GGUFs. Replace (tool) with llama-server or llama-mtmd-cli:

Type Models (examples) Command
Vision Gemma 4 (E2B, E4B, 26B-A4B, 31B) (tool) -hf ggml-org/gemma-4-E4B-it-GGUF
Vision Gemma 3 (4B, 12B, 27B) (tool) -hf ggml-org/gemma-3-12b-it-GGUF
Vision Qwen2.5-VL (3B, 7B, 32B, 72B) (tool) -hf ggml-org/Qwen2.5-VL-7B-Instruct-GGUF
Vision InternVL3 (1B to 14B) (tool) -hf ggml-org/InternVL3-8B-Instruct-GGUF
Vision (tiny) SmolVLM / SmolVLM2 (256M to 2.2B), Moondream2 (tool) -hf ggml-org/SmolVLM2-2.2B-Instruct-GGUF
Vision Pixtral 12B, Mistral Small 3.1 24B, Llama 4 Scout (tool) -hf ggml-org/pixtral-12b-GGUF
Video SmolVLM2 Video (256M, 500M) (tool) -hf ggml-org/SmolVLM2-500M-Video-Instruct-GGUF
Audio Voxtral Mini 3B, Qwen3-ASR (0.6B, 1.7B), Ultravox 0.5 (tool) -hf ggml-org/Qwen3-ASR-1.7B-GGUF
Audio + vision Qwen3 Omni 30B-A3B, Qwen2.5 Omni, Gemma 4 E2B/E4B (tool) -hf ggml-org/Qwen3-Omni-30B-A3B-Instruct-GGUF

Some models need a larger context window, for example -c 8192. Find more on Hugging Face by filtering for image-text-to-text models with “gguf” in the name.

OCR Models Need Special Prompts

The docs warn that OCR models are trained with a specific prompt and input structure. If PaddleOCR-VL, GLM-OCR, DeepSeek-OCR, Dots.OCR or HunyuanOCR return poor results, check the matching llama.cpp pull request discussion for the exact prompt format before blaming the model.

For general screenshots, receipts and charts, a general vision model such as Gemma 4 or Qwen2.5-VL with a clear instruction (“Extract all text as markdown”) is often good enough.

Make Your Own mmproj

For supported architectures, convert a Hugging Face checkpoint with convert_hf_to_gguf.py and the --mmproj flag to get the projector, then convert the text model as usual.

  • Supported for conversion: Gemma 3 (not the 1B, which has no vision), SmolVLM and SmolVLM2, Pixtral 12B (transformers-compatible checkpoint), Qwen2-VL and Qwen2.5-VL, Mistral Small 3.1 24B, InternVL 2.5 and 3 (non-HF versions), MiniCPM-V 4.6.
  • Older models (LLaVA, MobileVLM, GLM-Edge, older MiniCPM-V, Granite Vision) use legacy scripts in tools/mtmd/legacy-models.

Our convert a model to GGUF guide covers the text-model side of conversion.

Practical Things to Try

Once a vision model is running, these everyday jobs work well offline and keep your files private:

Task Example prompt Good model type
Describe a photo “Describe this image in three sentences.” Gemma 3 or 4, Qwen2.5-VL
Read a screenshot “What error is shown in this screenshot and how do I fix it?” Qwen2.5-VL, InternVL3
Pull text from a receipt or form Use the model’s own OCR prompt (see above) Dedicated OCR models
Explain a chart “Summarise the trend in this chart and give the highest value.” Qwen2.5-VL, Gemma 3 27B
Transcribe a voice note “Transcribe this audio.” Voxtral, Qwen3-ASR
Alt text for a website “Write short alt text for this image, under 120 characters.” SmolVLM, Gemma 4 E4B

For batches of files, script the OpenAI-compatible endpoint from the server section in a loop rather than typing into the CLI. Keep the server running so the model loads only once, and send one image per request for the most reliable answers.

VRAM and Performance Tips

  • Budget for the language model, its KV cache and the mmproj (usually a few hundred MB to about 1 GB).
  • Images use many tokens; large or many images need more context (-c).
  • Use --no-mmproj-offload if you are a little short of VRAM; image encoding gets slower but the LLM stays on GPU.
  • Tiny models (SmolVLM 256M/500M, Gemma 4 E2B) run on laptops and even CPU-only machines.
  • On AMD or Intel GPUs, use a Vulkan build; see our llama.cpp Vulkan guide.

Troubleshooting

Problem Fix
Model ignores the image or says it cannot see The mmproj was not loaded; use -hf or pass --mmproj, and check you did not add --no-mmproj
Error loading mmproj Wrong projector for this model, or llama.cpp is too old; download the matching mmproj and update
“llava-cli” or “qwen2vl-cli” not found Those tools were replaced; use llama-mtmd-cli, llama-cli or llama-server
Context exceeded with images Raise -c (for example 8192) or use smaller images
Out of memory Smaller quant, --no-mmproj-offload, lower -ngl, or a smaller model
Poor OCR output Use the model’s official prompt format (see the linked PRs)
Something broke after updating Multimodal is under heavy development; check the release notes and re-download updated GGUFs

FAQ

Does llama.cpp support vision models?

Yes. Through libmtmd it supports image, audio and video input in llama-server, llama-cli and llama-mtmd-cli.

What is an mmproj file?

The multimodal projector: a separate GGUF that turns images or audio into embeddings for the language model. Each model needs its own.

Which is the best local vision model for llama.cpp?

For most PCs, Gemma 4 E4B or Gemma 3 12B and Qwen2.5-VL 7B are strong all-rounders. Tiny SmolVLM models suit low-end hardware.

Can llama.cpp transcribe audio?

Yes, with audio models such as Qwen3-ASR, Voxtral Mini or Ultravox, or omni models like Qwen3 Omni.

Can I use the vision model from Open WebUI or other apps?

Yes. Point any OpenAI-compatible client at http://localhost:8080/v1 and send images in the standard message format.

Does it work without a GPU?

Yes, but slowly for larger models. Small models such as SmolVLM or Gemma 4 E2B are usable on CPU.

How do I turn off vision for a model loaded with -hf?

Add --no-mmproj to load it as a text-only model.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman at a photo editing desk holding a tablet with a LLAMA.CPP VISION card, hook show your AI any image