New Tool Radar

AI Image & Voice

How to Ask an Ollama Vision Model About an Image via the API

Send a base64-encoded image to a multimodal Ollama model through /api/generate and read what it sees in the picture.

Schematic diagram with four steps: pull a vision model such as llava, base64-encode the image, send it in the images field with a question, then read the model's description.

Some Ollama models can see: give them an image and a question, and they answer about the picture. The API takes the image as a base64-encoded string in the images field of a /api/generate request, alongside the prompt.

Encode the image and send it with the prompt

Pull a multimodal model first — the API docs use llava as the example. Read the image file, base64-encode it, and send it in the images list with your question as the prompt: {"model": "llava", "prompt": "What is in this picture?", "images": ["<base64>"], "stream": false}. The reply’s response field holds the model’s description of the picture.

IMAGE=$(base64 -w0 photo.jpg)
curl http://localhost:11434/api/generate -d "{
  \"model\": \"llava\",
  \"prompt\": \"What is in this picture?\",
  \"stream\": false,
  \"images\": [\"$IMAGE\"]
}"

Large images make large requests: the base64 string is about a third bigger than the file, so shrink the image before encoding if the request is slow or fails. A text-only model given an images field will not suddenly see — the model itself must be multimodal, so check the model’s capabilities first.

Try it: four checks

Check What you should see If you do not see it
Vision model pulled ollama list shows llava or another vision model Pull a multimodal model first
Image encoded The base64 string is non-empty Check the file path and the base64 command
Reply describes it The response mentions what is in the picture Ask a concrete question about the image
No text-only model The model used is a vision model A text model cannot use the images field

Expected result. We checked the Ollama API reference, which says the images parameter takes a list of base64-encoded images for multimodal models such as llava. We did not call the API on this machine.

Limits

This guide covers the API image call only. Image size limits and which models are multimodal are separate checks. We did not test any vision call ourselves.

Sources

See all
AI Image & Voice

How to Remove a Background in Canva

Remove a photo background in Canva with Background Remover, then fix the edges with the Erase and Restore brushes.