zhanghao3693/dsh-llm-router ↗★ 0
dsh-llm-router
Task-aware automatic model router (auto route) for the DeepSeek Harness: picks a backend model per request (vision / long-context / default) and falls back across configured models on clean pre-content failures. 适合拥有多个API渠道、需要根据任务自动分发并保证高可用的用户。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zhanghao3693/dsh-llm-routerREADME
Read the full README ↗⚠️ 安装后必须做的事:配置你自己的后端
默认配置里的 provider 名是作者本机环境的,别人装了不一定存在。 不改配置就使用,大概率路由失败(找不到对应 provider)。
在你的 profile patch 层覆盖(~/.dsh/profiles/ /cordis.patch.yml):
- id: llm-router
config:
defaultBackend:
provider:
model:
visionBackend:
provider:
model:
longContextBackend:
provider:
model:
fallbacks:
- provider:
model:
- provider:
model:
完整可配项与默认值:
| 字段 | 默认值 | 说明 |
|---|---|---|
defaultBackend | deepseek-official / deepseek-v4-pro | 常规请求 |
visionBackend | zai-coding-cn / glm-5v-turbo | 含图请求(不回退,见下) |
longContextBackend | longcat / LongCat-2.0 | 超长输入 |
longContextCharThreshold | 200000 | 触发长上下文的字符数 |
fallbacks | 6 项(kimi / 智谱 / MiniMax / LongCat) | 回退链 |
advertisedContextWindow | 1000000 | 对外宣称的上下文窗口 |
defaultReasoningEffort | high | 默认推理档位 |
视觉请求刻意不回退 —— 链上只有 visionBackend 一个候选。原因是其他后端不接图片,
回退过去只会拿到一个含义不同的报错,不如让失败原因直白。