Ollama vision models: send images via CLI, API base64 or Python, which models support vision, the best picks for OCR and screenshots, and the limits to expect.
Ollama vision models take images alongside text: pass a file path to ollama run, a base64 string in the images array of /api/chat, or a path or bytes in the Python and JavaScript clients. For OCR of documents, the dedicated glm-ocr (0.9B) and deepseek-ocr (3B) models lead; for screenshots and diagrams, a general model such as qwen3-vl:8b or gemma4 reasons better. Raise num_ctx, because images consume context tokens.
- images: [base64, ...]
- glm-ocr, 0.9B, 2.7 GB
- qwen3-vl:8b, 6.2 GB
- num_ctx 8192 or more
Key takeaways
- CLI: ollama run <model> ./image.png your question. REST: base64 strings in a message's images array. The OpenAI-compatible /v1 route takes base64 data URIs only, not image URLs.
- Vision models carry a vision tag on ollama.com. The filter also lists cloud models, so check the Input column says Text, Image for the local tag you pull.
- For pure text extraction from documents, glm-ocr (2.7 GB, 94.62 on OmniDocBench v1.5 per its card) and deepseek-ocr are the specialists. For screenshots of UIs and diagrams, use a general model such as qwen3-vl:8b or gemma4.
- Images cost context. glm-ocr crashed at the default 4,096 num_ctx in one GitHub report; 8,192 or more fixed it.
- Several vision bugs are version-specific: Gemma 4 downscaled screenshots until 0.34.1, and glm-ocr table output regressed in 0.35.1. Pin a version you have tested.
How do you send an image to an Ollama model?
You send an image to an Ollama vision model by adding it to a user message: a file path on the CLI, a base64 string in the images array on the REST API, or a path, bytes or base64 in the official Python and JavaScript clients. The model has to support vision; a text-only model will ignore or reject the image.
CLI. Put the image path in the prompt. The Ollama vision docs use Gemma 4:
ollama run gemma4 ./image.png what is in this image?Some models expect a fixed prompt format. glm-ocr’s model page uses task prefixes, and deepseek-ocr’s warns that “a missing punctuation or new line may cause an improper output”:
ollama run glm-ocr Text Recognition: ./invoice.png
ollama run glm-ocr Table Recognition: ./report.png
ollama run deepseek-ocr "/path/to/page.png\n<|grounding|>Convert the document to markdown."REST API. /api/chat takes an images array on the message, and the REST API only accepts base64:
IMG=$(base64 < screenshot.png | tr -d '\n')
curl http://localhost:11434/api/chat -d '{
"model": "qwen3-vl:8b",
"stream": false,
"options": {"num_ctx": 8192, "temperature": 0},
"messages": [{"role": "user", "content": "Transcribe all text in this screenshot.", "images": ["'"$IMG"'"]}]
}'Python. The ollama package accepts a file path, raw bytes or base64 in images, so you skip the encoding step:
from ollama import chat
response = chat(
model="qwen3-vl:8b",
messages=[{"role": "user", "content": "Extract the error message from this screenshot.", "images": ["./error.png"]}],
options={"num_ctx": 8192, "temperature": 0},
)
print(response.message.content)The JavaScript client works the same way: ollama.chat({ model, messages: [{ role: 'user', content, images: [imagePath] }] }).
OpenAI-compatible API. /v1/chat/completions supports vision, but per the OpenAI compatibility page it accepts base64 only; image URLs are not supported. Send a data URI in an image_url content part:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
client.chat.completions.create(
model="qwen3-vl:8b",
messages=[{"role": "user", "content": [
{"type": "text", "text": "What's in this image?"},
{"type": "image_url", "image_url": "data:image/png;base64,<BASE64_DATA>"},
]}],
)If your tool only speaks OpenAI’s format, the Ollama OpenAI-compatible API guide covers the rest of the /v1 surface and its gaps. To get the extracted text back as typed fields rather than prose, combine the image with a JSON schema, as in Ollama structured output.
Which Ollama models support vision?
Every model with the vision tag on ollama.com/search?c=vision accepts images, and each tag on a model page lists its inputs as “Text, Image”. The filter mixes local and cloud-only models, so check the tag you pull is a local one with a size, not a -cloud entry.
The vision-capable local models developers reach for most, with figures from their Ollama library pages (checked 2026-11-03):
| Model | Sizes on Ollama | Default tag download | Context | Built for |
|---|---|---|---|---|
glm-ocr | 0.9B | 2.7 GB (q8_0: 1.8 GB) | 128K | Document OCR: text, tables, formulas |
deepseek-ocr | 3B | 6.7 GB | 8K | Token-efficient document OCR; needs Ollama 0.13.0+ |
granite3.2-vision | 2B | 2.4 GB | 16K | Tables, charts, diagrams in documents |
qwen3-vl | 2B, 4B, 8B, 30B, 32B (235B cloud) | 6.2 GB (8B) | 256K | General vision, screenshots, GUI elements, 32 OCR languages |
gemma4 | e2b, e4b, 12b, 26b, 31b | 6.6 to 9.5 GB | 128K | General multimodal, also audio on small sizes |
qwen3.8 | 27B | 18 GB | 256K | General model with image input |
llama3.2-vision | 11B, 90B | 7.8 GB (11B) | 128K | General vision; last updated a year ago |
minicpm-v | 8B | 5.5 GB | 32K | General vision (MiniCPM-V 2.6) |
llava | 7B, 13B, 34B | 4.7 GB (7B) | 32K | Older baseline; last updated two years ago |
Download counts tell you what people actually run: glm-ocr shows 8.9M downloads and qwen3-vl 7M on their library pages, against 646.8K for deepseek-ocr. For the Gemma 4 sizes and their memory needs, see Gemma 4 local.
Which are best for OCR and reading screenshots or diagrams?
For clean text extraction from documents, use a dedicated OCR model; for screenshots, UIs and diagrams where the model has to understand what it reads, use a general vision-language model. The two jobs reward different architectures.
| Job | First pick | Why | Alternative |
|---|---|---|---|
| Scanned pages, PDFs rendered to images, receipts | glm-ocr | 94.62 on OmniDocBench v1.5, ranked first per its model card; 0.9B, MIT licence, 2.7 GB | deepseek-ocr |
| Tables to HTML or Markdown | glm-ocr with Table Recognition: | Built-in task prompt | granite3.2-vision |
| Long documents on little memory | deepseek-ocr | Authors report about 97% OCR precision at under 10x text-to-vision-token compression, and beating GOT-OCR2.0 with 100 vision tokens per page (paper) | glm-ocr |
| Screenshots of apps, terminals and error dialogs | qwen3-vl:8b | Trained to recognise GUI elements; text-in-image plus reasoning about it | gemma4 (0.34.1 or later) |
| Architecture diagrams, charts | qwen3-vl:8b or larger | Needs reasoning, not only transcription | gemma4:26b, qwen3.8 |
| Handwriting | The largest general model you can fit | Community reports agree small models struggle | Cloud fallback |
A caveat on the numbers. OmniDocBench and the DeepSeek-OCR figures are each vendor’s own published results, not an independent head-to-head, and Qwen publishes Qwen3-VL’s OCR scores only as a chart image on its model card, so there is no single table that ranks all of these on the same test. Treat the table as a shortlist and run 20 of your own images through two candidates before you commit.
We build CandorNo GPU? Use a hosted model
Uncensored AI, right in your browser.
Candor runs open models with refusals removed, so it answers the questions other assistants deflect. New accounts get free credits, no card needed.
Try Candor freeHow much extra memory does vision need?
Vision adds memory in two places: the vision encoder’s weights, which are already inside the download sizes above, and the image tokens, which sit in the context window and its KV cache like any other tokens. The second one is what catches people out.
How many tokens an image costs depends on the model. Qwen2.5-VL’s model card sizes images in multiples of 28 pixels with one visual token per 28 by 28 patch and a default range of 4 to 16,384 tokens per image, so a 1920 by 1080 screenshot lands in the low thousands of tokens. A commenter in an r/LocalLLaMA thread on screenshot assistants put a 1080p screenshot at 1,500 to 2,500 tokens and advised cropping to 256 to 512 pixels when latency matters (thread).
That is why the context setting matters more than the model size. In ollama/ollama #16696, glm-ocr crashed the runner on table-recognition requests with Ollama’s default 4,096-token context on an 8 GB RTX 4060; the reporter traced it to vision tokens plus prompt plus output overrunning num_ctx, and setting it to 8,192 or more (they use 16,384) stopped the crashes. Set num_ctx explicitly for any vision workload, and budget for the larger KV cache with the local LLM hardware requirements numbers.
As a rough fit guide from the download sizes: glm-ocr and granite3.2-vision, at under 3 GB, fit on entry-level GPUs, qwen3-vl:8b and gemma4’s default tag want an 8 to 12 GB card once context is added, and qwen3.8 at 18 GB needs a 24 GB card or a Mac with 32 GB or more.
What are the limits? (resolution, multiple images)
The limits are resolution handling, multiple-image requests and prompt-format sensitivity, and most of them are version-specific bugs rather than documented caps. The vision docs don’t state a maximum resolution, image count or format list, so these come from the issue tracker:
- Resolution can be silently reduced. Gemma 4 told one user there was no text in a clear 1920 by 1080 screenshot because Ollama hardcoded a 280-token image budget, shrinking the image to about 31% of its area (#17152). A maintainer marked it fixed in 0.34.1, which now chooses the budget from the image’s resolution and aspect ratio.
- Very large images can crash. On Apple Silicon, the MLX runner tried to allocate about 125 GB for a 24.5-megapixel photo with Qwen3.8 27B; a second reporter found 3584 by 3584 worked and 3840 by 3840 failed (#17804). Resizing to 1568 pixels on the long edge was the reported workaround. A fix was announced for 0.32.15, though one commenter said it was not in that build.
- Very small images can crash too. qwen2.5vl panicked on images under 28 pixels on a side (#11297, since closed).
- Two same-size images may become one. With qwen3.5 and qwen3.8, two images with identical pixel dimensions in one request were merged and the model saw only one, with no error (#17814, open; related #17321). Gemma 4 was not affected. Making the images differ by one pixel avoided it.
- Prompt templates can break OCR models. In #18810, glm-ocr’s table output fell from 197 of 197 correct on 0.34.0 to 113 of 197 on 0.35.1; a collaborator tied it to thinking tokens injected by a template change and a missing end-of-generation signal that lets output loop. Other glm-ocr loop reports are open as #16892 and #17113.
The practical rules: downscale to around 1,500 pixels on the long edge before sending, send one image per request when the images matter individually, set temperature to 0 for transcription, and pin the Ollama version your OCR pipeline was validated on.
What do developers report in practice?
Practitioners split the same way the benchmarks do: specialist OCR models for documents, general VLMs for anything that needs interpretation, and testing on your own inputs either way.
- In an r/LocalLLaMA thread from a developer with a 16 GB GPU looking for OCR of screenshots, PDFs and receipts under about 10 GB, replies named glm-ocr as small and fast but weaker on large images when run bare, with the best results through its vendor SDK; others backed DeepSeek OCR and PaddleOCR, and one noted that handwriting is where bigger vision models start to win (thread).
- A Hacker News user recommended
qwen3-vl:8bat 4-bit on Ollama as a balance of accuracy and memory, but found it slower than older architectures such as LLaVA and verbose in a way token limits can’t tame, since output just cuts off (comment). - Another HN user found
qwen2.5vl:7bbetter than qwen3-vl for ingesting varied data into a consistent format, and said the quantized Ollama build runs on normal consumer hardware (comment). - On 4 GB of VRAM, one developer trying to OCR scanned PDFs reported that many models wouldn’t load and those that ran through Ollama, such as llava-llama3 and phi3.5 vision, did poorly (comment). That was early 2025, before glm-ocr existed, but the lesson on small general VLMs holds.
- A home-automation user sends driveway camera frames from Frigate to MiniCPM-V 2.6 on Ollama and gets usable vehicle and licence-plate descriptions (comment).
FAQ
How do I know if an Ollama model supports images?
Check its page on ollama.com: vision models carry the vision tag, and each tag lists its input as “Text, Image”. The library’s vision filter at ollama.com/search?c=vision lists them all, cloud models included.
Can I send an image URL to Ollama?
Not to the server directly. The REST API and the /v1 OpenAI-compatible route take base64 only. The Python and JavaScript clients accept a file path or raw bytes and encode it for you.
What is the best Ollama vision model for OCR?
For printed documents and tables, glm-ocr: 0.9B parameters, a 2.7 GB download and the top OmniDocBench v1.5 score on its card. For screenshots that need interpretation, qwen3-vl:8b. Validate either on your own images.
Can I send multiple images in one Ollama request?
Yes, images is an array. Known bugs merge two same-size images for some Qwen models, so for independent images send separate requests or check prompt_eval_count grows with each image.
Why does my Ollama vision model say there is no text in the image?
Usually the image was downscaled too far or the context was too small. Update Ollama (Gemma 4’s fixed 280-token image budget was fixed in 0.34.1), raise num_ctx to 8,192 or more, and crop to the region you need.
We build CandorSkip the setup
Want an uncensored model without hosting one?
Candor (candorai.dev) is an uncensored AI chat app that runs in your browser: it answers the questions mainstream assistants dodge, on health, money, law and work, without the lecture. New accounts get free credits, no card needed.
Facts from candorai.dev, checked Nov 10, 2026. Candor never changes how we rank or review models. Disclosure.
Sources (10)
- Ollama docs: Vision
- Ollama docs: OpenAI compatibility (vision, base64 only)
- Ollama library: vision models filter
- Ollama library: glm-ocr
- Hugging Face: zai-org/GLM-OCR model card
- Ollama library: deepseek-ocr, and the DeepSeek-OCR paper (arXiv 2510.18234)
- Ollama library: qwen3-vl
- Hugging Face: Qwen2.5-VL-7B-Instruct (pixels per visual token)
- ollama/ollama #17152: Gemma 4 image token budget broke OCR on high-resolution images
- ollama/ollama #16696: glm-ocr crashes when num_ctx is too small for vision tokens
Written by Refusal Rate editors from papers, model cards, official docs and pricing pages. Anything we ran ourselves is labeled as our own test, with the hardware and settings. Our method.