Skip to content

fix: zero out cost for local providers (ollama, local)#9222

Merged
DOsinga merged 1 commit into
mainfrom
fix/8192-ollama-zero-cost-v2
May 15, 2026
Merged

fix: zero out cost for local providers (ollama, local)#9222
DOsinga merged 1 commit into
mainfrom
fix/8192-ollama-zero-cost-v2

Conversation

@DOsinga
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga commented May 14, 2026

When the provider is a local inference engine (ollama, local), maybe_get_canonical_model now zeros out the pricing on the resolved canonical model. The model-name inference logic correctly resolves local models to their canonical architecture (e.g. ollama/mistral-nemomistralai/mistral-nemo) for context limits and capabilities, but the cloud pricing from that entry does not apply when running locally.

This fixes the bug where the CLI cost line showed non-zero dollar amounts for Ollama sessions.

The fix is in maybe_get_canonical_model — the single public API that bridges requesting provider → canonical model. All consumers (CLI, server, future code) get correct zero cost without duplication.

Fixes #8192

When the provider is a local inference engine (ollama, local),
maybe_get_canonical_model now zeros out the pricing on the resolved
canonical model. The model-name inference logic in map_to_canonical_model
correctly resolves local models to their canonical architecture (e.g.
ollama/mistral-nemo → mistralai/mistral-nemo) for context limits and
capabilities, but the cloud pricing from that entry does not apply when
running locally.

Fixes #8192

Signed-off-by: Douwe Osinga <douwe@squareup.com>
@DOsinga DOsinga force-pushed the fix/8192-ollama-zero-cost-v2 branch from b89609e to ea0775f Compare May 14, 2026 19:49
@DOsinga DOsinga added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit b9ecd0a May 15, 2026
21 of 23 checks passed
@DOsinga DOsinga deleted the fix/8192-ollama-zero-cost-v2 branch May 15, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show $0.00 (or hide) cost line for local Ollama provider sessions

2 participants