Ollama adapter
Ollama uses core httpx; the server and model must already be available. This page selects qwen3; bare Ollama() retains llama3.1 as its compatibility default.
Terminal
ollama pull qwen3
ollama serveollama_agent.py
1from opentine import Agent
2from opentine.models.ollama import Ollama
3
4model = Ollama(model="qwen3", host=None, think=None)
5run = Agent(model=model).run_sync("Summarize this decision.")
Tool capability
The adapter probes /api/show and caches advertised capabilities. If a model reports no tools, Agent omits them and records a warning. If the probe fails, the adapter remains optimistic.
Thinking, usage, and cost
The optional think value is forwarded. Current Qwen, DeepSeek, and GPT-OSS thinking families are recognized by name. Token counts and timing are retained, while API billing is unmetered by default. Supply token or compute-second rates to account for infrastructure.
Remote hosts
Set host or OLLAMA_HOST. Privacy, authentication, and network boundaries then depend on that deployment.