Skip to main content

Local - Vision Models

Local multimodal vision via any vision-capable model — Qwen3-VL (recommended), Gemma 3, LLaVA, or Llama 3.2 Vision — served by Ollama or LM Studio. No cloud API, no per-image cost.

Which model, which runtime?

ModelRuntimeNotes
qwen3-vlOllamaCurrent-generation local vision; the OllamaVisionProvider default
gemma3OllamaStrong general multimodal, small footprint options
llava / llava:13bOllamaThe classic; still fine for basic description
Qwen 3.6 (27B / 35B-A3B)LM StudioVision is native in the base model, but its GGUFs don't load in Ollama yet (mmproj support pending) — run through LM Studio and use LMStudioLLMProvider vision attachments

There are two ways to do local vision in LLMRTC:

  1. Vision attachments on the LLM (recommended) — use OllamaLLMProvider or LMStudioLLMProvider with a vision-capable model; camera/screen frames captured by the web client flow into the conversation automatically. The Ollama provider probes the model's capabilities and raises a clear error if the selected model can't see images.
  2. A dedicated VisionProviderOllamaVisionProvider answers standalone describe-this-image requests outside the conversation flow.
tip

OllamaVisionProvider defaults to qwen3-vl. The older LlavaVisionProvider name still works (it defaults to llava), but new code should use OllamaVisionProvider.

Official Documentation


Local Setup (via Ollama)

Vision models run locally through Ollama, which handles model downloading and serving.

1. Install Ollama

See Local - Ollama for installation instructions, or:

# macOS
brew install ollama

# Linux
curl -fsSL https://ollama.com/install.sh | sh

2. Start Ollama Server

ollama serve

3. Pull a Vision Model

# Recommended: current-generation Qwen3-VL (the provider default)
ollama pull qwen3-vl

# Alternatives
ollama pull gemma3
ollama pull llava
ollama pull llama3.2-vision

4. Verify

# Test with an image
ollama run qwen3-vl "Describe this image: /path/to/image.jpg"

# Check API
curl http://localhost:11434/api/tags

Provider Configuration

Default Local Setup

import { OllamaVisionProvider } from '@llmrtc/llmrtc-provider-local';

// Defaults: qwen3-vl on http://localhost:11434
const vision = new OllamaVisionProvider();

Pinning a Specific Model

const vision = new OllamaVisionProvider({
model: 'gemma3'
});

Custom Server URL

const vision = new OllamaVisionProvider({
baseUrl: 'http://my-vision-host:11434',
model: 'qwen3-vl'
});

Configuration Options

interface OllamaVisionConfig {
baseUrl?: string; // Defaults to http://localhost:11434
model?: string; // Defaults to 'qwen3-vl'
}

Environment Variables (CLI mode)

VariableDefaultDescription
OLLAMA_BASE_URLhttp://localhost:11434Ollama server URL (shared with the LLM provider)
OLLAMA_VISION_MODELllavaVision model used by the CLI backend. The CLI default stays llava so existing LOCAL_ONLY deployments keep working — set it to qwen3-vl to use the current generation

Available Vision Models

ModelSizeFeaturesUse Case
qwen3-vl4B-235B variantsCurrent generation, strong OCR and document/chart understandingRecommended default
gemma34B / 12B / 27BStrong general multimodal, small footprint optionsResource-constrained setups
llama3.2-vision11B / 90BMeta's vision modelOCR, object detection
llava7B / 13B / 34BThe classic; lightest to runBasic description
llava-llama38BLLaVA on a Llama 3 baseImproved language

Usage Examples

JavaScript/TypeScript

import Ollama from 'ollama';

const response = await Ollama.chat({
model: 'qwen3-vl',
messages: [{
role: 'user',
content: 'What do you see in this image?',
images: ['./photo.jpg'] // or base64 encoded
}]
});

console.log(response.message.content);

REST API

curl http://localhost:11434/api/generate -d '{
"model": "qwen3-vl",
"prompt": "Describe what you see",
"images": ["<base64-encoded-image>"]
}'

Notes

  • Requires Ollama with a vision-capable model
  • Keep frame rate low when sending video frames to avoid CPU/GPU spikes
  • First request may be slow while model loads into memory
  • 8GB+ RAM recommended; 16GB+ for larger models
  • GPU acceleration significantly improves performance
  • Images are automatically resized by Ollama before processing