green-dalii/dsh-shift-router1

dsh-shift-router

DeepSeek Harness 的双层模型路由器,支持基于 LLM 裁判的自动执行/判断路由、多模型备用链及指数退避容灾

AI 分析

核心用途是智能分流和模型容灾。适合需要根据任务复杂度自动在快速与智能模型间切换,并要求在接口故障时自动退避重试的高可用场景。

包名
dsh-shift-router
版本
0.2.0
许可证
MIT
最近更新
2026年8月14日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:green-dalii/dsh-shift-router

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.

FieldDefaultDescription
enabledtrueMaster switch
tiers.fast.models[]Fast-tier chain (provider/model + priority); also the Judge's model chain
tiers.smart.models[]Smart-tier chain
routing.modeautoauto (default): judge + routing + failover + orchestration; manual: no judge, only explicit /route-force overrides; off: fully passive for model selection (commands/telemetry still work)
routing.judgeTimeout5000Judge call timeout (ms)
routing.judgeMaxTokens4000Max output tokens for a single Judge call
routing.judgePromptCap6000Max prompt characters sent to the Judge (bounds Judge cost)
routing.window.size5Downgrade sliding window size
routing.window.threshold0.6Fast-majority ratio required to downgrade
routing.window.minConfidence0.5Ignore judge verdicts below this confidence
routing.cacheAware.enabledtrueSame-provider cache protection
routing.cacheAware.sameFamilyThreshold0.9Downgrade threshold when tiers share a provider
routing.cacheAware.idleBoundaryMs300000Idle gap before a warm cache is considered cold
orchestration.modeautoauto: complex → Smart CTO; off: plain two-tier routing
orchestration.maxRounds3Delegate→review rounds hard cap (enforced: each subagent delegation counts one round; at the cap the subagent tool is denied)
orchestration.escalationThreshold2Failed worker results before Smart must take over the phase (enforced: each isError subagent result counts)
orchestration.requireSmartModeltrueSkip orchestration if the Smart model can't be resolved
failover.baseMs60000Cooldown base delay for 5xx failures (1m)
failover.maxMs21600000Hard cap on the backoff ladder (6h)
failover.startAttempts4xx34xx (429/quota) failures start at this attempt (16m), client limits usually outlive server blips
failover.speedWindowSize5Recent tokens/sec readings kept for the /router stats average
telemetry.callLogCap1000Max per-message attribution records kept for baseline cost computation
ux.routerLogVerbosefalsePrint 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.threshold must be in [0,1], window.size a positive integer); invalid values are rejected at load / on set, never silently accepted.