Repository navigation
Provider OpenAI compatible
Home / Providers / OpenAI-compatible (DeepSeek, Mistral, Cohere, custom)
These three providers talk to OpenAI-compatible Chat Completions
endpoints, so CommitBrief drives them through the same openai-go SDK it
uses for OpenAI — just pointed at a different base URL. No extra
dependency is pulled in for them.
| Provider | Default base URL | API key env | Default model | Other models |
|---|---|---|---|---|
deepseek |
https://api.deepseek.com |
DEEPSEEK_API_KEY |
deepseek-chat |
deepseek-reasoner |
mistral |
https://api.mistral.ai/v1 |
MISTRAL_API_KEY |
mistral-large-latest |
mistral-small-latest, codestral-latest
|
cohere |
https://api.cohere.ai/compatibility/v1 |
COHERE_API_KEY |
command-r-plus |
command-r, command-a-03-2025
|
commitbrief setup # pick DeepSeek / Mistral / Cohere + enter the key
# or set the key in config / via the env var, then:
commitbrief providers use deepseek
commitbrief --provider mistral --stagedThe API key can come from config (providers.<name>.api_key) or the
matching environment variable above.
Unlike the OpenAI provider, these do not send a response_format
JSON-schema directive — their strict-JSON support varies by provider and
model. The findings JSON shape comes from the system prompt's contract,
and the salvage → repair-retry → degrade pipeline handles output that doesn't parse — fenced JSON is salvaged
with no retry, a real parse failure gets one repair-oriented retry, and
only then does it fall back to rendering the raw text — exactly the way
Ollama works. In practice capable models follow the prompt; smaller ones
may degrade to plain-text output.
Per-1M-token rates are hard-coded snapshots (internal/provider/<name>/pricing.go)
and shown in the --verbose footer. Refresh them when a provider changes
prices. No automatic prompt-cache discount is assumed for Mistral/Cohere;
DeepSeek's cache-hit rate is listed but may not be reported through the
compatibility usage payload.
deepseek, mistral and cohere no longer send OPENAI_ORG_ID and
OPENAI_PROJECT_ID as OpenAI-Organization / OpenAI-Project headers.
Requires v1.19.0 or later. For any other endpoint that speaks Chat Completions (vLLM, LM Studio, LiteLLM, a corporate gateway).
provider: openai-compatible
providers:
openai-compatible:
base_url: http://localhost:8000/v1 # required
model: qwen2.5-coder-32b-instruct # required
api_key_env: LOCAL_LLM_KEY # optional
context_window: 32768 # optional, enables the token preflight
pricing:
qwen2.5-coder-32b-instruct: { input_per_1m: 0.40, output_per_1m: 1.20 }- Key lookup:
api_key_env, thenapi_key, then noAuthorizationheader. - No
response_formatis sent. -
OpenAI-OrganizationandOpenAI-Projectheaders are never sent. - No price declared: cost shows as unknown, one stderr note is printed and the
cost confirmation is skipped. A price of
0.0counts as not declared. - No
context_window: the token preflight is skipped with a note. - Plain
http://to a non-loopback host prints a one-line stderr warning, also under--quiet; it is never a refusal. -
doctorfails whenapi_key_envnames an empty variable;dry-runprintsCost estimate: unknownand, when the provider cannot be built,Provider unavailable: <reason>.
- Providers — all backends + capability comparison.
-
OpenAI — the native OpenAI provider (uses strict
response_format). - Output formats — structured findings vs graceful degrade.
See also: Providers
Home · Installation · Quick start · Troubleshooting · GitHub repo · Issues
CommitBrief — local, LLM-powered code review for git diffs. This wiki documents only what ships in the binary.
Getting started
Commands · reviewing
Commands · summarizing
Commands · committing
Commands · setup
Commands · integration
Commands · inspect
Commands · maintenance
Configuration
Providers
- Overview
- Anthropic
- OpenAI
- Gemini
- OpenAI-compatible (DeepSeek/Mistral/Cohere/custom)
- Ollama
- CLI tools
Output
Operations
Reference