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

@guygrigsby/pi-subagent-routing

v0.3.1

Published

Inject a subagent model-routing policy: the orchestrator plans and judges on its own live model and fans implementation out across a price-tiered ladder of every configured model, steered by a cost/performance mode, reviewing before it accepts.

Readme

subagent-routing

Injects a subagent model-routing policy into the system prompt each turn (for the frontier pi profile). The orchestrator plans, specs, and judges on its own live model, fans implementation out to other configured models, then spawns a reviewer subagent to grade the actual diff — not the worker's self-report — before accepting it. Every spawn carries a maxTurns budget (a stuck agent dies and escalates instead of spinning), reviews run on the mid tier for mechanical work, and two failed reviews of one task stop the ladder and report rather than climbing further.

Every configured, authenticated model is a candidate, minus local (mlx/*) models and the orchestrator's own. The ladder is rebuilt each turn from the model registry: models are deduped by id across providers (cheapest provider wins), sorted by price and split into terciles — cheap, mid, frontier — rendered compactly, one line per provider per tier.

The mode shapes the decision procedure, not the menu:

  • cost (default) — route each task to the cheapest tier plausibly adequate for it; escalate one tier on a failed review; frontier only for genuinely hard tasks.
  • performance — route each task to the tier most likely to pass review first try; mechanical work still goes cheap, and the priciest model is never the default.

Price is the capability proxy (the registry carries no benchmark data), so the config takes per-model tier overrides for the models price misplaces — e.g. a $0 subscription model that is actually frontier-class:

{
  "mode": "cost",
  "tiers": { "kimi-coding/*": "frontier" }
}

Keys are provider/id exact or provider/*; exact beats glob. Config lives at <agentDir>/subagent-routing.json and is re-read every turn, so hand-edits apply on the next turn. Switch modes with /subagent-routing cost|performance. The policy also licenses the orchestrator to trust its own knowledge of a model over its price-derived tier.

Nothing names the orchestrator model: spawn a subagent with no model override and it inherits whatever you are running. The judge model is chosen per task — mid tier for mechanical work, the live model for disputes, second failures, and security-sensitive diffs.

Pairs with the active-model extension (which tells the orchestrator its live identity), the global reviewer agent type (~/.pi/agent/agents/reviewer.md), and @tintinweb/pi-subagents (which provides the Agent tool this policy drives).

Install

pi install npm:@guygrigsby/pi-subagent-routing