Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
# Allow optional /p/{provider}/v1/... passthrough aliases while keeping /p/{provider}/... canonical (default: true)
# ALLOW_PASSTHROUGH_V1_ALIAS=true

# Comma-separated list of provider types enabled for /p/{provider}/... passthrough (default: openai,anthropic,openrouter,zai,vllm)
# ENABLED_PASSTHROUGH_PROVIDERS=openai,anthropic,openrouter,zai,vllm
# Comma-separated list of provider types enabled for /p/{provider}/... passthrough (default: openai,anthropic,openrouter,kilo,zai,vllm,deepseek)
# Cohere native passthrough is opt-in; add cohere when those routes are needed.
# ENABLED_PASSTHROUGH_PROVIDERS=openai,anthropic,cohere,openrouter,kilo,zai,vllm,deepseek
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Enable the realtime (speech-to-speech) endpoints (default: true): the /v1/realtime
# websocket (and /p/{provider}/v1/realtime passthrough upgrade), the WebRTC SDP
Expand Down Expand Up @@ -402,6 +403,10 @@
# longer outputs (e.g. Sonnet 4.6 / Opus 4.7).
# ANTHROPIC_DEFAULT_MAX_TOKENS=4096

# Cohere
# COHERE_API_KEY=...
# COHERE_BASE_URL=https://api.cohere.com

