Skip to main content

Ollama (Local Models)

Use Ollama to run open-source models locally with Agentium. No API key required—ideal for development, privacy-sensitive workloads, and cost-free experimentation.

Setup

1

Install Ollama

Download and install Ollama from ollama.ai. Start the Ollama service (it runs on http://localhost:11434 by default).
2

Pull a model

Pull the model you want to use:
3

Use in Agentium

Use the ollama factory with the model name:

Factory

string
required
The Ollama model name (e.g., llama3.1, codellama, mistral).
object
Optional configuration. See Config below.

Config

string
default:"http://localhost:11434"
Ollama server URL. Defaults to http://localhost:11434. Use this for remote Ollama instances or custom ports.
Ollama runs locally and does not require an API key. Just ensure the Ollama service is running.

Example


Run ollama list to see installed models. Browse ollama.com/library for the full catalog.

Multi-Modal Support

Ollama supports image input for vision-capable models like llava, bakllava, and llama3.2-vision.

Images

Pass images as base64 data in ContentPart[]:

Unsupported: Audio & Files

Audio and file inputs are not supported by Ollama. If passed, the provider logs a warning and skips them.

Tool Calling

Ollama supports function calling with select models. Enable tools on your agent as usual — Agentium handles the tool call protocol automatically:

Models with Tool Support

Tool calling quality varies by model. Larger models (70B+) are more reliable for complex tool use. For production tool-calling workflows, consider llama3.1:70b or a cloud provider.

Performance Tips

GPU Acceleration

Ollama automatically uses GPU when available. Check GPU usage with:
For best performance, ensure your model fits entirely in GPU memory. A 7B model typically needs ~4GB VRAM, 13B needs ~8GB, and 70B needs ~40GB.

Context Size

By default, Ollama uses a 2048-token context window. For agents with long conversations or large tool results, increase it:

Model Selection Guidelines


Full Example