Skip to content

tianji-qingtian/dsh-model-router

231Last commit Aug 14, 2026

dsh-model-router DSH plugin

dsh-model-router is a plugin for DeepSeek Harness that intelligently routes user queries to either a cheap or strong model based on complexity. It uses a zero-prefix flash judge call to classify steps, and offers quick answers directly on the cheap model without cache-miss tax. The plugin also provides a composer dock panel showing real-time token usage, cache hit rates, and cost estimates.

How to install the dsh-model-router DSH plugin

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

Copying does not run this command. Review the repository and version before installing the dsh-model-router DSH plugin.

dsh-model-router DSH plugin data source

dsh-model-router DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-model-router DSH plugin can do

  • Cheap-model judge routing: uses a zero-prefix flash judge call to classify steps as SIMPLE or AGENTIC, routing heavy work to the main model and simple questions to the cheap model.
  • Quick answer mode: when invoked, runs a zero-prefix stream on the cheap model and writes the Q&A directly into the session log, bypassing the main model entirely.
  • Automatic fallback: transient failures (RATE_LIMIT, SERVER, TIMEOUT, EMPTY_RESPONSE) degrade the turn to the cheap model and retry once.
  • Real usage metering: session projection shows token usage, cache hits, and cost estimates per model, replay-safe and survives cold sessions.
  • Composer dock panel: provides an Auto/Off toggle, current model, live token/cache/cost figures, and per-model usage breakdown, with i18n support (zh/en).

Where the dsh-model-router DSH plugin fits

  • Reduce API costs by routing simple questions like 'What is the capital of France?' to a cheap model.
  • Improve response latency for trivial queries by using a zero-prefix flash model.
  • Monitor per-session token usage and cost breakdown for budgeting.
  • Handle transient provider failures gracefully by falling back to a cheaper model.
  • Integrate into a DSH-powered application to optimize model usage.

Who the dsh-model-router DSH plugin is for

  • DSH users who want to optimize costs and latency for their sessions.
  • Developers building applications on top of DeepSeek Harness needing fine-grained model routing control.

dsh-model-router DSH plugin limitations

  • Routing state is split: auto/off mode is durable, but transient-failure degradation flag is process-local and resets with harness restart.
  • Direct quick answers write a forged step envelope into the session log, which is the most harness-coupled part and may break after harness upgrades.
  • useProjection stats reflect whole session log including history recorded before installation.

dsh-model-router DSH plugin: from the repository README

Quoted from the tianji-qingtian/dsh-model-router README, the upstream source of the dsh-model-router DSH plugin. Copyright remains with the original authors.

Model Router & Cost Optimizer for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). Answers simple questions directly on the cheap model (zero prefix, no cache tax), degrades gracefully on transient provider failures, and shows live per-session token / cache-hit / cost figures right under the composer. > The harness is in developer preview and iterates quickly — expect compatibility-breaking changes. > 中文说明见 [README.zh.md](README.zh.md)。 ## Features - **Cheap-model judge routing** — clearly heavy work (strong keywords / long payloads) goes straight to the main model with zero added latency. Everything else is decided by a **zero-prefix flash judge call** (`SIMPLE` / `AGENTIC`, one word, 64-token cap, thinking off). The judge also sees the last assistant reply, so context-dependent follow-ups (它 / 这个 / 继续 …) are never misrouted to a context-free answer. - **Ask before quick-answering** — in auto mode, every SIMPLE hit asks the user through the built-in question UI: **⚡ 快速回答(flash)** or **主模型回答**. Choosing the main model (or dismissing the question) takes the normal flow; subagent sessions fall back automatically. The question text follows the request l

Read the full READMERepository license: MIT

dsh-model-router DSH plugin questions

How do I install dsh-model-router?

First ensure the `dsh` CLI is installed globally (`npm install -g @deepseek-ai/dsh`). Then run `dsh plugin --profile web add "github:tianji-qingtian/dsh-model-router#v0.7.2"`. Finally restart the harness with `dsh --profile web` to see the plugin in action.

How do I enable or disable quick answers?

You can toggle quick answers using the `/router auto|off` command in the chat, or use the Auto/Off toggle in the composer dock panel. The setting persists across sessions but resets after a restart if you used the command only within a session.

How can I see the cost breakdown for my session?

The composer dock panel displays live per-session metrics: current model, token usage (miss/cache), cache hit percentage, estimated cost, and a per-model usage breakdown. The numbers are calculated from the session projection and are replay-safe.

What happens if the cheap model fails during a quick answer?

The plugin automatically falls back to the cheap model for transient failures (RATE_LIMIT, SERVER, TIMEOUT, EMPTY_RESPONSE) and retries once. If the failure persists, it delegates to the provider's own retry policy.

Can I customize the price table used for cost estimates?

Yes. The price table is defined in `src/index.js` in the plugin repository. You can edit the `PRICE_TABLE` array to match your account's actual pricing. The panel always shows the cost with an `≈` prefix to indicate it's an estimate.