r600a-code/dsh-swarm-router

DSH插件:子代理矩阵群 — 将异构任务路由至最适宜的模型(类OpenRouter + cfgpu.com/llm/square),并通过进程内子代理分发。32/32基准测试绿灯通过。

Project Overview项目介绍

This is a native DSH plugin that implements a sub-agent matrix swarm routing system for heterogeneous batch tasks. It matches each individual task to the best available model from public catalogs including cfgpu.com/llm/square and OpenRouter, then dispatches tasks in parallel as either in-process sub-agents bound to the selected model or direct ctx.llm calls. The core design goal is to match task difficulty to model capability, cutting costs and saving time by sending quick tasks to cheap/fast models and hard tasks to high-capability reasoning models. To install, you can run dsh plugin add github:r600a-code/dsh-swarm-router against your existing DSH installation.

The plugin ships with six built-in tools: swarm_route_preview for planning routing without dispatching, swarm_dispatch for parallel task execution, swarm_models for listing the registered model catalog, swarm_feedback for recording task outcomes, swarm_ranking for viewing accumulated performance rankings, and swarm_stats for checking token usage statistics. The routing process is fully deterministic and O(1) per task, requiring zero extra model calls to decide the best match. All routing decisions follow a clear 5-step process that filters models by capability, scores remaining candidates, applies tailored penalties based on model fit, and picks the highest scoring model for each task.

This plugin supports two model gateway providers: cfgpu and OpenRouter. You will need to add your API keys for each provider you want to use to your DSH_HOME/.credentials.yaml file; if a provider key is missing, that provider's models are marked as unavailable and will not be selected for routing, so the plugin will still load correctly even if only one provider is configured. The project is released under the permissive MIT license, accepts community contributions of new models via pull request, and includes benchmark test cases to verify that the plugin works as expected after installation.

这是一款原生 DeepSeek Harness (DSH) 插件,实现了子智能体矩阵蜂群路由系统。它可以将一批异构任务批量拆分,为每个任务从公开模型目录中匹配最适合的大语言模型,再以绑定对应模型的进程内子智能体或直接 LLM 调用的方式并行派发任务,按任务难度精准匹配模型能力,实现省时提效、合理控制使用成本。

插件提供了模型路由预览、任务派发、模型列表查询、结果反馈记录、模型排名查询和用量统计六个工具。用户只需要定义好一批带类型标记的待处理任务,插件会自动按规则完成任务类型推断、能力过滤、加权评分排序,最终选出得分最高的模型执行任务,非常适合多任务批量处理的开发者和团队使用。

插件支持cfgpu和OpenRouter两种模型路由,需要在DSH配置目录的凭证文件中配置对应API密钥才能使用,未配置密钥的路由会被自动标记为不可用不影响插件启动。项目采用MIT许可证开源,支持用户提交PR新增模型,附带基准测试用例可验证插件功能正确性。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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 headless add github:r600a-code/dsh-swarm-router

把 r600a-code/dsh-swarm-router 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-swarm-router

English | 中文

A DeepSeek Harness bundle that turns a batch of heterogeneous tasks into a sub-agent matrix swarm: it routes each task to the most suitable model from an OpenRouter-like gateway plus the cfgpu.com/llm/square catalog, then dispatches each assignment in parallel as a real in-process subagent (or a direct ctx.llm call) pinned to that model — quick tasks land on fast/cheap models, hard tasks on strong reasoning models. A formal design write-up lives in docs/PAPER.md.

子智能体矩阵蜂群:任务是行、候选模型是列,路由器为每一行选中一格,再通过 DSH 的 ctx.subagents 把每格变成一个绑定到所选模型的子智能体并行下放,按任务难度匹配模型、省时提效。论文见 docs/PAPER.zh.md。

The four contributions

Contribution What
① Model aggregation registry + PR flow models/registry.json is the canonical catalog; scripts/validate-registry.mjs enforces structure (CI-ready); CONTRIBUTING.md documents the add-a-model PR flow.
② Plugin extension point ctx.provide('swarmRouter', api) — other plugins inject: ['swarmRouter'] to register runtime models, custom task kinds, subscribe to feedback, read rankings/usage.
③ Real-task feedback + ranking swarm_feedback records {correct, quality 1-5}, persisted to rankings.json; swarm_ranking shows per-model/per-kind success rate & quality; proven models are boosted in routing, failing ones demoted.
④ Token-consumption statistics (cfgpu highlighted) direct mode captures exact per-call prompt/completion/total from ctx.llm.stream; subagent mode captures via a global llm/stream listener attributed by sessionId; persisted to usage.json; swarm_stats shows totals/byProvider/byModel/byKind + cfgpuHighlight.

Tools

Tool Mode Calls models?
swarm_route_preview — No (pure routing plan)
swarm_dispatch subagent (default) | direct Yes (parallel)
swarm_models — No (list registry)
swarm_feedback — No (records an outcome)
swarm_ranking — No (reads accumulated feedback)
swarm_stats — No (reads accumulated usage)

The router rules (how a task becomes a model)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-memory 下一个 Next dsh-model-modes →