Introduction to the DeepSeek Harness Automatic Model Routing Plugin

Overview

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. In daily use, “chit-chat” and “work” have completely different model requirements: chit-chat prioritizes low cost and fast response, while work requires deep reasoning and a stronger model. Manually switching between the two tiers frequently is both cumbersome and error-prone; a wrong switch either wastes tokens or produces poor results. The dsh-auto-model-router plugin is designed to solve this problem. It automatically determines from the conversation context whether traffic should go through the Chat (light) tier or the Work (deep) tier, enabling automatic routing.

Plugin Positioning

This plugin is maintained by developer Elysia11451 and uses the MIT License. It is a workflow-type plugin (v0.8.7.1 prerelease). Its core function is to automatically switch between the Chat and Work tiers per conversation: chit-chat uses the cheaper Chat tier to save tokens, while work uses the strongest model in the free pool for deep inference.

Core Features

The plugin implements automatic routing through the following mechanisms:

  1. Dual-Tier Routing
    IM chit-chat automatically uses the Chat tier. When explicit work instructions are detected (for example, “install a plugin,” “write a script,” or “run tests”), it automatically switches to the Work tier.

  2. Three-Layer Decision
    The routing logic has three layers: it first uses conversational state-machine memory; if the state machine fails, it falls back to keyword-based detection; if no match is found, it defaults to the Chat tier.

  3. First-Round Popup
    In the DSH main interface, the first round of a new conversation displays a Chat/Work selection popup. The user’s choice is recorded and applied in subsequent rounds.

  4. Directional Cooldown
    The plugin imposes cooldown limits on tier switches. Downgrading from Work back to Chat is constrained by switchCooldownMs (default 5s) to prevent the model from rapidly oscillating back and forth; upgrading from Chat to Work is not subject to this restriction.

  5. Manual Absolute Priority
    In the current conversation, if the user manually selects a model, the routing logic respects that selection and does not override it automatically.

  6. Work Tasks on Chat Tier Ask Only Once
    When a Chat-tier conversation invokes production-level tools (such as writing files or running commands), a popup asks once whether to switch to the Work tier. If the user declines or times out, the conversation will not ask again and remains in the Chat tier.

Installation and Enablement

After installation, re-enter DSH (or perform a cold start) to enable it.

dsh plugin --profile web add github:Elysia11451/dsh-auto-model-router

Usage Examples

It can be used directly in the DSH main interface or in IM. No additional configuration is required for daily use; the plugin automatically recognizes the context.

# 执行自检以验证插件状态
dsh plugin --profile web exec auto-model-router.selftest

Applicable Scenarios and Notes

The plugin is suitable for scenarios that need to balance cost and reasoning capability. Before installation, confirm the source code and license to ensure compliance with usage requirements.

This plugin depends on the community plugins dsh-our-free-model (provides the free model pool) and dsh-im (bridges IM channels).

Known Limitations (v0.8.7.1 Prerelease)

Before using it, be aware of the following limitations:

  • IM First-Round Popup Not Triggered: New conversations over IM channels such as QQ/WeChat cannot display the Chat/Work selection popup in the first round. They silently use the Chat tier, and the next round relies on keywords to correct the routing.
  • Choosing Chat in the First Round Does Not Switch Immediately: In earlier versions, after selecting Chat in a new conversation, the first-round model might still inherit the Work-tier model. This issue has been fixed in v0.8.7.1.
  • No Standalone Test Case for the First-Round Promise: The promise mechanism that “it will never automatically upgrade to Work” after choosing Chat in the first round currently has no dedicated assertion coverage and is only validated through integration tests.
  • First-Round Messages May Be Lost in Extreme Cases: If dynamic loading of @deepseek-ai/dsh-llm fails, the plugin may switch the model without resending the retained message, causing message loss. In extreme cases, manually resend the previous message.
  • Mobile Validation: Real-device narrow-screen testing on mobile has not been performed; the settings page UI relies on desktop as the reference.

Summary

dsh-auto-model-router combines state-machine logic, keyword detection, and manual intervention to automate management of DSH model tiers. It solves the cumbersome problem of manual model switching and improves stability through cooldown mechanisms and manual-priority policies. Developers can refer to the directory page or GitHub for more details.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye