Introduction¶
In daily use of DeepSeek Harness, switching models based on task complexity usually requires manual operations. Given the differences in pricing and capabilities across models, manual selection is inefficient. The dsh-smart-router plugin introduces a virtual model that automatically routes requests to configured models based on request content (text difficulty or visual needs), with no extra setup required.
Installation and Enablement¶
Install the plugin using the official command:
dsh plugin --profile web add dsh-smart-router
After installation, restart the dsh web service. After restarting, a Smart Router (automatic routing) option appears in the session model selector.
Core Features¶
Difficulty-Tier Routing¶
The plugin automatically routes requests to three tiers based on complexity:
- Hard: architecture design, complex refactoring, difficult debugging.
- Normal: routine conversations, medium-complexity tasks.
- Easy: file operations, formatting, casual chat.
Vision Routing¶
When a message contains images, it automatically switches to a vision model for processing. The vision model returns structured evidence (summary, OCR, layout analysis), which is replaced back into the text stream for continued processing. Two modes are supported:
- replace (default): structured replacement; image blocks are replaced by evidence text, and subsequent difficulty classification still applies.
- route: the entire request is routed directly to the vision model.
Classifier Modes¶
- Heuristic (default): scores based on keywords, code volume, and number of file references; zero cost and zero latency.
- LLM: calls a model for classification; more accurate and supports caching.
Cache-Friendly¶
The plugin recommends selecting models from the same provider and same series for the three tiers (for example, the same vendor’s Pro/Flash versions) to improve prefix cache hit rates.
Configuration and Usage¶
- Open Settings → Smart Routing: configure one model each for hard, normal, easy, and vision (the models in the dropdown list are those already configured in “Settings → Models”).
- In a session, open the model selector and select Smart Router (automatic routing).
- The plugin automatically classifies requests and routes them to the corresponding tier.
If no routing tiers are configured, requests fall back to the default model.
Configuration Example¶
Configure in ~/.dsh/profiles/web/settings.yaml:
smart-router:
enabled: true
classifier: heuristic # heuristic | llm
hardProvider: deepseek-official
hardModel: deepseek-v4-pro
normalProvider: deepseek-official
normalModel: deepseek-chat
easyProvider: deepseek-official
easyModel: deepseek-flash
visionProvider: zhipu-vision # 需在设置→模型填入 GLM_API_KEY
visionModel: glm-4v-flash
visionMode: replace # replace | route
visionCacheTtl: 3600
Notes¶
- Fail-open behavior: if no routing tiers are configured, requests fall back to the current session’s default model.
- Thinking intensity: the thinking intensity on the dialog box model selector (Off/High) acts as a global switch, determining whether extended thinking is enabled.
- Vision processing: a free anonymous vision model (OVHcloud Qwen2.5-VL-72B-Instruct) is built in by default; it can also be replaced with a self-configured model.
- Ecosystem compatibility: the plugin only takes effect when the session model is set to “Smart Router”, does not take over existing provider routing, and can coexist with other vision plugins.