Run a Vision Model Locally with Ollama: Qwen3-VL Guide

Your local LLM can finally see

A text-only local model is useful, but much of real work lives in images: a screenshot of an error, a photographed receipt, a chart in a report, a whiteboard after a meeting. Sending those to a cloud API means uploading potentially private material and paying per request. A vision-language model on your own machine removes both problems.

This guide uses Qwen3-VL through Ollama, the simplest route to a capable local vision model. Qwen3-VL is Alibaba's open vision-language family, and Ollama ships it in sizes from 2B to 235B, according to the Ollama model library. The 8B version is the sweet spot for most people: third-party model guides put it at roughly an 8GB GPU, while the 2B and 4B versions suit laptops and CPU-only machines. Ollama's announcement credits the family with 256K native context and OCR support for 32 languages, which helps with long documents and dense screenshots. In about 20 minutes you will go from install to your first image question, then to a batch script.



Source: Ollama — Qwen3-VL, a vision-language model family that runs locally.

Prerequisites

  • Ollama installed and running. If you have not installed it yet, our guide to running an open model locally with Ollama covers the install and the first pull.
  • About 10GB of free disk space for the 8B model and a test image or two: a photo, a screenshot, and a receipt or chart if you have them.
  • Python 3.10 or newer, only for the automation step at the end. The first three steps need nothing but the terminal.

Step 1: Pull the right size

Start with the 8B model unless your machine is very small. The 4B version is the fallback for a laptop with no dedicated GPU, and the 32B version is for a strong GPU with plenty of memory. Do not pull the 235b-cloud tag for a local run: it routes to Ollama's cloud, which defeats the point of keeping images on your machine.

ollama pull qwen3-vl:8b
ollama list

The second command confirms the model is on disk before you start asking questions. If your hardware struggles, check our guide to how much VRAM you need to run an LLM locally before jumping to a bigger size: a model that constantly swaps to system RAM feels far slower than a smaller one that fits comfortably.

Step 2: Ask your first image question

Ollama's vision syntax has one easy-to-miss detail. The current Ollama vision documentation puts the image path before the prompt: model, then image file, then what you want to know. Get that order right and everything else is plain language.

ollama run qwen3-vl:8b ./photo.jpg What is in this image? Describe it in detail.

For an interactive session instead, start the model with no arguments and type your prompt followed by the image path. Dragging the image into the terminal fills in the path for you, which avoids typos in long filenames:

ollama run qwen3-vl:8b
>>> What is in this image? ./photo.jpg

Either way, the first answer takes a while: the model loads into memory on first use. Later questions in the same session are much faster, so batch your questions rather than restarting the model for each image.

Step 3: Use prompts that match the job

Vision models answer the question you actually asked, not the one you meant, so specificity pays off. Two prompt patterns cover most everyday work.

Transcribe, don't summarize, for documents. Asking a model to "read this receipt" often returns a vague summary. Asking for structure forces it to look at every field:

ollama run qwen3-vl:8b ./receipt.jpg Transcribe all visible text into a table with columns for item, quantity, and price. Do not guess values you cannot read.

That last sentence matters. Vision models will happily invent a plausible total rather than admit a corner is blurry, so telling it not to guess turns a silent error into a visible gap you can check.

Ask for the numbers, not the story, for charts. A chart question like "what does this show?" invites a paragraph of fluff. Instead, ask for the data:

ollama run qwen3-vl:8b ./chart.png List the values for each bar in this chart, then state which category is highest and by how much.

Expect good results on clean screenshots, printed text, and simple charts, and weaker ones on handwriting and tiny text in wide photos. For those, crop to the region that matters first: a close crop beats a bigger model.

Source: Ollama — asking Qwen3-VL about an image from the command line.


Step 4: Automate it with the API

The CLI is fine for one image, but the real payoff is a folder. Ollama's Python library accepts image file paths directly, while the raw REST API expects base64-encoded image data, according to the same vision documentation:

pip install ollama
from ollama import chat
from pathlib import Path
import json

results = {}
for image_path in sorted(Path("receipts").glob("*.jpg")):
    response = chat(
        model="qwen3-vl:8b",
        messages=[{
            "role": "user",
            "content": "Transcribe all visible text into a table. Do not guess values you cannot read.",
            "images": [str(image_path)],
        }],
    )
    results[image_path.name] = response.message.content

Path("receipts.json").write_text(json.dumps(results, indent=2))
print(f"Processed {len(results)} images. Results saved to receipts.json")

That script is a template: swap the prompt and the folder and it becomes a screenshot triage tool, a chart reader, or a photo tagger. To make the extracted text searchable later, feed it into a retrieval setup: our guide to building a local RAG system with Ollama and Qdrant shows how to index text so you can ask questions across a whole archive of processed images.

Prefer the REST API, for example from a language without an Ollama SDK? Encode each image as base64 and send it in the images array of a /api/chat request to http://localhost:11434. The encoding step is the only difference from the library call.

Troubleshooting

  • The model describes the wrong image or nothing at all: check the argument order. The image path comes before the prompt in a one-shot command, and a missing file silently changes what the model sees.
  • First answer is very slow: that is model loading, not failure. Wait for it to finish, then ask follow-ups in the same session.
  • Out-of-memory errors: drop to qwen3-vl:4b, close GPU-hungry apps, or run one image at a time instead of several large ones at once.
  • Hallucinated text in OCR: crop to the text region, add "do not guess values you cannot read" to the prompt, and verify totals by hand. OCR output is a draft, not a ledger.

The bottom line

Running a vision model locally is no longer a research project: one pull, one command with the image path before the prompt, and your screenshots and documents become answerable. Start with the 8B model, learn which prompts give structured answers instead of summaries, and only then automate the folder. Your images stay on your machine, and the same skill transfers to any other vision model Ollama ships next.

Comments

Popular posts from this blog

Open-Source AI Weekly: Bonsai, GigaChat 4 Lead

Claude Claims Proof of Riemann Hypothesis After 167 Years

How to Build an AI Agent with LangGraph in 30 Minutes