Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” dsh-router is a plugin developed by CARVIN94, designed to provide DSH with an OpenAI-compatible API routing layer. It does not require deploying an additional gateway service; instead, it runs directly as a DSH Web plugin and natively exposes OpenAI-compatible interfaces on the host service’s /v1 path. This addresses the pain points of traditional multi-service scenarios, such as maintaining independent ports, handling cross-origin requests, and keeping configurations in sync.
This plugin follows the MIT License.
Core Capabilities¶
dsh-router handles vendor management, account pool scheduling, composite fallback strategies, and credential storage uniformly at the core level, following these principles:
- Plugin-based integration: Embedded into DSH Web as a plugin, it starts and stops with the host service, is inherently same-origin, and requires no CORS handling.
- Plug-and-play vendors and extensions: Vendors and extensions (such as extended command rewriting) are independent plugins that can be toggled individually in the DSH plugin panel.
- Unified management of models and strategies: Model capabilities are not built into the plugin and are managed uniformly by the core; account pool selection, cooldown, disabling, and composite fallback strategies only need to be configured once at the core level.
- Single credential library: All vendor credentials are stored in
auths/credentials.sqlite, with their lifecycle managed uniformly by the core. - Composites as models: Composites configured in the routing panel are automatically exposed as a
routeroption under the DSH model catalog and can be invoked directly from settings. - Team-friendly support: Supports Agent Team scenarios. It performs affinity-based account selection based on session identity, keeping different sessions isolated to different connections as much as possible. Statistics are also isolated by session to avoid mutual interference.
- Usage observability: Provides a dashboard to view usage trends, top rankings, and recent request records.
Installation and Enablement¶
Before installing, ensure the host environment meets the following requirements: DSH version 0.2.0 or later, Node.js >= 20, and the web profile is in use.
- Run the installation command:
dsh plugin --profile web add dsh-router-core
- Restart the
dsh webservice. - Open the DSH settings panel. A “Routing” entry will appear below “Models” in the left navigation bar.
- Enter the “Routing” panel to add vendor links, configure composite strategies, and view the usage dashboard.
Configuration and Usage¶
In the routing panel, complete the following main configuration steps:
- Add vendors: Supports adding different types of vendors (such as link pools, API Keys, polling logins, etc.) and configuring credentials.
- Create composites: Set the vendor fallback chain, ordered from highest to lowest priority.
- Enable models: Enable or disable specific models on the vendor detail page, or customize general-purpose capability models.
After configuration, these composites are automatically synchronized to DSH’s model list. For subsequent calls, simply select the corresponding composite name.
Notes¶
- Version limitation: Plugin version 0.1.x is no longer supported; DSH 0.2.0 or later is required.
- Connection limit: When the number of connections is smaller than the number of concurrent members, prefix cache entries can evict each other, making it impossible to fully isolate them through account selection.
- Token estimation: When upstream returns
usage, actual values are used; if upstream does not returnusage, estimated values are displayed (failed requests are not estimated). Cached tokens are a subset of input tokens. - Data persistence: Usage data is aggregated by day and stored in
data/usage.json.
Summary¶
dsh-router integrates the originally distributed gateway functionality into the DSH ecosystem and achieves flexible extension of vendors and strategies through its plugin-based mechanism. For DSH users who need to manage multiple vendors, multiple accounts, and Team tasks, it provides a lightweight, unified, and easy-to-observe solution.
- Catalog page: https://www.skillhub.cn/plugins/CARVIN94/dsh-router
- Source code: https://github.com/CARVIN94/dsh-router