DSH Hub

r600a-code/dsh-swarm-router

dsh-swarm-router

BundleWorkflow1 GitHub stars· updated 2026-08-16

DSH plugin: sub-agent matrix swarm — routes heterogeneous tasks to the most suitable model (OpenRouter-like + cfgpu.com/llm/square), dispatches each via in-process subagents. 32/32 benchmark green.

Install

npx @deepseek-ai/dsh plugin --profile headless add github:r600a-code/dsh-swarm-router

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-swarm-router DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-swarm-router.svg)](https://dshhub.dev/plugins/dsh-swarm-router)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from r600a-code/dsh-swarm-router, cleaned of badges and images.

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

ContributionWhat
Model aggregation registry + PR flowmodels/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 pointctx.provide('swarmRouter', api) — other plugins inject: ['swarmRouter'] to register runtime models, custom task kinds, subscribe to feedback, read rankings/usage.
Real-task feedback + rankingswarm_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

ToolModeCalls models?
swarm_route_previewNo (pure routing plan)
swarm_dispatchsubagent (default) | directYes (parallel)
swarm_modelsNo (list registry)
swarm_feedbackNo (records an outcome)
swarm_rankingNo (reads accumulated feedback)
swarm_statsNo (reads accumulated usage)

The router rules (how a task becomes a model)

A task is { id, kind, prompt, maxTokens? } where kind ∈ {reasoning, coding, longcontext, fast, general}. The router is pure and O(1) per task — it spends zero model-time deciding which model; the saving goes into parallel dispatch.

Step 1 — infer the kind. An explicit kind wins; otherwise the first truthy hint among {reasoning, coding, longContext, fast} is used, defaulting to general.

Step 2 — capability gate (hard filter). Each kind requires a capability tag; a model lacking it scores -∞ and is dropped:

  • reasoning requires reasoning; coding requires coding; longcontext requires longContext; fast/general require nothing.

Step 3 — effort-matched weighted score. For the surviving models, a kind-specific linear score is computed from the catalog's 1–10 ranks (strength, speed, cost) and capacities (contextWindow, maxTokens):

kindweight vector
reasoningreasoning×3 + strength×2 + coding×0.3 + contextWindow×0.000004
codingcoding×3 + strength×2.5 + longContext×0.3
longcontextcontextWindow×0.00002 + strength×0.5 + coding×0.3
fastspeed×3 + cost×1.5 + strength×0.3
generalstrength×2 + speed×0.6 + cost×0.3 + coding×0.3

Related plugins