Custom LLM Providers
CMDOP supports custom LLM providers — any OpenAI-compatible API endpoint can be used for chat completions alongside the default cmdop provider, whose chat goes through the cmdop model gateway. Add providers via Desktop Settings → Providers or CLI cmdop provider add, then switch between them. With a custom provider active, chat goes straight to your endpoint with your key; vision / OCR is gateway-only, so it returns a clear error rather than falling back.
Use any OpenAI-compatible AI provider for chat completions.
How do I add a custom provider?
Via Desktop UI
- Open Settings → Providers (in “Additional” section)
- Click Add & Activate
- Select a preset (Z.AI, MiniMax, DeepSeek, Ollama, etc.) or choose “Custom…”
- Enter your API key
- Click Add — the provider is tested automatically and activated if successful
Via CLI
# List all configured providers
cmdop provider list
# Add a provider interactively
cmdop provider add
# Set as active provider
cmdop provider set <id>
# Reset to the cmdop default provider
cmdop provider defaultWhich providers are supported?
Any OpenAI-compatible endpoint works. Built-in presets (19 total):
| Provider | ID | Base URL | Default Model |
|---|---|---|---|
| Anthropic | anthropic | https://api.anthropic.com/v1 | claude-sonnet-4-6 |
| Z.AI | zai | https://api.z.ai/api/coding/paas/v4 | glm-5 |
| Z.AI China | zai-cn | https://open.bigmodel.cn/api/paas/v4 | glm-5 |
| MiniMax | minimax | https://api.minimax.io/v1 | MiniMax-M2.7 |
| Kimi | kimi | https://api.kimi.com/coding/v1 | kimi-k2.6 |
| Moonshot | moonshot | https://api.moonshot.ai/anthropic | kimi-k2.6 |
| DeepSeek | deepseek | https://api.deepseek.com/v1 | deepseek-chat |
| Xiaomi MiMo | mimo | https://api.xiaomimimo.com/v1 | mimo-v2-pro |
| Alibaba | alibaba | https://modelstudio.aliyuncs.com/compatible-mode/v1 | qwen3.5-plus |
| Alibaba US | alibaba-us | https://modelstudio-us.aliyuncs.com/compatible-mode/v1 | qwen3.5-plus |
| OpenAI | openai | https://api.openai.com/v1 | gpt-5 |
| Gemini | gemini | https://generativelanguage.googleapis.com/v1beta/openai | gemini-3-pro |
| xAI | xai | https://api.x.ai/v1 | grok-4-1-fast |
| Mistral | mistral | https://api.mistral.ai/v1 | mistral-large-latest |
| OpenRouter | openrouter | https://openrouter.ai/api/v1 | (any model) |
| Groq | groq | https://api.groq.com/openai/v1 | llama-3.3-70b-versatile |
| Ollama | ollama | http://localhost:11434/v1 | (user selects) |
| LM Studio | lmstudio | http://localhost:1234/v1 | (user selects) |
| Custom | custom | Any URL | (user specifies) |
How does it work?
CMDOP uses a two-key architecture:
| Key | Purpose | Storage |
|---|---|---|
| CMDOP sign-in token | The gateway path (chat, vision/OCR, embeddings) + CDN — the sign-in your agent already holds | ~/.config/cmdop/token.json |
| Custom provider API key | Chat completions only, sent straight to your endpoint | ~/.config/cmdop/provider_keys.json (mode 0600) |
This means:
- Chat goes straight to your custom provider (z.ai, Groq, etc.)
- Vision / OCR is gateway-only — with a custom provider active it returns a clear error, not a silent fallback
- Switch providers without affecting core CMDOP features
A custom provider is the bring-your-own-key escape hatch from the default router path. For the full picture — how the default path supplies provider keys, what the router brokers, and the two-credential model — see How model access works.
How do I switch providers?
Desktop
- Settings → Providers
- Click the radio button next to the provider you want
- The badge under the chat input updates immediately
CLI
cmdop provider set <id> # switch to custom
cmdop provider default # back to the cmdop default providerWhat about model aliases (@code, @balanced)?
Model aliases (@code, @balanced, @smart) are resolved server-side by the cmdop model gateway on the default path. When a custom provider is active, CMDOP automatically substitutes these aliases with the provider’s default model (e.g., @code → glm-5).
In the chat UI, the model selector is replaced by a provider badge showing the active provider and actual model:
┌──────────────┐ ┌─────────┐
│ Z.AI • glm-5 │ │ @code ▼ │ ← cmdop default
└──────────────┘ └─────────┘How are API keys protected?
Custom provider API keys are never stored in config.yaml. They go to a dedicated file:
~/.config/cmdop/provider_keys.json (file permissions: 0600, owner read/write only){
"providers": {
"uuid-here": "your-api-key"
}
}How do I test a provider?
Desktop
Click the flask icon (🧪) next to a provider in Settings → Providers. It sends a “Hi” request and shows success/error.
CLI
cmdop provider test <id>How do I delete a provider?
Desktop
Click the trash icon next to the provider in Settings → Providers.
CLI
cmdop provider delete <id>