mtmd library. A vision or audio GGUF comes in two parts: the language model (LFM2.5-VL-1.6B-Q4_0.gguf) and a projector / encoder file (mmproj-*.gguf). llama-server, llama-cli, and llama-mtmd-cli all load both; the same mtmd code is available in the iOS XCFramework and Android builds.
Vision (LFM2.5-VL)
Start the server
--image-max-tokens caps the number of image tokens per picture (lower = faster, coarser); --no-mmproj-offload keeps the vision encoder on CPU when GPU memory is tight.
Send an image
Images travel as standard OpenAIimage_url content parts β a data: URI with base64 bytes or a public URL.
image_url part before the text that refers to it. Multi-turn works as for text β send the full history, and the image tokens stay in the prompt cache.
Vision models use temperature 0.1, min_p 0.15, repeat_penalty 1.05. See Vision Capabilities for prompting guidance and LFM2.5-VL-1.6B / LFM2.5-VL-3B for model details.
Command line
In-process (mobile and embedded)
Themtmd C API sits next to llama.h: load the projector with mtmd_init_from_file(), tokenize a prompt that contains image markers plus the image bitmaps with mtmd_tokenize(), evaluate the chunks with mtmd_helper_eval_chunks(), then sample text with the usual llama_sampler_sample() loop. tools/mtmd/README-dev.md documents the API and tools/mtmd/mtmd-cli.cpp is a compact reference. On Android build with -DLLAMA_BUILD_MTMD=ON; the iOS XCFramework already includes it.
Downscale images before passing them to the model β LFM2.5-VL handles native resolution, but a 12-megapixel camera frame costs far more image tokens than a 1024-pixel resize with no accuracy benefit for most tasks.
Audio (LFM2.5-Audio)
LFM2.5-Audio adds a custom audio detokenizer for speech output, so it runs on llama.cpp through Liquidβs dedicated audio runners rather than the genericmtmd path. The GGUF repository ships four files per quantization: the language model, the mmproj-* audio encoder, the vocoder-* decoder, and the tokenizer-* speaker file.
Audio input is 16 kHz mono WAV. Resample and downmix on the client (
AVAudioConverter on iOS, AudioRecord at 16 kHz on Android, ffmpeg -ar 16000 -ac 1 on desktop) before sending it to the model.