Ollama Chat Provider¶
Ollama local LLM chat provider for the conversational interface.
Ollama chat provider using the OpenAI-compatible /v1 endpoint.
Ollama exposes an OpenAI-compatible API, so this provider uses the openai
Python SDK. The main complexity is format conversion: the rest of the
codebase uses Anthropic-style tool definitions and message structures, so
this module translates between the two formats on every request and response.
Useful for local or self-hosted LLM inference where Anthropic API access is unavailable or cost-prohibitive.
Classes¶
OllamaChatProvider ¶
OllamaChatProvider(model: str = 'qwen2.5:32b-instruct-q3_K_M', base_url: str = 'http://localhost:11434/v1', keep_alive: str = '1h')
Bases: ChatProvider
Chat provider using Ollama's OpenAI-compatible endpoint.
Source code in src/chat_providers/ollama.py
Functions¶
is_model_loaded
async
¶
Check if the configured model is currently loaded in Ollama.
Hits /api/ps to list running models. Returns False if the
model is not in the list (cold start expected). Fail-open: returns
True on any error so callers never block on a failed probe.