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

@oisin-ee/pi-tiers

v0.36.2

Published

Sticky virtual model tiers with quota-aware recovery for pi.

Readme

@oisin-ee/pi-tiers

Tier virtual models keep each branch on its chosen physical model until a failure requires recovery. The selected thinking level passes through to the physical model. Pi clamps unsupported levels. A model switch loses prompt caches and thinking signatures.

Config

Put tiers.json in the Pi agent directory (~/.pi/agent by default):

{
  "sol": ["cliproxy/gpt-5.6", "cliproxy/claude-opus-4-6"],
  "luna": ["cliproxy/minimax-m3", "cliproxy/gpt-5.6"]
}

Select tier/sol or tier/luna. Each target must identify a configured physical model. An absent file registers no tiers. Invalid config stops registration. Reload Pi after config changes. This package does not load model-alias.json or register alias/* models.

Recovery

Gateway failures open a provider-wide circuit. Recovery waits, then retries the same target. The delay starts at two seconds and doubles to one minute. Gateway failures never cool individual models or pools.

Quota failures exclude a pool. Model IDs that start with claude-, gpt-, or minimax- use the corresponding shared pool. Other models use their provider ID as the pool. The snapshot reset time controls the exclusion when the pool is exhausted. Without that reset, cooldown starts at five minutes and doubles to one hour.

Pi handles native transient retries first. After native retries end, boundary recovery selects the next target. Unknown models and request, authentication, or configuration failures stop without failover. Abort never requests recovery. Each user turn permits two recoveries. Native transient retries retain Pi's separate retry budget.

Boundary recovery removes only the failed assistant entry from model context. A state-only custom entry records the next route. Recovery never creates user messages or rewrites their text. The chosen target, attempted targets, and remaining budget follow the session branch.

Quota and shared state

Before routing, the extension runs dogsled quota --json --cached with a two-second timeout. The result stays in memory for one minute. Missing Dogsled or an invalid snapshot disables quota filtering. The command never requests a CLIProxy refresh.

A pool is exhausted only when every account has a full window with a future reset. For multiple blocked windows, an account becomes available after its last reset. The first available account ends the pool exclusion.

The shared store is ~/.pi/agent/state/pi-tiers/state.json. An exclusive lock/ directory protects each read-modify-write transaction. Its owner.json records the process ID and creation time. A temporary state file and atomic rename protect readers. Lock acquisition stops after two seconds. A dead owner or a lock older than 30 seconds permits takeover through atomic directory rename. An ownerless directory also expires after 30 seconds. Retired generations remain for 60 seconds to exclude competing takeovers. Invalid state and filesystem failures stop routing rather than discard shared health.

Pi 1.3.0 response events contain no model or request identity. HTTP status applies only when an error includes the response's x-request-id or request-id value. Otherwise, the classifier uses error text. Unrelated response status never affects routing.

Development

proto run moon -- run pi-tiers:lint pi-tiers:test