green-dalii/dsh-shift-router ↗★ 1
dsh-shift-router
DeepSeek Harness 的双层模型路由器,支持基于 LLM 裁判的自动执行/判断路由、多模型备用链及指数退避容灾
AI 分析
核心用途是智能分流和模型容灾。适合需要根据任务复杂度自动在快速与智能模型间切换,并要求在接口故障时自动退避重试的高可用场景。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:green-dalii/dsh-shift-router說明文件
閱讀完整 README ↗Configuration
Configuration lives in the shift-router settings namespace: edit it in the GUI (Settings → shift-router), with /router config commands, or via the profile patch row. All fields have safe defaults.
| Field | Default | Description |
|---|---|---|
enabled | true | Master switch |
tiers.fast.models | [] | Fast-tier chain (provider/model + priority); also the Judge's model chain |
tiers.smart.models | [] | Smart-tier chain |
routing.mode | auto | auto (default): judge + routing + failover + orchestration; manual: no judge, only explicit /route-force overrides; off: fully passive for model selection (commands/telemetry still work) |
routing.judgeTimeout | 5000 | Judge call timeout (ms) |
routing.judgeMaxTokens | 4000 | Max output tokens for a single Judge call |
routing.judgePromptCap | 6000 | Max prompt characters sent to the Judge (bounds Judge cost) |
routing.window.size | 5 | Downgrade sliding window size |
routing.window.threshold | 0.6 | Fast-majority ratio required to downgrade |
routing.window.minConfidence | 0.5 | Ignore judge verdicts below this confidence |
routing.cacheAware.enabled | true | Same-provider cache protection |
routing.cacheAware.sameFamilyThreshold | 0.9 | Downgrade threshold when tiers share a provider |
routing.cacheAware.idleBoundaryMs | 300000 | Idle gap before a warm cache is considered cold |
orchestration.mode | auto | auto: complex → Smart CTO; off: plain two-tier routing |
orchestration.maxRounds | 3 | Delegate→review rounds hard cap (enforced: each subagent delegation counts one round; at the cap the subagent tool is denied) |
orchestration.escalationThreshold | 2 | Failed worker results before Smart must take over the phase (enforced: each isError subagent result counts) |
orchestration.requireSmartModel | true | Skip orchestration if the Smart model can't be resolved |
failover.baseMs | 60000 | Cooldown base delay for 5xx failures (1m) |
failover.maxMs | 21600000 | Hard cap on the backoff ladder (6h) |
failover.startAttempts4xx | 3 | 4xx (429/quota) failures start at this attempt (16m), client limits usually outlive server blips |
failover.speedWindowSize | 5 | Recent tokens/sec readings kept for the /router stats average |
telemetry.callLogCap | 1000 | Max per-message attribution records kept for baseline cost computation |
ux.routerLogVerbose | false | Print router decisions to the harness log |
pricing | [] | Optional {provider, model, input, output, cacheRead?, cacheWrite?} USD-per-1M-token table for cost telemetry |
All numeric fields are range-validated by the schema (e.g.
window.thresholdmust be in [0,1],window.sizea positive integer); invalid values are rejected at load / onset, never silently accepted.