New Tool Radar

Local AI

How to Describe an Image With llama.cpp Multimodal CLI

Run a vision model with llama.cpp multimodal CLI and check the description matches the image.

Schematic with three steps: Build the multimodal tool; Prepare the model and the projector; Run the tool on an image and.

llama.cpp ships a multimodal command-line tool alongside its text tools, so a vision model can describe an image without a chat app. You need a vision GGUF model and its image projector file, and then the tool reads the image and generates a description.

What you need

  • llama.cpp built with the llama-mtmd-cli target
  • A vision GGUF model and its matching projector file
  • An image file to describe

Step 1: Build the multimodal tool

Build llama.cpp with the llama-mtmd-cli target included. The binary list after a build includes llama-cli, llama-server, llama-mtmd-cli, and llama-bench.

Step 2: Prepare the model and the projector

Place the vision GGUF model and its matching projector file where the tool can read them. The projector must match the vision model, or the image will not be read correctly.

Step 3: Run the tool on an image and check the description

Run llama-mtmd-cli with the model file and the image path, and read the description it generates. Check the description against the image: the objects, the setting, and any text in the image should match.

Worked example: synthetic image description

The table below is a synthetic example. It shows the expected result of describing an image; no image was described.

Check In the image In the description?
Main object A red bicycle Yes
Setting A park path Yes
Text in image No text Correctly none
Colour Red Yes

Expected result (UNTESTED). the description names the red bicycle and the park path, and correctly reports no text in the image. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • The projector file must match the vision model; a mismatched pair gives a wrong or empty description.
  • Run llama-mtmd-cli –help on your build for the exact image flag, because flags differ between builds.
  • A vision description is a guess, not a measurement; check it against the image before relying on it.

Sources

See all