In the DeepSeek Harness (DSH) plugin ecosystem, model routing is a key component for balancing cost and performance. Traditional routers based on keywords or a single session header often struggle to accurately distinguish different subtask types (for example, coding tasks versus hard-coded tasks) under the same primary route. dsh-quota-router is designed to solve this problem by preserving the full context of “task profiles” and “candidate chains”, ensuring deterministic routing decisions.

What It Is

This is a purely policy-driven multi-source model routing plugin maintained by Liyuk. It does not rely on adapters or managed credentials; instead, it only uses model sources natively registered in DSH and builds candidate chains through a global priority list and task mappings. The plugin is mainly used to manage “cost sources” in mixed-source workflows (free, subscription, unlimited, low-cost, manual emergency).

Core Features

  • Deterministic Task Profiles: Supports named task profiles and ordered candidate chains, ensuring clear routing logic for each turn.
  • Health Awareness and Fallback: Provides health checking capability and can perform bounded, explainable fallbacks when infrastructure failures occur.
  • Observability: Offers observation interfaces for routing decisions and accurately measures routing usage without overstating token savings.

Installation and Activation

Installing the plugin uses the npm command:

npm install @liyuk/dsh-quota-router

After installation, enable the package in the DSH Web configuration file to use it.

Typical Usage

  1. Configure routing policy: In the DSH Web interface, go to Settings → Quota Router. The page opens a dedicated configuration entry, allowing you to edit the global priority list, retry policies, keyword mappings for task profiles, and the modelBySource mapping.
  2. Runtime check: Use the read-only tool quota_router_status to inspect runtime decision state, including active cooldowns, routing decisions, and usage.
  3. Routing flow: The plugin routes user messages to the specified named task profile, then selects the first healthy and automatically eligible source from that profile’s candidate chain.

Applicable Scenarios and Notes

  • Permission scope: Only uses providers and models natively registered in DSH; the plugin itself does not own adapters or credentials.
  • Sorting authority: sources.priority is the sole authority for source ordering; sourceTier is only explanatory metadata and not a hidden re-ranking rule.
  • Manual and emergency candidates: manual and emergency candidates are never automatically selected.
  • Paid fallback: Paid candidates require the explicit allowPaidFallback: true option to be selected.
  • History: Context compression is independently configured and triggered by DSH; this plugin does not rewrite session history.

For more details, see the GitHub repository or the SkillHub catalog.