BruceLanLan/dsh-tier-router ↗★ 1
dsh-tier-router
Tiered model routing for DeepSeek Harness: a strong tier for planning/architecture/review, a cheap tier for implementation, with plan-mode-aware auto routing, advisor/review consultations, a high-impact escalation guard, failure auto-escalation, durable tier configuration, and subagent tiering.
AI 分析
核心用途是实现多模型分层自动路由。适合需要平衡大模型规划能力与执行成本的用户,通过将规划与执行任务分流至不同档次模型来优化开销。需在 agent preset 中进行组合配置。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:BruceLanLan/dsh-tier-routerドキュメント
README 全文を読む ↗Usage
Slash commands (typed in the composer; they affect only the current session)
/advisor # one strong-tier consultation
/tier status # routing state, escalation state, diagnostics
/tier strong | cheap # force one tier for this session (optionally persist as session default)
/tier auto # restore auto for this session (plan -> strong, execution -> cheap)
/tier off # disable routing for this session, restore its default model (other sessions unaffected)
/tier plan # auto + enter plan mode, apply the strong header immediately
/tier models # list registered providers and their models
/tier set
[effort]
/tier subagent # policy used to classify subagent execution (guard)
/tier review # strong-tier review
Sample output (/tier status):
Tiered model routing
mode: global=auto, this session=auto (per-session via /tier strong|cheap|auto|off; escalate: 2 errors / 60s window -> 180s strong)
strong: deepseek-official/deepseek-v4-pro (max)
cheap: deepseek-official/deepseek-v4-flash (high)
subagents: inherit
diag: requestSteps=42 guardChecks=31 guardDenies=3 headerWrites=4 errorsSeen=0 escalations=0
session default: deepseek-official/deepseek-v4-pro (max)
providers: deepseek-official, opencode-go, minimax
Model tools (called by the model when needed)
| Tool | Purpose |
|---|---|
tier_advisor | Strong-tier consultation: one question + evidence -> advice / risks / acceptance criteria |
tier_review | Strong-tier review: change set + validation results -> verdict with ranked issues |
tier_route | Set this session's tier (strong/cheap/auto/off, optionally persisted) |
tier_configure | Reconfigure either tier's provider/model/effort and the subagent policy |
tier_worker | Dispatch a bounded task packet to a subagent on a chosen tier; supports outputSchema / toolFilter / maxDepth / persona |
tier_status | Read-only diagnostics: global & session tiers, escalation state, listener counters, effective tier |
Configuration
Runtime configuration (no restart needed):
/tier set strong deepseek-official deepseek-v4-pro max
/tier set cheap deepseek-official deepseek-v4-flash high
/tier set and tier_configure persist the tier configuration in the tier-router
settings namespace (survives restarts; pass sessionOnly: true for a transient change).
tier_route strong|cheap scopes to the current session and does NOT persist by default;
pass persist: true to also write the session default model (agent-default-model).
Failure auto-escalation parameters (threshold / window / TTL) are currently built-in
constants; configurable in a later version.