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

pi-service-tier

v0.7.1

Published

Fast mode and provider service-tier controls for pi

Readme

⚡ pi-service-tier

A Pi extension that toggles fast mode and applies provider service tiers.

🚀 Installation

pi install npm:pi-service-tier

✨ What it does

  • Adds service tier parameters to supported provider requests when a tier is configured
  • Adds /fast and /ultrafast to toggle the current model provider between the selected speed and off for this session only
  • Adds /service-tier to configure global defaults for all supported providers from an interactive modal
  • Adds an optional service tier widget when pi-fancy-footer is installed

🚀 Commands

  • /fast: toggles the current model's provider between its fast tier and off in this session, without changing other sessions or your global defaults. The supported providers all use priority as the fast tier.

  • /ultrafast: toggles between ultrafast and off in this session for openai and openai-codex (including additional accounts on their official endpoints). It uses the same provider override as /fast, so selecting a different speed replaces the active tier.

  • /service-tier: opens an interactive editor for global defaults. The current model's provider appears first, followed by the remaining supported providers. Press Enter or Space to cycle through off and the provider-specific tiers. Session overrides take precedence over these defaults.

Session scope

To speed up a session, run /fast or /ultrafast. Run the same command again to turn that mode off. Each supported provider has one override (shared with any additional accounts for that provider), so switching models preserves your choices. Turning either mode off disables this extension's tier injection, even if a global tier is configured. The command leaves other request parameters unchanged.

| Current tier | /fast | /ultrafast | | ------------- | ---------- | ------------ | | Off or flex | priority | ultrafast | | priority | Off | ultrafast | | ultrafast | priority | Off |

Both commands remain listed on all providers. Running them on an unsupported model produces a warning without changing settings.

Overrides are saved with the session and restored on resume or extension reload. They follow the active conversation branch: /tree restores the choices at the selected point, and /fork or /clone inherits the choices on the copied branch. Later toggles in a fork do not affect its parent. /new starts without overrides and uses your process defaults (--service-tier if passed, otherwise your global defaults).

Ultrafast availability

The extension sends service_tier: "ultrafast" for models using the openai Responses API or openai-codex. OpenAI determines model and account eligibility. Pi reports provider errors without automatically selecting another tier.

OpenAI's API documentation describes current model availability, rate limits, and pricing. Codex subscription eligibility differs from API-key access and may require workspace permissions.

Child agents

With pi-agents 0.36.0 or later, which provides agent extension hooks, new agents capture your effective service-tier settings, including session /fast and /ultrafast overrides. Each child applies the settings for its own provider, even when it uses a different model or additional account from the parent.

For example, enable /fast, then ask Pi to spawn an agent. That agent keeps its captured settings if you toggle /fast again. Graph nodes capture when the graph is created; helpers inherit their creating agent's settings. Follow-ups, child compaction, and resumed work retain the snapshot.

This integration is optional and adds no package dependency. A snapshot from a newer version of pi-service-tier applies the providers and tiers this version supports. If pi-service-tier is removed, stored snapshots remain but stop affecting requests; loading it again applies them. Parent compaction and usage-cost limitations are unchanged.

⚙️ Configuration

Run /service-tier or create ~/.pi/agent/service-tier.json to set global defaults:

{
  "openai": "priority",
  "openai-codex": "flex",
  "anthropic": "priority",
  "google": "priority",
  "google-vertex": "flex"
}

Per-process defaults

--service-tier replaces ~/.pi/agent/service-tier.json for one Pi process, for example in a scripted pi -p run or a subprocess launcher:

pi --service-tier=off
pi --service-tier=openai-codex:priority,anthropic:standard

off disables every provider. Otherwise, list provider:tier pairs; any omitted provider stays off instead of inheriting from service-tier.json. Session /fast and /ultrafast overrides still take precedence and are saved without the flag's values, so reopening the session without --service-tier uses service-tier.json again. Agents created with pi-agents capture these process defaults too. An invalid value warns once, disables all tiers for the process, and blocks /fast and /ultrafast toggles.

Supported providers

| Provider | Tiers | Fast tier | | --------------- | ------------------------------- | ---------- | | openai | flex, priority, ultrafast | priority | | openai-codex | flex, priority, ultrafast | priority | | anthropic | priority, standard | priority | | google | flex, priority | priority | | google-vertex | flex, priority | priority |

To turn a provider off by default, omit its key. Only the values listed above are accepted. Providers without a session override continue to pick up global changes unless the process was started with --service-tier. Batch APIs are separate asynchronous APIs and are not configured by this extension.

Additional accounts

Accounts registered under another provider name, such as pi-multi-pass's anthropic-2 or openai-codex-2, share the service-tier settings of the built-in provider whose API and official endpoint they use. /fast, /ultrafast, /service-tier, child agents, and the footer widget all share that provider's setting rather than storing a separate entry per account.

Account matching requires the exact API and baseUrl of Pi's built-in provider (for example https://api.anthropic.com with no trailing slash or port, or https://{location}-aiplatform.googleapis.com for google-vertex). Other spellings and third-party proxies speaking a supported API are not matched and receive no service tier.

🧩 Footer widget

When pi-fancy-footer is installed, the widget appears only when the active model resolves to a supported provider and that provider has an effective tier after applying session overrides. It shows ⚡⚡ for ultrafast or a single ⚡ for another active tier, without the tier name. The bolts indicate the requested tier; they do not confirm which tier the provider used.

The widget id is pi-service-tier.service-tier. It uses the current pi-fancy-footer event protocol, with row 1, position 8, right alignment, and no fill behavior by default. The extension has no package dependency on the footer: it publishes a complete snapshot when its state changes and republishes when the footer announces that it is ready.

📝 TODO

  • Account for service-tier pricing in pi usage metrics. The extension currently injects the tier into the provider request payload, but pi's OpenAI Codex cost calculation reads the requested tier from provider options. Until pi exposes a first-class extension path for that option, displayed usage costs can omit flex or priority multipliers. Ultrafast pricing is also not represented by Pi's current pricing logic. Do not use displayed costs to estimate ultrafast charges.

📄 License

MIT