Skip to content

Provider Ollama

Muhammet Şafak edited this page Jul 4, 2026 · 3 revisions

Home / Providers / Ollama

Provider: Ollama (local)

Talks to a locally-running Ollama instance.

Note

No API key, no per-token cost — but you supply the GPU/CPU time.

Configuration

provider: ollama
providers:
  ollama:
    base_url: http://localhost:11434
    model: qwen2.5-coder:14b

Equivalent CLI / env:

commitbrief config set provider ollama
commitbrief config set providers.ollama.base_url http://localhost:11434
commitbrief config set providers.ollama.model qwen2.5-coder:14b

# Or via env (sets base_url only — model still needs config/wizard):
export OLLAMA_HOST=http://localhost:11434

Requirements

  • Ollama installed and running.
  • At least one model pulled — ollama pull qwen2.5-coder:14b etc.
  • The configured base_url reachable from the machine running commitbrief. The default http://localhost:11434 works for a local Ollama install.

Model discovery

The setup wizard queries <base_url>/api/tags to list models you have pulled, then offers them as a pick-list. If discovery fails (Ollama not running, wrong URL, network issue), the wizard falls back to a free-text input — you can type any model identifier and it is stored verbatim.

Pricing

provider.Pricing{} — all zero. The cost preflight short-circuits and the verbose footer shows instead of a dollar figure. The token counts are still reported.

Context window

Reported by the Ollama API per model. Defaults vary by model — a 14B-parameter model typically declares 32k–128k depending on configuration.

Structured findings

Ollama supports OpenAI-compatible JSON mode for many models; CommitBrief uses the standard chat-completion endpoint with a prompt-side JSON contract. Reliability depends on the model — a small instruct model may produce malformed JSON more often than the API providers, in which case the recovery ladder kicks in (ADR-0031): valid JSON wrapped in ```json fences is salvaged with no retry, a genuine parse failure triggers one repair-oriented retry, and only a second failure degrades (a warning: LLM produced malformed JSON; falling back to plain-text view. on stderr).

See also

Clone this wiki locally