Preface

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. When using multiple models or building agents, the stability and maintainability of provider routing are core pain points. dsh-smart-route is a plugin that addresses these pain points. As an alternative to polyglot, it provides finer-grained error handling and routing management capabilities.

Plugin Introduction

Name: dsh-smart-route
Maintainer: Semidia
Description: Smart routing: automatic provider routing (alternative to polyglot) — full error-code fallback, one-click enable/disable, and a clean model list.

Core Features

Channel Chain and Full Error Fallback
The plugin allows configuring a real-provider chain in order (such as deepseek-official, yunzhou, mze, etc., which must be providers already registered in DSH). It attempts them from top to bottom. If any channel in the chain returns an error (including 4xx errors, HTTP_xxx, authentication failures, transport errors, etc.), the plugin automatically tries the next provider. The final error is returned only if all channels in the chain fail.

Cooldown Mechanism
After a provider fails, it enters a cooldown period (exponential backoff + jitter). During the cooldown, that provider is skipped to avoid repeated requests that could cause service issues.

One-Click Enable/Disable and Multi-Chain Management
Both the chat bar button and the settings card allow one-click enabling or disabling of the entire routing system. When disabled, the smart-route virtual provider directly rejects requests (with the error code DISABLED) and prompts the user to enable it. The settings card supports creating, deleting, and switching default chains.

Clean Model List
The plugin registers only one virtual provider, smart-route, instead of registering many configurable providers. No large number of channel models will appear in the model selector.

Retry Policy and Channel-Level Configuration
Plugin supports configuring retryPolicy via settings (retry count, backoff delay, and jitter ratio). Each channel can declare a baseUrl or an apiKeyEnv. Channels that declare a baseUrl use the built-in OpenAI-compatible dispatcher.

Installation and Activation

Use the official installation command:

dsh plugin --profile web add github:Semidia/dsh-smart-route
dsh web

After restarting dsh web, refresh the page. The default chain is deepseek-official + deepseek-v4-flash, which can be modified in the settings card or in cordis.patch.yml.

Typical Usage

Chat Bar Button
Next to the model selector, a “Smart Routing” capsule button appears (green dot = enabled). Clicking it opens a panel where you can toggle enable/disable and view channels currently in cooldown.

Settings Card
Go to Settings → Plugins → Smart Routing, edit the provider order for the default chain, and the changes take effect for the next request after saving.

Notes

Known Issue (rc.6)
The settings UI depends on the upstream whitelist, so the settings card may display “namespaces are not exposed.” The core routing functionality does not depend on the settings UI and can work with the default chain even without configuration. See related discussions for upstream progress.

Disabled Behavior
When disabled, requests are directly rejected, prompting the user to enable it from the chat bar or settings.

Conclusion

dsh-smart-route provides a complete provider routing solution and is suitable for DSH users who require high availability and fine-grained control.