john-walks-slow/dsh-set-model
Per-agent model switching for DeepSeek Harness: set_model / list_models agent tools with provider whitelist and token-budget guardrails, plus plan-mode model staging and cache-safe active-model context.
Project Overview项目介绍
dsh-set-model is a purpose-built DeepSeek Harness plugin (a cordis plugin targeting DSH 0.1.2-rc.1) that gives the root Agent two tools — set_model({ provider?, model?, reasoningEffort?, reason }) and list_models({ provider? }) — so it can autonomously switch provider, model and reasoning effort by task difficulty, with reason required because each switch invalidates the session KV cache. The plugin writes model/selection events into the session (the same channel used by the GUI model selector, so the Web UI state stays in sync), and appends one cache-safe line to the Runtime Context snapshot each step, such as [Current active model: deepseek/deepseek-chat · reasoning: low] or, in Plan mode, [Current active model: deepseek/deepseek-reasoner · reasoning: high] [Plan Mode Active], letting the model self-check without an extra tool call.
It is intended for users who want the Agent to keep cheap high-throughput settings for routine work yet escalate to a high-reasoning model such as deepseek-reasoner when facing hard concurrent or multi-step reasoning tasks, with no manual config toggling in between. Plan mode handles the escalation automatically: on /plan on the plugin snapshots the current daily model and switches to the configured planModel; on exit_plan_mode approval or /plan off it restores the original model when autoRestorePlanModel is true (default), and any failure only emits a warn, never interrupting the step. Installation is dsh plugin --profile web add dsh-set-model, or add github:john-walks-slow/dsh-set-model for source, where the first run is intercepted by pnpm ≥10 and the prompted package must be added to ~/.dsh/profiles/web/pnpm-workspace.yaml under allowBuilds before rerunning.
Dependencies are pinned to @deepseek-ai/cordis 4.0.2, @deepseek-ai/dsh-agent, dsh-llm, dsh-session, dsh-tools 0.1.2-rc.1, zod ^3.24.2, and Node ≥ 22.5; the plugin performs no external network calls and no direct filesystem writes, routing all model resolution through DSH core ctx.llm.resolveCallConfig. Safety guardrails reject switches when the session token pressure exceeds the target model contextWindow (prompting the user to compact, e.g. via clear_mind), honour the allowedProviders whitelist, validate every candidate combination through DSH's adapter registry, and restrict the tools to the root Agent only — set enableAgentTools: false to disable them globally. License is MIT; local dev is npm install && npm run build && npm test, and releases run npm run release followed by the WebAuthn fingerprint script, with npm view dsh-set-model version as the post-publish check.
dsh-set-model 是为 DeepSeek Harness(DSH / cordis plugin)打造的动态模型与思考深度切换插件,通过 set_model 与 list_models 两个工具让根 Agent 按任务难度自主切换 provider、model 与 reasoningEffort,并把当前活跃模型以 cache-safe 追加方式注入 Runtime Context 快照尾部,供模型随时自查。插件通过 model/selection 事件写入会话,与 Web UI 模型选择器复用同一机制,切换自下一个 step 生效;进入 Plan 模式自动升至 planModel,退出后按 autoRestorePlanModel(默认开启)恢复原模型,全程零人工干预。
典型场景是日常任务保持高性价比档位,遇到疑难并发或多步推理时一键升级到 deepseek-reasoner 等高智力档位。安装仅需 dsh plugin --profile web add dsh-set-model 或从 GitHub 源码 add github:john-walks-slow/dsh-set-model;首次 pnpm ≥10 会被拦截,需把构建包名加入 ~/.dsh/profiles/web/pnpm-workspace.yaml 的 allowBuilds 后重跑。配置通过 Settings 命名空间 dsh-set-model 在 Web Settings UI 实时生效,支持 allowedProviders 白名单、enableAgentTools: false 关闭工具以及仅根 Agent 注册。
依赖 @deepseek-ai/cordis 4.0.2、@deepseek-ai/dsh-agent、dsh-llm、dsh-session、dsh-tools 0.1.2-rc.1(与 dsh 0.1.2-rc.1 锁定对齐)、zod ^3.24.2,Node ≥ 22.5,无外部网络请求与文件系统写入。当会话 token 水位超过目标模型 contextWindow 时切换被拒并提示先压缩上下文(如 clear_mind);自动切换失败仅 warn 降级,工具校验失败返回明确错误。License 为 MIT,开发使用 npm install && npm run build && npm test,发版通过 npm run release 打包后用 WebAuthn 指纹脚本发布。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-set-model(john-walks-slow/dsh-set-model)
仓库:https://github.com/john-walks-slow/dsh-set-model
本站详情页:https://www.yhbd.top/plugins/john-walks-slow-dsh-set-model/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-17 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-set-model
把 john-walks-slow/dsh-set-model 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-set-model
为 DeepSeek Harness(DSH / cordis plugin)提供动态模型与思考深度切换的插件:Agent 通过 set_model / list_models 工具按任务难度自主切换 provider、model 与 reasoningEffort,插件把活跃模型注入运行时上下文,并随 Plan 模式自动升降级模型。
攻坚疑难问题时升到高推理档位,日常执行保持高性价比档位——不再需要用户手动改配置。
模型看到什么
插件通过 systemPrompt.context 在每个 step 的 Runtime Context 快照尾部注入一行当前活跃模型(cache-safe 追加,模型随时自查、无需调用工具):
[Current active model: deepseek/deepseek-chat · reasoning: low]
处于 Plan 模式时附带状态标记:
[Current active model: deepseek/deepseek-reasoner · reasoning: high] [Plan Mode Active]
工具:set_model
set_model({ provider?, model?, reasoningEffort?, reason }) —— reason 必填(每次切换都会使会话 KV cache 失效,工具说明要求 Agent 给出理由、避免频繁切换):
{ "model": "deepseek-reasoner", "reasoningEffort": "high", "reason": "疑难并发问题排查,需要深度推理" }
工具返回:
Model successfully switched to deepseek/deepseek-reasoner · reasoning: high. Effective from the next step.
Reason: 疑难并发问题排查,需要深度推理
工具:list_models
list_models({ provider? }) 列出已注册 Providers 与模型能力(推理档位、上下文窗口):
# Available Providers & Models:
## Provider: deepseek
- **deepseek-reasoner** (DeepSeek Reasoner) | Reasoning: [low, high, max] | Context: 128000
- **deepseek-chat** (DeepSeek Chat) | Context: 128000
切换自下一个 step 生效:插件向会话写入 model/selection 事件(与 GUI 模型选择器同一机制),Web UI 状态同步。
Plan 模式自动升降级
插件监听 agent/pre-step 的 Plan 投影状态变迁,零人工干预:
- 进入 Plan 模式(
/plan on):暂存当前日常模型,自动切换到配置的planModel(高智力规划模型); - 退出 Plan 模式(
exit_plan_mode批准 //plan off):自动恢复进入前的日常模型(autoRestorePlanModel,默认开启); - 自动切换失败仅 warn 降级,绝不打断 step。
安全护栏
Provider 白名单:
allowedProviders非空时,白名单外的切换请求直接拒绝;上下文窗口护栏:当前会话 token 水位超过目标模型 contextWindow 时拒绝切换,并提示先压缩上下文(如 clear_mind):
Current session token pressure (70000 tokens) exceeds target model context window (65536 tokens). Please compact context (e.g. clear_mind) before switching to this model.路由校验:候选组合经 DSH 核心
ctx.llm.resolveCallConfig校验(provider 适配器存在、模型合法、reasoningEffort 受支持),非法组合返回明确错误,不写入任何会话状态;仅根 Agent:工具只注册给根 Agent(subagent 不提供自主调模);
enableAgentTools: false可整体关闭。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
SpookySandwich/dsh-plugin-rollout-scout
kenryu42/cc-safety-net
PerryLink/dsh-auto-review
wenbin-wb/dsh-bridge
PerryLink/dsh-permission-rules
MichengAI/dsh-archive-manager
eri64/dsh-claude-ux