Overview
The Ollama provider connects to locally-running Ollama instances to use open-source models like Qwen, Llama, and others. It supports the full OpenAI-compatible API with tool calling. Source:crates/goose/src/providers/ollama.rs
Configuration
Environment Variables
string
default:"localhost"
Ollama server host (automatically adds port 11434 for localhost)
number
default:"600"
Request timeout in seconds
number
Override context window size (sets
num_ctx option)Setup
Supported Models
Recommended Models
qwen3(default) - Qwen 3 base modelqwen3-vl- Qwen 3 with vision capabilitiesqwen3-coder:30b- 30B parameter coding modelqwen3-coder:480b-cloud- Large cloud-based coding model
Other Popular Models
llama3.3- Meta’s Llama 3.3codellama- Code-specialized Llamamistral- Mistral modelsgemma- Google’s Gemmaphi- Microsoft’s Phi models
Usage
Basic Usage
Custom Configuration
Setting Context Window
Ollama allows configuring the context window size:num_ctx parameter in Ollama options.
Advanced Features
Tool Calling
Ollama supports native tool calling for compatible models:XML Tool Call Fallback
For models without native tool support, Ollama automatically falls back to XML-based tool calls:Chat Mode
Disable tools in chat-only mode:Vision Models
Use vision-capable models for image understanding:Remote Ollama
Connect to Ollama running on another machine:Port Handling
localhostdefaults to port11434- Remote hosts without explicit port: no default port
- Explicit ports in URL are respected:
http://host:8080
Implementation Details
Provider Metadata
API Format
Uses OpenAI-compatible chat completions format:POST /v1/chat/completions