2.6 KiB
Unified AI Gateway (LiteLLM) and OpenClaw Compatible Providers Design Plan
To maintain the OpenClaw client's native provider/model syntax habits, while still routing all traffic through the unified LiteLLM gateway for centralized authentication, rate limiting, and log management, we are refactoring the gateway mapping layer.
Design Goals
- Deprecate the thin
litellmprovider, and switch to a compatible mode directly configuring the three major providersdeepseek,nvidia, andollamain OpenClaw. - In the backend configuration of OpenClaw, these three major providers will all point to
http://127.0.0.1:4000/v1(LiteLLM endpoint), and use the unifiedAI_WORKSPACE_AUTH_TOKENfor authentication. - The routing (Alias ID) inside LiteLLM strictly adopts the
provider/modelnaming format, exactly matching the three major channels. This not only bypasses OpenClaw's routing interception, but also achieves full-channel centralized proxying.
Channel Mapping Matrix
Based on current API access, the channel distribution plan is as follows:
1. DEEPSEEK_API_KEY (DeepSeek Official Channel)
deepseek/deepseek-v4-flashdeepseek/deepseek-v4-prodeepseek/deepseek-chatdeepseek/deepseek-reasoner
2. NVIDIA_API_KEY (NVIDIA NIM / Proxy Channel)
nvidia/deepseek-v4-flashnvidia/deepseek-v4-pronvidia/glm-5.2nvidia/minimax-m3nvidia/qwen3.5nvidia/kimi-k2.7-code
3. OLLAMA_API_KEY (OLLAMA Cloud / Proxy Channel)
ollama/deepseek-v4-flashollama/deepseek-v4-proollama/glm-5.2ollama/minimax-m3ollama/qwen3.5ollama/kimi-k2.7-code
Implementation Details
-
LiteLLM Model Registration Layer (
register_mainstream_models.sh) Modify the invocation logic ofadd_model, registering corresponding prefix aliases under the protection of DeepSeek, NVIDIA, and OLLAMA environment variables respectively according to the matrix above. -
OpenClaw Gateway Configuration Layer (
gateway_openclaw/defaults/main.yml)- Add three new Provider nodes:
deepseek,nvidia, andollama. - The
apiis uniformly set toopenai-completions, andbaseUrlpoints to LiteLLM. - Remove the old
litellmmonolithic configuration. - Update the UI dropdown
gateway_openclaw_default_modelsto encompass all new channel models.
- Add three new Provider nodes:
Effects
After the configuration takes effect, the frontend can intuitively experience different channels like native calls (such as selecting glm-5.2 under the NVIDIA category), while all backend traffic is centralized in the LiteLLM proxy, eradicating Auth parsing errors.