dsh-model-router

DSH PLUGIN模型与账号接入

仓库 chillBnetley/dsh-model-router · npm dsh-model-router

模型与账号接入 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

为 DeepSeek Harness 提供按问题类型感知的模型路由,自动把每轮对话分派给最合适的模型,研究类任务优先正确性、闲聊优先免费模型。

验证等级 L5 L5 · 运行验证通过
GitHub 星标 2 复刻 0 · 未关闭 issue 0
最近更新 2026-10-06 创建于 2026-10-06
README 8.6 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:chillBnetley/dsh-model-router
兼容 DSH 版本0.2.0-rc.2版本不匹配时安装会报错
Node.js 要求>=20来自仓库 package.json 的 engines 字段
前置依赖@deepseek-ai/cordis@>=4.0.0需要同时安装的同级依赖
npm 包名dsh-model-router可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-model-router:为 DeepSeek Harness 按问题类型分派模型的 DSH plugin

  • 按任务类型自动分派模型
  • 质量优先与成本优先策略
  • 工具调用轮次硬性安全规则
  • 限流路由自动冷却
  • 闲聊专用语气提示段

适用场景

智能体编排

上游标签

deepseek-harnessdsh-pluginllm-routingmodel-router

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-09): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

仓库档案

模型与账号接入
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方chillBnetley仓库 dsh-model-router · 默认分支 main
分类模型与账号接入ai
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue2 / 0 / 0收录时的数值,非实时
创建 / 更新2026-10-06 · 2026-10-06最后推送 2026-10-06
本站收录2026-10-06首次进入本站目录的时间

README 全文

8.6 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-model-router

Question-type-aware model routing for DeepSeek Harness.

Instead of one model answering everything, the router classifies each turn and
re-dispatches it to the model that fits — correctness first for research work,
free models first for small talk.

Install

git clone https://github.com//dsh-model-router.git
cp -r dsh-model-router ~/.dsh/plugins/

Then list dsh-model-router in dsh.profile.bundles in your profile's
cordis.patch.yml. The plugin contributes its own config: block — see
cordis.patch.yml for the annotated defaults.

Start with dryRun: true. The router then only logs what it would pick and
changes nothing, so you can watch it against your own catalogue before letting it
move real traffic.

How it decides

Task kind Objective
coding, math_reasoning, learning_tutor, knowledge_qa, agentic_tools quality-first: the highest-rated model wins outright; price only breaks ties among equally-rated candidates
daily_chat efficiency-first: any model clearing the score floor is acceptable, and among those the free ones win
writing_literature, translation, long_context near-best (within maxScoreDrop of the top), then cheapest

Hard rules, independent of the above:

  • Grok is barred from every turn that executes a task. On the configured
    gateway it never receives tool schemas, so it may only serve the types listed
    under grok.allowedTypes (default: small talk) and never a turn carrying tool
    activity or an action request.
  • Unknown is not a guess. A model with no capability record, or whose tool
    support is unknown on a tool-executing turn, is excluded; if nothing
    qualifies the request is routed to fallback — or left untouched when no
    fallback is configured and live.
  • Rate-limited routes cool down instead of being retried every turn.
  • Auxiliary calls are never routed. Session-title and compaction requests
    carry a purpose and keep the model the harness chose, because their output
    format is contractual. respectPurpose: false disables this.
  • Pinned models can be exempted. respectModels: ["provider/model"] makes
    routing leave those requests alone — the escape hatch for a subagent whose
    model is pinned by agentOptions.

Small-talk tone

maxTokens bounds small-talk length at the wire level, but tone needs a prompt.
The plugin contributes one system-prompt section (model-router:chitchat-style)
that renders only on small-talk turns; on every other turn it renders empty
and is dropped, so those prompts are byte-identical to one assembled without
this plugin.

Turn correlation is exact rather than bookkeeping: the assembly hook's scope
is the Agent, and an Agent exposes .session, so the latest genuine user
message is read straight off the session (plugin-authored context and tool
results are skipped — they are user-role messages too).

⚠️ A section that toggles turn to turn changes the system-prompt prefix, which
is what a prompt cache keys on. Set chitchatStyle.enabled: false if cache
reuse matters more than tone.

Subagents and agent teams

Both keep working: the router swaps which model serves a stream and nothing
else. Spawning, the team task board, messaging, tool exposure and the
subagent/teammate model selection are all untouched.

Every llm/stream call is routed, including a child agent's own turns — so a
subagent doing code gets a coding model. A child's selection is inherited from
its parent (or pinned by agentOptions); use respectModels to protect a pin.

Mechanism

It hooks the llm/stream waterfall — the seam the harness documents as where
provider/model routing is replaced — and returns a new request envelope.
The incoming request is never mutated: loop-built requests are deep-frozen and
their content is a pure function of the session log.

Configuration

Everything lives in the profile's cordis.patch.yml under this plugin's
config:. See cordis.patch.yml for the annotated defaults.

