mirror of
https://github.com/r600a-code/dsh-swarm-router.git
synced 2026-09-28 05:23:21 +08:00
① Model multi-aggregation registry + PR flow: models/registry.json is the
canonical model 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, and read rankings/usage.
③ Real-task feedback + ranking: swarm_feedback records outcomes (correct,
quality 1-5); persisted to rankings.json; swarm_ranking shows per-model/
per-kind successRate/avgQuality/score; proven models boost routing,
failing ones get demoted (rankingBoost).
④ Token-consumption statistics (cfgpu highlighted): direct mode captures
exact per-call prompt/completion/total tokens from ctx.llm.stream;
subagent mode captures via a global llm/stream waterfall listener;
persisted to usage.json; swarm_stats shows totals/byProvider/byModel/
byKind + cfgpuHighlight.
New tools: swarm_models, swarm_feedback, swarm_ranking, swarm_stats.
swarm_dispatch gains mode: 'direct' (exact token capture) | 'subagent'.
Verified end-to-end through DSH headless:
- direct 3-task benchmark: 31/31 green, tokens captured per task
(e.g. glm-5.2 reasoning: p82+c114=196; v3.2 general: p61+c448=509).
- subagent 5-task benchmark: 27/27 green.
- platform e2e: dispatch→feedback→ranking→stats all return real data;
rankings.json + usage.json persist across runs (5 records, 1188 tokens
total cfgpu consumption recorded).