# Google Gemini
# GEMINI_API_KEY=...
# Use Gemini's native generateContent API for chat/responses (default: true).
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ const client = new Anthropic({

## Supported LLM Providers

GoModel supports OpenAI, Anthropic, Google Gemini, Vertex AI, DeepSeek, Groq,
Fireworks AI, Meta (Muse Spark), OpenRouter, Z.ai, xAI (Grok), Alibaba Cloud
Model Studio (Bailian), Kilo AI, MiniMax, Xiaomi MiMo, OpenCode Go, Azure OpenAI,
Oracle, Ollama, vLLM, Amazon Bedrock Runtime, Amazon Bedrock Mantle, and all
OpenAI-compatible providers.
GoModel supports OpenAI, Anthropic, Cohere, Google Gemini, Vertex AI, DeepSeek,
Groq, Fireworks AI, Meta (Muse Spark), OpenRouter, Z.ai, xAI (Grok), Alibaba
Cloud Model Studio (Bailian), Kilo AI, MiniMax, Xiaomi MiMo, OpenCode Go, Azure
OpenAI, Oracle, Ollama, vLLM, Amazon Bedrock Runtime, Amazon Bedrock Mantle, and
all OpenAI-compatible providers.

See the [Providers Overview](https://gomodel.enterpilot.io/docs/providers/overview?utm_source=readme) for the full
per-provider feature matrix (chat, `/responses`, embeddings, files, batches,
Expand Down
6 changes: 5 additions & 1 deletion config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server:
enable_passthrough_routes: true # expose /p/{provider}/{endpoint} passthrough routes
allow_passthrough_v1_alias: true # allow /p/{provider}/v1/... while keeping /p/{provider}/... canonical
user_path_header: "X-GoModel-User-Path" # env: USER_PATH_HEADER; inbound header used for user_path scoping
enabled_passthrough_providers: ["openai", "anthropic", "openrouter", "kilo", "zai", "vllm", "deepseek", "bailian"] # providers enabled on /p/{provider}/...
enabled_passthrough_providers: ["openai", "anthropic", "cohere", "openrouter", "kilo", "zai", "vllm", "deepseek", "bailian"] # providers enabled on /p/{provider}/...
Comment thread
coderabbitai[bot] marked this conversation as resolved.
realtime_enabled: true # env: REALTIME_ENABLED; expose /v1/realtime websocket and /p/{provider}/v1/realtime upgrades (OpenAI only)

models:
Expand Down Expand Up @@ -311,6 +311,10 @@ providers:
type: anthropic
api_key: "sk-ant-..."

cohere:
type: cohere
api_key: "${COHERE_API_KEY}"

bailian:
type: bailian
api_key: "${BAILIAN_API_KEY}"
Expand Down
3 changes: 2 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func clearProviderEnvVars(t *testing.T) {
for _, key := range []string{
"OPENAI_API_KEY", "OPENAI_BASE_URL", "OPENAI_MODELS",
"ANTHROPIC_API_KEY", "ANTHROPIC_BASE_URL", "ANTHROPIC_MODELS",
"COHERE_API_KEY", "COHERE_BASE_URL", "COHERE_MODELS",
"GEMINI_API_KEY", "GEMINI_BASE_URL", "GEMINI_MODELS",
"DEEPSEEK_API_KEY", "DEEPSEEK_BASE_URL", "DEEPSEEK_MODELS",
"XAI_API_KEY", "XAI_BASE_URL", "XAI_MODELS",
Expand Down Expand Up @@ -1131,7 +1132,7 @@ func TestLoad_ConfigExample_UsesNestedModelCacheSettings(t *testing.T) {
t.Fatalf("expected Cache.Model.Redis to be nil in example config, got %+v", result.Config.Cache.Model.Redis)
}
gotProviders := result.Config.Server.EnabledPassthroughProviders
wantProviders := []string{"openai", "anthropic", "openrouter", "kilo", "zai", "vllm", "deepseek", "bailian"}
wantProviders := []string{"openai", "anthropic", "cohere", "openrouter", "kilo", "zai", "vllm", "deepseek", "bailian"}
if !reflect.DeepEqual(gotProviders, wantProviders) {
t.Fatalf("Server.EnabledPassthroughProviders = %v, want %v", gotProviders, wantProviders)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/about/roadmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ icon: "list-todo"

## Roadmap to 0.2.0

- [ ] Broader provider support, including Cohere, Command A, and Operational
- [ ] Broader provider support beyond the current catalog
- [ ] Workflows rework with better UI/UX and a more flexible design
- [ ] Guardrails hardening: better UI, simpler architecture, easier custom guardrails, and response-side guardrails applied before output reaches the client
- [ ] Provider-native passthrough for all providers, beyond the current beta coverage
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Set these to automatically register providers. No YAML configuration required.
| -------------------- | -------------------------------------------------- |
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY` | Anthropic |
| `COHERE_API_KEY` | Cohere |
| `GEMINI_API_KEY` | Google Gemini |
| `DEEPSEEK_API_KEY` | DeepSeek |
| `OPENROUTER_API_KEY` | OpenRouter |
Expand Down Expand Up @@ -376,6 +377,7 @@ The simplest way to add providers. GoModel checks for well-known API key environ
```bash
export OPENAI_API_KEY="sk-..." # Registers "openai" provider
export ANTHROPIC_API_KEY="sk-ant-..." # Registers "anthropic" provider
export COHERE_API_KEY="..." # Registers "cohere" provider
export GEMINI_API_KEY="..." # Registers "gemini" provider
export DEEPSEEK_API_KEY="..." # Registers "deepseek" provider
export XAI_API_KEY="..." # Registers "xai" provider
Expand Down
1 change: 1 addition & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"providers/overview",
"providers/key-rotation",
"providers/anthropic",
"providers/cohere",
"providers/gemini",
"providers/deepseek",
"providers/xai",
Expand Down
117 changes: 117 additions & 0 deletions docs/providers/cohere.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: "Cohere"
description: "Configure Cohere in GoModel and use Command chat, tool calling, reasoning, image input, audio transcription, and Embed models through OpenAI-compatible APIs."
icon: "comment"
---

GoModel translates OpenAI-compatible Chat Completions, Responses, Embeddings,
and Audio Transcription requests to Cohere's native v2 API. Model
discovery uses Cohere's model catalog and exposes chat, embedding, and
transcription models through `/v1/models`.

## Configure

```bash
COHERE_API_KEY=...
# COHERE_BASE_URL=https://api.cohere.com # optional override
```

Or in `config.yaml`:

```yaml
providers:
cohere:
type: cohere
api_key: "${COHERE_API_KEY}"
```

Multiple keys use the standard `COHERE_API_KEY_2`,
`COHERE_API_KEY_3`, ... rotation convention. You can restrict or supplement
model discovery with `COHERE_MODELS`.

## Chat and Responses

Use a Cohere Command model with either OpenAI-compatible endpoint:

```bash
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer $GOMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "command-a-plus-05-2026",
"messages": [{"role": "user", "content": "Explain vector search briefly"}]
}'
```

Chat streaming, system and developer messages, image URL parts, JSON response
formats, tool definitions, tool calls, and tool results are translated to the
Cohere v2 format. `/v1/responses` uses the same chat adapter.

Cohere reasoning models enable thinking by default. To control Cohere's native
reasoning behavior, include its `thinking` object as an extension:

```json
{
"model": "command-a-reasoning-08-2025",
"messages": [{"role": "user", "content": "Solve this carefully..."}],
"thinking": {"type": "enabled", "token_budget": 4000}
}
```

Thinking output is returned as the OpenAI-compatible `reasoning_content`
extension in both normal and streaming responses.

## Audio transcription

Cohere audio uses a dedicated speech-to-text model and endpoint; Command chat
models do not accept audio content mixed into Chat Completions or Responses.
Transcribe audio through the OpenAI-compatible endpoint:

```bash
curl http://localhost:8080/v1/audio/transcriptions \
-H "Authorization: Bearer $GOMODEL_API_KEY" \
-F "model=cohere/cohere-transcribe-03-2026" \
-F "language=en" \
-F "response_format=json" \
-F "file=@recording.wav"
```

The Cohere transcription API requires `language` and returns JSON. GoModel
accepts the OpenAI-compatible `response_format=json` field but omits it from the
native request because JSON is Cohere's fixed response format. Cohere does not
support text-to-speech, prompt hints, timestamp granularities, or streaming
transcription.

## Embeddings

GoModel supplies Cohere's required embedding fields while retaining the
OpenAI request shape:

```bash
curl http://localhost:8080/v1/embeddings \
-H "Authorization: Bearer $GOMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "embed-v4.0",
"input": ["first document", "second document"],
"dimensions": 1024,
"input_type": "search_document"
}'
```

`input_type` defaults to `search_document`. Set it to `search_query`,
`classification`, or `clustering` when that better describes the input.
`encoding_format` supports `float` (the default) and `base64`. Cohere-native
`truncate`, `max_tokens`, and `priority` fields are also passed through.

## Native passthrough

Add `cohere` to `server.enabled_passthrough_providers`, then use paths such as
`/p/cohere/v2/chat` or `/p/cohere/v2/rerank` to call Cohere-native APIs that do
not have an OpenAI-compatible GoModel surface.

See Cohere's [Chat API](https://docs.cohere.com/reference/chat),
[Embed API](https://docs.cohere.com/reference/embed),
[Audio Transcription API](https://docs.cohere.com/reference/create-audio-transcription),
and [reasoning guide](https://docs.cohere.com/docs/reasoning) for native fields
and model-specific capabilities.
1 change: 1 addition & 0 deletions docs/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ support, not every individual model capability exposed by an upstream provider.
| -------- | ---------- | ------------- | :--: | :----------: | :---: | :---: | :-----: | :------: | ----- |
| OpenAI | `OPENAI_API_KEY` | `gpt-5.5` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — |
| Anthropic | `ANTHROPIC_API_KEY` | `claude-sonnet-4-20250514` | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | [Anthropic](/providers/anthropic) |
| Cohere | `COHERE_API_KEY` | `command-a-plus-05-2026` | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | [Cohere](/providers/cohere) |
| Google Gemini | `GEMINI_API_KEY` | `gemini-2.5-flash` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | [Google Gemini](/providers/gemini) |
| Google Vertex AI | `VERTEX_PROJECT` + `VERTEX_LOCATION` + GCP credentials | `google/gemini-2.5-flash` | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | [Google Vertex AI](/providers/vertex) |
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek-v4-pro` | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | [DeepSeek](/providers/deepseek) |
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/provider-credentials-note.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Note>
Set at least one provider credential or base URL
(`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`,
(`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `GEMINI_API_KEY`,
`DEEPSEEK_API_KEY`, `XAI_API_KEY`, `GROQ_API_KEY`, `OPENROUTER_API_KEY`, `KILO_API_KEY`,
`ZAI_API_KEY`, `AZURE_API_KEY` + `AZURE_BASE_URL`,
`ORACLE_API_KEY` + `ORACLE_BASE_URL`,
Expand Down
3 changes: 2 additions & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: gomodel
description: High-performance AI gateway for multiple LLM providers (OpenAI, Anthropic, Gemini, DeepSeek, Groq, Kilo AI, Z.ai, xAI)
description: High-performance AI gateway for multiple LLM providers (OpenAI, Anthropic, Cohere, Gemini, DeepSeek, Groq, Kilo AI, Z.ai, xAI)
type: application
version: 0.1.0
appVersion: "1.0.0"
Expand All @@ -11,6 +11,7 @@ keywords:
- gateway
- openai
- anthropic
- cohere
- gemini
- groq
- xai
Expand Down
5 changes: 4 additions & 1 deletion helm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GoModel Helm Chart

High-performance AI gateway for multiple LLM providers (OpenAI, Anthropic, Gemini, DeepSeek, Groq, Kilo AI, Z.ai, xAI, Oracle).
High-performance AI gateway for multiple LLM providers (OpenAI, Anthropic, Cohere, Gemini, DeepSeek, Groq, Kilo AI, Z.ai, xAI, Oracle).

## Prerequisites

Expand Down Expand Up @@ -58,6 +58,8 @@ helm install gomodel ./helm \
| `providers.existingSecret` | Existing secret for API keys | `""` |
| `providers.openai.enabled` | Enable OpenAI | `false` |
| `providers.anthropic.enabled` | Enable Anthropic | `false` |
| `providers.cohere.enabled` | Enable Cohere | `false` |
| `providers.cohere.baseUrl` | Optional Cohere base URL mapped to `COHERE_BASE_URL` | `""` |
| `providers.gemini.enabled` | Enable Gemini | `false` |
| `providers.gemini.useNativeApi` | Use Gemini native generateContent for chat/responses; set false for Gemini OpenAI compatibility | `true` |
| `providers.groq.enabled` | Enable Groq | `false` |
Expand Down Expand Up @@ -92,6 +94,7 @@ type: Opaque
stringData:
OPENAI_API_KEY: "sk-..."
ANTHROPIC_API_KEY: "sk-ant-..."
COHERE_API_KEY: "..."
GEMINI_API_KEY: "..."
ZAI_API_KEY: "..."
KILO_API_KEY: "..."
Expand Down
1 change: 1 addition & 0 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ To get the application URL:
{{- $enabledProviders := list }}
{{- if or .Values.providers.openai.enabled .Values.providers.openai.apiKey }}{{ $enabledProviders = append $enabledProviders "openai" }}{{ end }}
{{- if or .Values.providers.anthropic.enabled .Values.providers.anthropic.apiKey }}{{ $enabledProviders = append $enabledProviders "anthropic" }}{{ end }}
{{- if or .Values.providers.cohere.enabled .Values.providers.cohere.apiKey }}{{ $enabledProviders = append $enabledProviders "cohere" }}{{ end }}
{{- if or .Values.providers.gemini.enabled .Values.providers.gemini.apiKey }}{{ $enabledProviders = append $enabledProviders "gemini" }}{{ end }}
{{- if or .Values.providers.groq.enabled .Values.providers.groq.apiKey }}{{ $enabledProviders = append $enabledProviders "groq" }}{{ end }}
{{- if or .Values.providers.xai.enabled .Values.providers.xai.apiKey }}{{ $enabledProviders = append $enabledProviders "xai" }}{{ end }}
Expand Down
19 changes: 19 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@
}
}
},
{
"properties": {
"providers": {
"properties": {
"cohere": {
"properties": { "apiKey": { "minLength": 1 } }
}
}
}
}
},
{
"properties": {
"providers": {
Expand Down Expand Up @@ -261,6 +272,14 @@
"baseUrl": { "type": "string" }
}
},
"cohere": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"apiKey": { "type": "string" },
"baseUrl": { "type": "string" }
}
},
"gemini": {
"type": "object",
"properties": {
Expand Down
10 changes: 9 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ auth:
# LLM Provider configuration
providers:
# -- Use an existing secret for all provider API keys
# Secret should contain keys: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, XAI_API_KEY, ZAI_API_KEY, KILO_API_KEY, ORACLE_API_KEY, VLLM_API_KEY
# Secret should contain keys for enabled providers, such as OPENAI_API_KEY, ANTHROPIC_API_KEY, COHERE_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, XAI_API_KEY, ZAI_API_KEY, KILO_API_KEY, ORACLE_API_KEY, or VLLM_API_KEY
existingSecret: ""

openai:
Expand All @@ -61,6 +61,14 @@ providers:
# -- Optional: Override Anthropic base URL
baseUrl: ""

cohere:
# -- Enable Cohere provider (auto-enabled if apiKey is set)
enabled: false
# -- Cohere API key (ignored if providers.existingSecret is set)
apiKey: ""
# -- Optional: Override Cohere base URL
baseUrl: ""

gemini:
# -- Enable Google Gemini provider (auto-enabled if apiKey is set)
enabled: false
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/admin/dashboard/static/dist/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading