Introduction¶
DSH’s plugin mechanism allows model selection, commands, settings, and tools to be made into composable modules. For agent developers, the common question is not “can I call the model,” but rather which models should be used for routine turns versus critical turns.
dsh-shift-router is a DSH plugin maintained by green-dalii used to route between two-level model chains of fast and smart, and includes LLM Judge, fallback, failover, and task orchestration. Below is an introduction to its positioning, capabilities, installation methods, and notes.
What is This¶
dsh-shift-router is a two-level model routing plugin: it performs classification and routing selection before the top-level agent of every round, directing the request into the corresponding model chain and executing it through DSH’s agent/request pipeline.
Current verifiable information includes:
- Plugin name:
green-dalii/dsh-shift-router - License: MIT
- Package version:
0.5.0 - Node requirement:
>=22.0.0
Core Features¶
Judge Grading¶
Before the top-level agent of every round, the LLM Judge classifies the user message into fast or smart. The Judge is only responsible for classification, not executing the task. The classification result drives the entire round’s request through DSH’s agent/request pipeline.
The upgrade strategy is “instant upgrade, trend downgrade”: one smart determination immediately switches to the strong model layer; returning to fast requires a sliding window majority, with a default window of 5 rounds and a ratio not lower than 60%, while low-confidence votes are ignored.
Cache-Aware Routing¶
When fast and smart share a provider, the plugin raises the downgrade threshold to 0.9 and pauses switching when the prompt cache is hot, avoiding paying extra costs just to switch to a cheaper model.
Runtime Failover¶
When encountering 429, 5xx, or quota failures, the corresponding model enters exponential backoff cooling:
1m → 4m → 16m → 1h → 6h cap
Client-side limits start cooling at 16m.
Failover re-routes to a healthy model within the same layer, not across layers.
Task-Level Orchestration¶
Complex tasks are planned by the smart layer as CTO, delegated to fast layer engineer subagents, reviewed, and iterated.
Hard limits are enforced by the plugin; when the limit is reached, the subagent tool will be rejected.
Cost Telemetry¶
The plugin tracks tokens and throughput by tier, with optional USD price table configuration. Use /router stats to view session cost information.
Installation and Activation¶
First, confirm that the environment meets Node >=22.0.0.
Use the git install command to add the plugin:
dsh plugin --profile <name> add github:green-dalii/dsh-shift-router
This installation method relies on the package’s prepare script to build dist. If using pnpm >=10, it will reject prepare scripts for git dependencies by default. You can add this to the profile’s pnpm-workspace.yaml:
allowBuilds:
dsh-shift-router: true
Then re-execute the add command; alternatively, check out the source code and run:
npm run build
The plugin can load without configuration, and all default values are safe. Before configuring tiers, the plugin behavior is a no-op; after configuring tiers, routing takes effect. Tier models can come from the GUI settings panel or profile patch row.
Typical Usage¶
There are two entry points for configuration:
- Open
Settings → Plugins → Plugin configurationin the GUI and find theShift-Routercard. - Use the
/router configcommand to edit the shift-router settings namespace.
routing.mode has three optional values:
auto: The default value, enables judge, routing, failover, and orchestration.manual: Does not enable judge, only uses/route-forcefor explicit override.off: Model selection is completely passive, but commands and telemetry are still available.
Viewing costs:
/router stats
Regarding Hot Module Replacement (HMR):
- Config changes can be hot-loaded by editing the profile patch.
- External plugin code changes currently require a profile restart.
- The official Web bundle defaults to disabling HMR. If HMR is needed, you can set it in the profile patch:
- id: hmr
disabled: false
Applicable Scenarios and Notes¶
Suitable for developers using DSH, especially those who want to satisfy the following:
- Routine turns use lower cost models, while critical turns switch to stronger models.
- Need multi-model fallback and same-layer failover.
- Need to view tokens, throughput, and optional costs by tier.
- Need simple task orchestration and plugin enforcement of task limits.
Notes:
- The plugin runs with the current dsh process permissions; check the source code and license before installing.
- Does not actively route before configuring tiers.
- Failover does not cross layers.
- Under pnpm
>=10, explicit allowance for build scripts is required, or use source code build. - Code changes cannot rely on hot loading to take effect.