Skip to content

Provider OpenAI compatible

Muhammet Şafak edited this page May 28, 2026 · 1 revision

Home / Providers / OpenAI-compatible (DeepSeek, Mistral, Cohere)

Providers: deepseek, mistral, cohere

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

Setup

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 --staged

The API key can come from config (providers.<name>.api_key) or the matching environment variable above.

Structured output

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 retry-once-then-degrade pipeline handles output that doesn't parse (it falls 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.

Pricing

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.

See also

  • Providers — all backends + capability comparison.
  • OpenAI — the native OpenAI provider (uses strict response_format).
  • Output formats — structured findings vs graceful degrade.

Clone this wiki locally