Preface¶
DeepSeek Harness (DSH) handles model inference routing and conversation orchestration, while cc-switch handles provider configuration and usage queries. These two are typically disconnected at the data level: models and providers configured in cc-switch cannot be directly used in DSH, and usage status is difficult to view within the DSH interface. dsh-switch is a DSH plugin whose core purpose is to serve as a bridge layer, mirroring cc-switch’s database contents into DSH’s settings namespace in real time, and synchronously displaying provider usage information.
Core Features¶
The plugin implements the following main functions:
-
Real-time Configuration Sync
The plugin monitors cc-switch’s database (~/.cc-switch/cc-switch.db) through a file watching mechanism. When you save configuration in cc-switch, the plugin mirrors all available providers and models into DSH’sllm-pi-aisettings namespace. The sync process is triggered via DSH’s event bus (llm/adapters-updated), and models become available in DSH approximately one second after saving—no application restart required. -
Full-Type Provider Support
The plugin supports converting multiple types of providers into DSH routing:- Claude: Mapped as
anthropic-messages. - Codex/GPT (API Key): Mapped as
openai-responsesoropenai-completionsviawire_api. - Gemini Shape Relay: Mapped as
openai-completions. - OpenClaw: Uses DSH shape configuration directly.
- For providers that cannot be converted to DSH routing (such as OAuth login types or native Gemini endpoints), the plugin will list the skip reasons.
- Claude: Mapped as
-
Usage Visualization
The plugin displays real-time usage badges next to the model selector in DSH’s conversation input bar. When a provider that owns the model has usage queries configured, the badge shows the balance or subscription window.- Balance Templates: Supports
balancetemplates (DeepSeek, StepFun, SiliconFlow, OpenRouter, Novita AI, etc.) andgeneral/newapiscripts. - Plan Templates: Supports
token_plan(Volcano Ark, MiniMax). - Query results are cached client-side for zero-latency updates when switching models.
- The plugin’s settings card displays a separate usage row for each provider that has enabled usage queries.
- Balance Templates: Supports
Installation & Configuration¶
Before using this plugin, the following environment requirements must be met:
* cc-switch is installed locally (database path is ~/.cc-switch/cc-switch.db).
* DSH version >= 0.1.5-rc.1.
* Node.js version >= 24.
The installation command is as follows:
dsh plugin --profile desktop add github:a981008/dsh-switch
After installation, restart DSH Desktop to enable it.
Usage Examples¶
- Configure providers (such as Claude, GPT, etc.) and models in cc-switch, and set up usage query scripts.
- Save the cc-switch configuration. The plugin will automatically sync the new providers and models to DSH.
- Select the synced model in DSH’s conversation. If the provider has usage queries configured, a real-time usage badge will appear next to the model selector in the input bar.
- In DSH’s plugin settings card, you can view the usage status of all providers.
Notes¶
- Privacy & Security: The plugin opens the cc-switch database in read-only mode. API Key values are not sent to the browser; the settings file only references names, not plaintext. Credentials in error messages are also sanitized.
- Authentication Limitations: OAuth/subscription login providers (such as ChatGPT, official Gemini) cannot be used for DSH routing authentication and will be skipped.
- Default Model Following: When switching the “current provider” in cc-switch, DSH’s
agent-default-modelwill automatically follow. However, if this default is already fixed to a non-synced route (such as a custom provider or third-party wrapper), it will not be overwritten. - License: MIT License.
Conclusion¶
dsh-switch eliminates the data gap between DSH and cc-switch, enabling automatic configuration synchronization and real-time usage monitoring. For users who use DSH for inference management and cc-switch for provider management simultaneously, this plugin provides the necessary connection layer, reducing manual maintenance costs.