AL-spiritphoenix/dsh-auto-model ↗★ 0
dsh-auto-model
Auto model selection for DeepSeek Harness: routes each turn to V4 Flash or V4 Pro through a classifier call
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AL-spiritphoenix/dsh-auto-model说明文档
阅读完整 README ↗dsh-auto-model
English | 中文
一个 DeepSeek Harness 组合包,用于添加 Auto 模型选项。会话选中 auto 时,插件会用一次轻量 Flash 调用对每轮任务分类,再路由到 deepseek-v4-flash(SIMPLE)或 deepseek-v4-pro(COMPLEX)。
这是纯 JavaScript 组合包,可直接从 git 主机安装,无需构建步骤。它只使用已发布的核心 API,可在未修改的 harness 上运行。
安装
安装到 web profile(即 dsh web 命令启动的 profile):
本地检出:
dsh plugin --profile web add ./dsh-auto-model
从 GitHub:
dsh plugin --profile web add github:AL-spiritphoenix/dsh-auto-model
然后启动:
dsh web
dsh web 是 web profile 的别名,无需再传 --profile。模型选择器现在会在 Flash 与 Pro 旁列出 Auto。路由器选中的具体模型会写入会话日志中每条请求的 header。
工作原理
- 插件注册自己的
deepseek-autoprovider 路由,其listModels()在运行时返回auto条目。因此该目录项不依赖llm-deepseek的models配置,settings.yaml覆盖无法将其隐藏。 - 插件监听根级
agent/requestwaterfall(在installModelSelection之外),在真正 dispatch 前将auto(不论由哪个 provider 携带)改写为具体的provider/model。 - 每轮的第一步向
classifierModel(默认使用 fast 模型)发起一次辅助分类调用;同一轮后续步骤复用该决定。调用失败时回退到onClassifierError(默认slow)。
配置
所有字段均为可选,默认对应 DeepSeek V4 这一对模型:
| 键 | 默认值 | 含义 |
|---|---|---|
provider | deepseek-official | 具体请求路由到的 provider。 |
model | auto | 展示并提交的虚拟模型 id;从不真正 dispatch。 |
providerName | DeepSeek(Auto) | 选择器中的分组标签。 |
name | Auto | 选择器中的模型标签。 |
description | (内置) |