r600a-code/dsh-swarm-router
Sub-agent matrix swarm that routes heterogeneous tasks to the most suitable model from an OpenRouter-like gateway plus cfgpu.com/llm/square, dispatches each via in-process subagents or direct LLM calls, and tracks per-model token consumption with a feedback-driven ranking.
dsh-swarm-router 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 assignments in parallel as real in-process subagents (or direct ctx.llm calls) pinned to that model — quick tasks land on fast/cheap models, hard tasks on strong reasoning models. The router itself is pure and O(1) per task: zero model-time is spent deciding which model. Four contributions: a model aggregation registry with a CI-enforced structure and add-a-model PR flow; a plugin extension point (ctx.provide('swarmRouter', api)) for runtime models and custom task kinds; real-task feedback with persistence to rankings.json and routing boost/demote; and token-consumption statistics — 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. Six tools: swarm_route_preview, swarm_dispatch (subagent default | direct), swarm_models, swarm_feedback, swarm_ranking, swarm_stats.
Install
dsh plugin --profile web add github:r600a-code/dsh-swarm-routerGitHub install per README (EN primary with 中文): dsh plugin --profile web add github:r600a-code/dsh-swarm-router (README shows the headless profile: dsh plugin --profile headless add github:r600a-code/dsh-swarm-router, then dsh --profile headless --dump-config | grep -E 'cfgpu-swarm|swarm-router'). npm 404 verified 2026-09-04. Needs a credential: CFGPU_API_KEY in $DSH_HOME/.credentials.yaml (or env) for the cfgpu route, OPENROUTER_API_KEY for the OpenRouter route — without them the router reports the route unavailable and the profile still boots.
Compatibility
DeepSeek Harness (headless or web profile); routes tasks across an OpenRouter-like gateway plus the cfgpu.com/llm/square catalog; parallel dispatch as real in-process subagents (or direct ctx.llm calls); formal design in docs/PAPER.md.
Details
- Repo: r600a-code/dsh-swarm-router
- Category: Models & Providers
- Stars: 0
- Version: git github:r600a-code/dsh-swarm-router
- Last push: 2026-08-16
- First seen: 2026-08-15
Recent updates
No npm release (404 verified 2026-09-04); README records a benchmark: 5 heterogeneous tasks → 4 distinct real cfgpu models, all correct (verifier 27/27 and 31/31 green).
FAQ
- Which model routes does it use?
- An OpenRouter-like gateway plus the cfgpu.com/llm/square catalog — each needs its own API key (CFGPU_API_KEY / OPENROUTER_API_KEY); routes without keys are reported unavailable and never dispatched to.
- Does the router itself spend model tokens?
- No — routing is pure and O(1) per task (zero model-time); the savings go into parallel dispatch. Feedback and rankings are recorded after real task outcomes.
- How are tokens accounted per task?
- Direct mode captures exact per-call prompt/completion/total from ctx.llm.stream; subagent mode uses a global llm/stream listener attributed by sessionId — both persist to usage.json with per-model/per-kind views.
Alternatives
lynx-gt/dsh-subagent-tools · ringoage/dsh-subagent-model-picker