Preface

DeepSeek Harness (dsh) frames the agent loop as “everything is a plugin”: models, tools, and interface slots can all be plugged in. When coding daily via the web interface, two types of requests often appear in conversations: one is short queries like “what does this error mean?” or “continue”, and the other is heavy tasks such as refactoring architecture, reading large files, and running multi-step tools. If you use the main model for everything, even simple Q&A will consume prefix cache and inference budget; if you use a cheap model for everything, complex tasks will easily suffer from quality degradation.

The community plugin dsh-model-router addresses this middle ground: it first determines whether the current step is a simple question. Simple questions will be answered directly via flash, while heavy tasks still go through the main model. It can also downgrade and retry once when the main model experiences a temporary failure. A token/cache hit/estimated cost panel is added below the input box. This article is organized after cross-checking the plugin directory page, GitHub repository README, package.json, and source code.

The community plugin directory (https://deepseek-harness-plugin.com) is an independent site and has no official affiliation with DeepSeek or Magic Square. Do not treat it as an official app store. There is another同名 repository on GitHub, superboy911/dsh-model-router, which handles keyword routing and isolated image generation, and it is not the same plugin introduced in this article.

What is this

dsh-model-router is an interface enhancement plugin for the DeepSeek Harness web interface, maintained by tianji-qingtian under the MIT license, and primarily written in JavaScript. It was added to the directory on 2026-08-12, categorized under “Interface Enhancement”. The current version in the repository’s package.json is 0.8.1, and the latest GitHub Release is also v0.8.1 (2026-08-14). The plugin declares its client platform as web, so it needs to be attached to a web profile to display the panel.

It solves three problems:
- Keep simple questions out of the main model: answer with zero-prefix flash, without touching the prefix cache of the main session.
- Avoid full-round failures due to transient faults: downgrade to a cheap model and retry when encountering rate limits, server errors, timeouts, or empty responses.
- Make usage visible: fold real adapter tokens per session, and estimate a cost marked with based on model tiers.

The official Harness repository states that it is still in developer preview, so incompatible changes are expected. The plugin README also reminds: after upgrading Harness, the part that wraps fake step envelopes needs to be rechecked.

Core Features

Cheap Model Judge Routing

Requests first go through the agent/pre-step waterfall. Obvious heavy tasks (strong keywords or超长 text) go directly to the main model without extra delay. The remaining requests will go through a zero-prefix flash judge: only output one word, either SIMPLE or AGENTIC, with a maximum of 64 tokens, and thinking is disabled. The judge will carry the previous assistant reply to recognize context-dependent follow-ups like “it”, “this”, or “continue”, avoiding misjudging follow-ups as questions that can be answered without context.

The pairing of cheap/strong models is not hardcoded. At runtime, it matches by ID from the list in llm.listModels:
- Cheap candidates: flash|chat|mini|turbo|haiku|lite|air|nano
- Strong candidates: pro|reasoner|opus|sonnet|max|ultra|premium|r1

Under the native DeepSeek adapter, the documented pairing is deepseek-v4-flashdeepseek-v4-pro.

Ask Before Answering, Then Answer Directly

Starting from v0.8.0, when SIMPLE is hit in auto mode, it will not answer immediately. Instead, it will pop up the built-in question UI of Harness, letting the user choose:
- ⚡ Quick Answer (flash): Faster and lower cost
- Main Model Answer: Follow the normal agent workflow

Selecting the main model, closing the popup, entering a sub-agent session, or lacking the question UI will fall back to the normal workflow. The question text follows the user’s language (Chinese/English).

After the user selects quick answer, the plugin rejects the current step, uses the cheap model to make a zero-prefix single-streaming call, and then writes the Q&A into the conversation log by forging step/startassistant/messagestep/end envelopes. It looks like a normal Q&A in the interface, with the answer prefixed with ⚡ Quick Answer ·. The main model does not participate in this round, and no sub-agent sessions, relay cards, or toasts will be generated. The main session’s model and prefix cache remain unchanged.

Auto/Off and Fault Downgrade

Quick answer can be toggled per session, with three entry points doing the same thing:
- The Auto/Off switch on the panel below the input box
- Slash commands /router auto or /router off
- The model-visible tool route_model (parameter tier: auto | off)

There is no configuration option for “specify model per request”. The auto/off state is persisted per session projection from the command/run event, and it remains after restarting; the transient fault downgrade flag is process-local and will be lost when Harness exits.

Downgrade only covers these transient errors: RATE_LIMIT, SERVER, TIMEOUT, EMPTY_RESPONSE. After hitting one, the round is marked as downgraded, returns { kind: 'retry' }, and when retrying enters agent/request, it falls back to the cheap model, with a maximum of one retry per round. Other errors are handed over to the provider’s own retry strategy.

In addition, agent/request will pull the model back to the agent configuration default value when there is no routing decision, avoiding stale persisted headers from forging headers or resticks.

Usage Panel Below the Input Box

The panel is attached to conversation.composer.dock, and the Chinese/English text follows Harness’s locale service. The content includes:
- Auto/Off switch
- Current model
- A line of miss/out/cache%/≈$
- QA×N quick answer count (briefly highlighted after each quick answer)
- Detailed usage breakdown by model

The numbers come from the session projection modelRouter, which folds request/header, command/run, and assistant/message events. It uses the real tokens reported by the adapter (input/output/cache read/cache write/inference), not the number of calls estimated by the frontend. The projection can be replayed, so numbers will appear even for cold-start sessions. History already logged before installation will also be counted, which is the intended behavior documented.

The cost is estimated by tiers, in USD per million tokens, defined at the top of src/index.js:

const PRICE_TABLE = [
  { test: CHEAP_RE, input: 0.27, output: 1.10, cacheHit: 0.07 },
  { test: STRONG_RE, input: 0.55, output: 2.19, cacheHit: 0.14 },
]

The panel numbers always carry . Cache hits are counted at the cache price, not the input price. Harness’s TokenUsage field is disjoint: inputTokens already excludes cache reads (DeepSeek reports prompt_tokens = hit + miss, and the adapter subtracts the hit count), so the panel displays miss … · cache N%, where the hit rate is hit / (hit + miss). Documentation says healthy long conversations usually have a hit rate above 90%. The price table can be modified to match your actual account pricing.

Installation and Activation

The installation command given on the directory page is:

dsh plugin add github:tianji-qingtian/dsh-model-router

The dsh CLI needs to be in your PATH. If you have only run Harness via npx before, you will get command not found: dsh. The pre-step in the repository README is to install it globally first:

npm install -g @deepseek-ai/dsh

You can also use pnpm add -g @deepseek-ai/dsh (ensure the global bin directory is in your PATH), or prepend npx @deepseek-ai/dsh to all subsequent commands.

This plugin’s client declaration is for the web platform. The repository README recommends installing it into the web profile and pinning the Release tag. The README example still uses #v0.7.2, while the latest repository Release is v0.8.1 (which includes the “ask user before quick answer” feature). The reproducible installation suggestion is to pin the latest tag:

dsh plugin --profile web add "github:tianji-qingtian/dsh-model-router#v0.8.1"
dsh --profile web

The add command only modifies the profile file, and running instances will not hot-reload. After restarting, the ⚡Router panel should appear below the input box; the host half-load will register /router and route_model after loading. You can confirm that dsh-model-router is in the plugin list in Settings → Plugins.

The directory page also reminds: for reproducible installation, you can use the format github:tianji-qingtian/dsh-model-router#commit. A同名 dynamic prototype running in a specific session (only alive in the current process) is different from the bundle installed in the profile, and it will disappear when Harness exits.

The plugin runs with the permissions of the current dsh process, and may execute code during installation. You should read the repository source code and MIT license before installing.

Typical Usage

After installing and restarting the web profile, you can verify in the following order:
1. Open the web interface and check if the ⚡Router panel appears below the input box. The switch should toggle between Auto and Off.
2. Keep Auto mode and send a self-contained short question, such as “What is the difference between list and tuple in Python”. When the judge outputs SIMPLE, the ⚡ Quick Answer (flash) / Main Model Answer popup will appear. After selecting quick answer, the reply should be marked with ⚡ Quick Answer, and the QA×N count on the panel will increase by one.
3. Send a follow-up question like “continue expanding the second point”. According to the documented design, the judge can see the previous reply, so such context-dependent questions should go to the main model instead of being answered directly without context.
4. Use slash commands to toggle explicitly:

/router auto
/router off

The only valid parameters are auto or off. Wrong parameters will return usage: /router auto|off.
5. You can also let the model call route_model, with the parameter tier also being auto or off. The tool return will include the current mode and the parsed cheap model ID from the catalog.
6. Check the miss/out/cache%/≈$ and detailed breakdown by model on the panel. If the cache hit rate is consistently low in long conversations, first check if you are switching models or clearing the context every time, before modifying the price table.

Applicable Scenarios and Notes

It is suitable for these situations:
- You mainly work in the DeepSeek Harness web interface and want simple Q&A to go through flash, while refactoring/multi-tool tasks still go through the main model.
- You want to see the session’s token count, cache hit rate, and estimated cost next to the input box, instead of checking the billing page afterwards.
- You occasionally encounter rate limits, timeouts, or empty responses, and want the round to automatically downgrade to a cheap model and retry, instead of having the entire conversation stall.

Before using, please note:
- The client platform is web. If you only run the terminal TUI without launching the web interface, the dock panel will not be visible even after installation.
- package.json requires Node.js ^22.19.0 || >=24.0.0, and declares peer dependencies on packages such as @deepseek-ai/cordis, dsh-commands, dsh-llm, and dsh-session. If these packages become mismatched after Harness upgrade, you need to reinstall the plugin matching the new Release.
- Quick answers will write fake step envelopes into the conversation log, which is the most tightly coupled part between the plugin and Harness. The official Harness is still in developer preview, so you should recheck whether quick answers still conform to session invariants after upgrading.
- The panel cost is an estimated tier price, not your actual bill. You need to modify PRICE_TABLE to match your actual pricing.
- The plugin runs with the permissions of the current dsh process. Before installing, check the source code and license at https://github.com/tianji-qingtian/dsh-model-router; do not treat the directory page as official endorsement.

Summary

dsh-model-router integrates “simple questions answered via flash, downgraded on transient faults, and session usage visualization” into the area below the DeepSeek Harness web input box. Routing decisions are made at agent/pre-step, cost numbers come from replayable session projections, and the only toggle options are auto/off with no per-request model configuration.

Directory page: https://deepseek-harness-plugin.com/zh-CN/plugins/dsh-model-router/

GitHub: https://github.com/tianji-qingtian/dsh-model-router