dsh-quota-router
Manifest validPolicy-only multi-source quota router for DeepSeek Harness: deterministic task profiles, ordered candidate chains, health-aware fallback, subtask model leases, and observable decisions / DSH 多源配额路由插件
dsh-quota-router
A policy-only multi-source model router for DeepSeek Harness.
v1.0.0 makes the routing contract explicit: choose the right DSH-native model source for each task, recover from infrastructure failures in a bounded and explainable way, and measure route usage without claiming unproven token savings.
npm install @liyuk/dsh-quota-router
📖 项目详解(能力 / 边界 / 收益)→ docs/PROJECT.md · 工程设计与算法文章 → docs/blog-quota-router-engineering.md
It routes a user message to a named task profile, then selects the first healthy, auto-eligible source on that profile's candidate chain. The chain is built from a global source priority list (sources) combined with a per-task model mapping (profiles[].modelBySource) — two orthogonal dimensions. This is designed for a "cost-source 薅羊毛" workflow across mixed free / subscription / unlimited / low-price / manual emergency model sources.
Why it exists
A normal keyword → target + fallback Router cannot reliably express:
coding: opencode-go/mimo-v2.5 → token-share/gpt-5.6-luna
hard coding: opencode-go/mimo-v2.5 → token-share/gpt-5.6-terra
Both rules have the same primary route, so a fallback inferred only from the current session header loses the original task identity. quota-router retains profile + candidate identity per turn and moves along that exact chain.
Safety model
- Only DSH-native registered providers/models are used; no adapters or credentials are owned here.
- Global
sources.priorityis the only source-order authority;sourceTieris explanatory metadata, never a hidden reorder rule. manualandemergencycandidates are never selected automatically;paidcandidates require the explicitallowPaidFallback: trueopt-in.- Stable quota/auth failures advance immediately; transient failures respect normal retries until a configurable threshold opens a cooldown.
- Context compaction is configured and triggered independently by DSH; this plugin never rewrites session history.
- If all candidates are exhausted, the original failure path remains intact.
See docs/configuration.md for every editable policy field, docs/strategy.md for multi-source/task-decomposition recommendations, docs/task-aware-routing-plan.md for the task-aware API, and examples/quota-router.example.yaml for a safe starting configuration. The task-aware layer narrows quota-router to model selection for already-split subtasks; it does not add a Planner, tool lazy-loading, context compaction, or cross-Harness orchestration. REQUIREMENTS.md is the implementation and state-machine reference.
Settings page
With the package enabled in a DSH Web profile, Settings → Quota Router opens the dedicated configuration page. It edits the live quota-router settings namespace and provides:
- global retry, cooldown, and ledger controls;
- global source priority editing;
- profile keyword and
modelBySourceediting; - an expanded source-chain/fallback preview.
The page previews configuration only. Native provider/model availability, active cooldowns, route decisions, and usage stay host-side; inspect runtime observability through the read-only quota_router_status tool.
Development
pnpm install
pnpm test
pnpm run check
pnpm run build
Published on npm as @liyuk/dsh-quota-router; source lives at Liyuk/dsh-quota-router. See docs/RELEASE-1.0.0.md for the community-facing update.
Comments
Loading…
Similar plugins
by green-dalii
Two-tier model router for DeepSeek Harness — LLM-Judge routing, multi-model fallback chains, exponential-backoff failover, and task-level orchestration (DSH adaptation of pi-shift-router)
★ 4
↓ 302/wk
MIT
TypeScript
Oct 18, 2026
dsh plugin --profile web add dsh-shift-routerRule-based multi-provider model routing for DeepSeek Harness with pre-first-token failover, cooldown circuit-breaking, usage accounting, and a status API.
★ 0
dsh plugin --profile web add @botton/dsh-model-routerby peterwangze
DeepSeek Harness 多模型路由插件:让专业的事情交给专业的 agent——自定义视觉/翻译/语音/子代理等专业 agent 并绑定独立模型,多模态账号一键登录、账号池健康路由与实时用量统计
★ 5
MIT
JavaScript
Oct 25, 2026
dsh plugin --profile web add dsh-agent-routerby yjh051108
dsh-routing-suite — injector + router-standard kit: install the runtime injector first, then the task-aware reasoning-mode router preset (measured P1-P23).
★ 7k
MIT
JavaScript
Sep 18, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injectorby xinyang20
Decision-model-powered routing for DeepSeek Harness, with local inference and opt-in cloud decisions.
★ 0
MIT
JavaScript
Oct 8, 2026
dsh plugin --profile web add dsh-decision-routerby qinyu765
Provider discovery, matching, health checks, and pre-output failover for DeepSeek Harness
★ 0
MIT
TypeScript
Aug 14, 2026
dsh plugin --profile web add dsh-llm-auto-route