fonlan/dsh-model-router ↗★ 1

@fonlan/dsh-model-router

提供虚拟模型路由,支持多服务商聚合、优先级排序与快速切换。 适合配置了多个 API 渠道,需要灵活调度和切换模型后端的复杂用户。

包名
@fonlan/dsh-model-router
兼容性
待验证
Harness 依赖范围
^0.1.2-alpha.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1
Cordis 依赖范围
^4.0.1
版本
0.3.9
许可证
MIT
最近更新
2026年10月6日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:fonlan/dsh-model-router

配置

路由配置持久化在 settings 文档的 model-router 命名空间(~/.dsh/settings.yaml):

model-router:
  showQuickSwitch: true   # 是否在模型选择菜单中显示提供商切换入口(默认 true)
  ignoreModelIdPrefix: true  # 匹配时忽略模型 ID 前缀(默认 true)
  modelSort: custom       # 模型显示顺序:custom | name | recent(默认 custom)
  modelOrder:             # custom 模式下的模型显示顺序(自动维护,无需手写)
    - deepseek-v4-flash
    - qwen3.7-max
  recentlyUsed:           # recent 模式使用:模型 id → 最后使用时间戳(自动维护)
    deepseek-v4-flash: 1787036509332
  models:
    deepseek-v4-flash:
      order:            # 优先级顺序(供后续自动切换使用)
        - opencode-go
        - deepseek-official
      active: opencode-go   # 当前实际使用的提供商

order 与 active 分开维护:点击切换只改 active,拖拽排序只改 order。modelOrder 与 recentlyUsed 由插件自动维护(modelSort: recent 时每次模型请求都会更新对应时间戳,防抖写入)。