前言¶
在 DeepSeek Harness(DSH)环境里,一个 bundle 行通常配置多个模型。成本与路由类插件只能告诉你「已经发生了什么」,比如调用记录、路由结果。但在切换模型之前,更关心的是「这批模型里哪些是真正免费的」。dsh-plugin-free-model-advisor 针对这个问题,只做静态检查:读取你当前 bundle 的 models 配置,给出哪些是免费、哪些未知、以及一个安全的默认推荐。它不会修改任何配置,也不会发起网络请求。
是什么¶
dsh-plugin-free-model-advisor 是一个 DSH 插件,提供只读的 /free-models 命令,列出已配置的模型并给出默认推荐。插件由 SSHOOTING 维护,属于「模型推理」分类。它严格遵循 DSH 的「一切皆插件」理念,不改变配置、不访问网络、不调用模型。
核心功能¶
- 列出已配置的模型及其状态
- 判断每个模型是否为
FREE - 推荐一个默认模型
- 输出机器可读的 JSON(
/free-models --json)
安装与启用¶
在 DSH 终端执行:
dsh plugin --profile web add dsh-plugin-free-model-advisor
安装完成后重启 DSH,即可使用 /free-models 命令。
典型用法¶
- 安装插件并重启 DSH。
- 在任意会话中输入
/free-models。 - 获得简洁的清单:
[free-models] 2/2 configured models are FREE
opencode-go/hy4-flash-free ctx 1,048,576 FREE
opencode-go/longcat-2.5-free ctx 1,000,000 FREE
Recommended default: opencode-go/hy4-flash-free
Hint: Set your default model to opencode-go/hy4-flash-free (free). Configure via cordis.patch.yml, or install with `dsh plugin --profile web add dsh-plugin-free-model-advisor`.
若某个配置的模型无法验证为免费:
[free-models] 1/3 configured models are FREE
opencode-go/hy4-flash-free ctx 1,048,576 FREE
opencode-go/longcat-2.5-free ctx 1,000,000 FREE
deepseek-official/deepseek-v4-pro UNKNOWN
Recommended default: opencode-go/hy4-flash-free
Hint: Set your default model to opencode-go/hy4-flash-free (free). Configure via cordis.patch.yml, or install with `dsh plugin --profile web add dsh-plugin-free-model-advisor`.
使用 /free-models --json 获取机器可读输出,适合 CI、脚本与仪表盘。
模型被标记为 FREE 的条件¶
模型被分类为 FREE 仅当满足以下任一条件:
- 在配置中显式标记
free: true,或 id以-free结尾,且provider缺失或为opencode-go。
其他情况均为 UNKNOWN。插件不假设任何模型免费,未知模型不会被推荐。内置目录仅包含 opencode-go/hy4-flash-free(上下文窗口 1,048,576)和 opencode-go/longcat-2.5-free(上下文窗口 1,000,000),不打包付费模型。
配置方式¶
插件通过 bundle 行的 config.models 扩展免费模型清单。在 cordis.patch.yml 中编辑该 bundle 行:
- id: dsh-plugin-free-model-advisor
name: dsh-plugin-free-model-advisor
config:
models:
- id: hy4-flash-free
provider: opencode-go
contextWindow: 1048576
free: true
- id: longcat-2.5-free
provider: opencode-go
contextWindow: 1000000
free: true
models 可以是列表或以 id 为键的映射:
models:
opencode-go/hy4-flash-free:
contextWindow: 1048576
free: true
支持的配置字段:
| 字段 | 类型 | 说明 |
|---|---|---|
models |
数组或映射 | 模型描述。缺失、为空或格式错误时,使用默认免费目录。 |
models[].id |
字符串 | 模型 id,必填;无 id 的条目会被跳过。 |
models[].provider |
字符串 | 可选提供者;仅 opencode-go(或缺失)与以 -free 结尾的 id 配合时才被判定为免费。 |
models[].contextWindow |
非负整数 | 可选,在报告与 JSON 中显示。 |
models[].maxTokens |
非负整数 | 可选,仅在 JSON 中显示。 |
models[].free |
布尔值 | 仅字面量 true 为显式免费标记。 |
插件只读取上述已知字段,其他字段会被忽略且不序列化。
适用场景与注意事项¶
- 适合需要提前确认模型成本、在切换前做决策的场景。
- 插件以当前 DSH 进程的权限运行,安装前建议检查源码与许可证(MIT)。
- 不会发起网络请求、写入文件或修改配置。
- 配置错误时不会抛出异常,而是使用安全默认目录并给出提示。
短结尾¶
dsh-plugin-free-model-advisor 让你在不触碰配置的情况下,快速掌握已配置模型的免费状态与默认推荐。如果你正在管理多个模型并关注成本与安全,这个只读顾问插件可以减少试错成本。
目录页:https://www.skillhub.cn/plugins/SSHOOTING/dsh-plugin-free-model-advisor
GitHub:https://github.com/SSHOOTING/dsh-plugin-free-model-advisor