前言¶
DeepSeek Harness(DSH)在判断模型能否接收图片时,只看模型声明的输入模态。当使用阿里百炼 Token Plan 路由(https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1)时,即使模型在百炼侧明确支持视觉,如果 DSH 目录中缺少该模型或缺少输入模态声明,插件就会按纯文本处理,导致图片请求被宿主拒绝,提示「当前模型不支持图片」。
dsh-bailian-model-catalog 是一个 DSH 插件,旨在为阿里百炼 Token Plan 路由补齐模型目录与输入模态,让支持视觉理解的模型能够正确声明 [text, image],从而通过图片请求。
核心功能¶
- 补齐 pi-ai 目录:把官方能力表中 DSH 目录里缺失的模型补进
qwen-token-plan-cn的 shipped catalog 对象;对已有模型,补充其漏掉的输入模态。 - 在读取期叠加元数据:适配器在
apply()阶段已将路由物化成快照,插件无法再改写目录数据。因此插件在读取期(ModelsImpl.getModels)按路由名叠加input、contextWindow、maxTokens、compat、reasoning等元数据,卸载时还原。 - 允许借用目录:你可以通过配置,将自己定义的路由名(如
aliyun)借用这份模型目录。
安装与启用¶
从 npm 安装:
dsh plugin --profile <你的 profile> add dsh-bailian-model-catalog
从 GitHub 安装(插件市场收录前可直接使用):
dsh plugin --profile <profile> add github:liudengxing/dsh-bailian-model-catalog
本地开发时使用 link: 前缀,改代码后立即生效:
dsh plugin --profile <profile> add "link:/absolute/path/to/dsh-bailian-model-catalog"
安装后,适配器在下一次请求时重读配置,插件在读取期叠加元数据即可生效,无需重启。
典型用法¶
情况 A:路由名就叫 qwen-token-plan-cn¶
零配置,装上即可。
情况 B:路由名是你自己起的(例如 aliyun)¶
需要在路由级写明 api(否则适配器无法推断协议,会报 needs an api),并让插件把目录借给这个路由:
- id: llm-pi-ai
name: "@deepseek-ai/dsh-llm-pi-ai"
config:
providers:
aliyun:
displayName: 阿里百炼 · Token Plan
apiKeyEnv: ALIYUN_API_KEY
api: openai-completions
baseURL: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
models:
- id: deepseek-v4.1-flash-1017
- id: qwen4-max
- id: bailian-catalog
config:
routes:
aliyun: qwen-token-plan-cn
全量配置项¶
| 字段 | 默认值 | 说明 |
|---|---|---|
routes |
{ qwen-token-plan-cn: qwen-token-plan-cn } |
路由名 → 借用哪份 shipped catalog(pi-ai 里的 provider 名) |
exclude |
[] |
不让插件插手的模型 id |
覆盖的模型¶
插件为以下模型补齐了输入模态或目录条目(以官方文档能力为准):
- 视觉理解(
text, image):qwen4-max、qwen4-max-preview、qwen3.8-max、qwen3.8-flash、qwen3.7-plus、qwen3.6-flash、deepseek-v4.1-flash、deepseek-v4.1-flash-1017 - 纯文本:
qwen3.7-max、glm-5.3、glm-5.2、deepseek-v4-pro、deepseek-v4-pro-0813、deepseek-v4-flash-0731、auto、decision-model-preview
适用场景与注意¶
- 适合使用阿里百炼 Token Plan 路由、需要让多模态模型通过图片请求的开发者。
- 插件以当前 DSH 进程权限运行,安装前建议阅读源码与许可证(MIT)。
- 插件依赖
ModelsImpl.getModels的内部形状,若 DSH 内部接口变更,插件会退化成「只写目录」,需等待 profile 重新解析配置才能看到效果。 - 非同一家族的模型只补输入模态,不继承其他模型的
maxTokens/compat,避免跨厂商请求参数错误。 - 目录中已存在的模型不会被修改;
qwen4-max-preview已于 2026-11-25 下线,但官方说明原 ID 仍可正常调用并路由至qwen4-max,因此仍按视觉模型声明,以避免已用该 ID 的用户退回纯文本。
简短总结¶
dsh-bailian-model-catalog 通过在读取期叠加元数据,为阿里百炼 Token Plan 路由补齐模型目录与输入模态,让支持视觉的模型能够正确接收图片。它不注册 provider 路由,也不接管适配器,只做两件事:给 pi-ai 目录写条目、在读取期叠加元数据。
- 目录页:https://www.skillhub.cn/plugins/liudengxing/dsh-bailian-model-catalog
- GitHub:https://github.com/liudengxing/dsh-bailian-model-catalog