Useful switches:

  • dryRun: true — log what it would pick and change nothing. Do this first.
  • enabled: false — leave every request exactly as the caller built it.
  • chunk limits: chitchatMaxTokens bounds small-talk output at the wire level.

工作 / 闲聊 mode

A user-selected override steers the whole turn, independent of the task type:

  • work (default) — the type-based policy above, unchanged.
  • chat — free models first: Space Bunny Free is preferred, then the rest of
    the free pool; a genuinely hard question (not a tool-executing turn) may
    escalate to Grok for reasoning.

Mode is per-session. The composer's ⚡ 工作 / 闲聊 toggle (in the model-selector
row) writes it; /mode (or /mode work|chat) shows or sets it. Three sources
keep it reliable, in precedence order:

  1. data/modes.json — the plugin's own map, written by /mode and read by
    the router on every turn. This is the source routing trusts, so a switch
    applies on the very next turn and survives a restart.
  2. the model-router/mode session event — appended by /mode as the
    semantic record in the session log, and read back for a session whose mode
    predates the state file.
  3. defaultMode — the value a session uses before it has ever been toggled.

stateFile overrides where that map lives (the tests point it at a temp file),
and chat.preferred.id names the free model chat mode prefers first.

The state file exists because reading the mode back out of the session log at
route time is not dependable: resolving the live session for a turn can miss, and
a miss is silent — the mode simply stays at its default even though the write
itself succeeded. Routing therefore never depends on that read.

Reflecting the routed model

When the router picks a different model, it writes that pick back into the
session's durable model selection, so the composer's model seat switches to the
model that actually served the turn
— you can see what answered you.
reflectModel: false disables this and leaves the selection untouched.

Inspecting a decision

/route prints the last decision: the classified kind, its confidence, whether
tools were required, the mode in effect, what the caller asked for, what was
chosen, and why.

Data

data/capabilities.json is the capability matrix the policy reads: per model,
nine task ratings with their source URL and confidence, price, modality, and
measured facts (reachability, tool calling, time-to-first-token) from live
probing. tools/ holds the probes that produced it; tools/validate-profile.mjs
checks a profile's provider section against the adapter's own schema.

Capability confidence is uneven by nature: vendor benchmark figures are high,
tier inference anchored on metadata is low, and unverifiable ids are unknown.
translation is almost entirely unmeasured and should not be routed on.

The matrix is a snapshot and ages; the router warns at boot past
maxMatrixAgeDays. To re-measure it against your own gateways, copy
gateways.local.json.example to gateways.local.json and list the endpoints you
want probed:

[{ "route": "my-gateway", "base": "https://api.example.com/v1", "keyEnv": "MY_GATEWAY_API_KEY" }]

keyEnv names a key in ~/.dsh/.credentials.yaml, so no credential is ever
written into this repository. Then node tools/probe-catalog.mjs and rebuild with
node tools/build-capabilities.mjs.

What is deliberately not in this repository

The router writes and reads state that identifies your usage, and probing needs
to know which services you pay for. None of it is tracked:

File What it holds
data/modes.json session ID → work/chat
data/diagnostics.log every routing decision, timestamped
data/probe-*.json, data/research-*.json raw gateway responses and catalogue dumps
gateways.local.json your gateway endpoints and the credential each one uses

All are covered by .gitignore and are created on demand at runtime.

Tests

node --test test/*.test.mjs

Roughly 100 tests: classifier behaviour, every policy rule above, and an
integration suite that mounts the real plugin into a real cordis context and
asserts actual dispatch decisions. Two mode-e2e cases covering restore-from-
session-log are currently red — they fail on the author's machine too and are
unrelated to routing.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-model-router 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:chillBnetley/dsh-model-router` 即可。对应的 npm 包名是 `dsh-model-router`。

dsh-model-router 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-model-router 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-model-router 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2。

dsh-model-router 需要什么运行环境?

Node.js >=20;需要同时安装 @deepseek-ai/cordis@>=4.0.0。环境不满足时安装会失败,建议先确认本机版本。

dsh-model-router 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-model-router 有哪些功能?

按任务类型自动分派模型、质量优先与成本优先策略、工具调用轮次硬性安全规则、限流路由自动冷却、闲聊专用语气提示段。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
模型与账号接入
按星标排序,可作替代方案

archify

archify

从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。

L4 · 沙盒安装通过 8.0 万 星

nocobase

nocobase

L3 · 安装规范通过 2.5 万 星

dsh-our-free-model

dsh-our-free-model

为 DeepSeek Harness 挂载免登录、免 API Key 的免费前沿模型通道,装完即用,并附用量看板与 OpenAI 兼容本地转

未标注验证等级 8,064 星

dsh-purge

dsh-purge

dsh-purge 是一款 DeepSeek Harness 设置插件,可修改默认副本、权限策略和工具限制,并添加规则卡片以分组应用补丁,支

L5 · 运行验证通过 4,573 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-09。