npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@liyuk/dsh-quota-router

v1.0.0

Published

Policy-only multi-source quota router for DeepSeek Harness: deterministic task profiles, ordered candidate chains, health-aware fallback, and observable decisions.

Readme

dsh-quota-router

npm

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.priority is the only source-order authority; sourceTier is explanatory metadata, never a hidden reorder rule.
  • manual and emergency candidates are never selected automatically; paid candidates require the explicit allowPaidFallback: true opt-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 modelBySource editing;
  • 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.