Skip to Content

Custom LLM Providers

TL;DR

CMDOP supports custom LLM providers — any OpenAI-compatible API endpoint can be used for chat completions alongside the default SDKRouter. Add providers via Desktop Settings → Providers or CLI cmdop provider add, switch between them, and CMDOP routes chat through your chosen provider while keeping search, vision, and CDN on SDKRouter.

Use any OpenAI-compatible AI provider for chat completions.

How do I add a custom provider?

Via Desktop UI

  1. Open Settings → Providers (in “Additional” section)
  2. Click Add & Activate
  3. Select a preset (Z.AI, MiniMax, DeepSeek, Ollama, etc.) or choose “Custom…”
  4. Enter your API key
  5. 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 SDKRouter default cmdop provider default

Which providers are supported?

Any OpenAI-compatible endpoint works. Popular presets:

ProviderBase URLDefault ModelNotes
Z.AIhttps://api.z.ai/api/coding/paas/v4glm-5GLM models
Z.AI Chinahttps://open.bigmodel.cn/api/paas/v4glm-5China region
MiniMaxhttps://api.minimax.io/v1MiniMax-M2.7
Kimi K2https://api.kimi.com/v1kimi-k2.5
DeepSeekhttps://api.deepseek.com/v1deepseek-chat
Xiaomi MiMohttps://api.xiaomimimo.com/v1mimo-v2-pro
OpenRouterhttps://openrouter.ai/api/v1(user selects)All models
Ollamahttp://localhost:11434/v1(user selects)Local, no key
LM Studiohttp://localhost:1234/v1(user selects)Local, no key
CustomAny URL(user specifies)Must support /v1/chat/completions

How does it work?

CMDOP uses a two-key architecture:

KeyPurposeStorage
CMDOP auth tokenSDKRouter: search, vision, CDN~/.config/cmdop/token.json
Custom provider API keyChat completions only~/.config/cmdop/provider_keys.json (mode 0600)

This means:

  • Chat goes through your custom provider (z.ai, Groq, etc.)
  • Search, vision, CDN still use SDKRouter
  • Switch providers without affecting core CMDOP features

How do I switch providers?

Desktop

  1. Settings → Providers
  2. Click the radio button next to the provider you want
  3. The badge under the chat input updates immediately

CLI

cmdop provider set <id> # switch to custom cmdop provider default # back to SDKRouter

What about SDKRouter model aliases (@code, @balanced)?

SDKRouter aliases (@code, @balanced, @smart) are resolved by the SDKRouter server. When a custom provider is active, CMDOP automatically substitutes these aliases with the provider’s default model (e.g., @codeglm-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 ▼ │ ← SDKRouter 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>
Last updated on