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-provider-service-tier

v0.1.4

Published

Provider/model-scoped service_tier management extension for Pi

Downloads

80

Readme

pi-provider-service-tier

npm version License: MIT Node.js >= 22 Pi extension

A Pi extension that lets you choose an API service_tier per provider/model.

Use it when you want to turn on faster or paid priority tiers for one model without changing your prompts, tools, selected model, or the rest of your Pi setup.

What it does

  • Adds a top-level service_tier field to outgoing provider request payloads.
  • Scopes settings to the current provider/model pair.
  • Supports project-local settings and user-global defaults.
  • Provides simple /fast-* commands for service_tier: "priority".
  • Keeps a support map so unsupported provider/model pairs are not modified.
  • Detects unsupported tier errors and updates the support map.

The extension only injects service_tier when all of these are true:

  1. the current provider/model pair is active in the effective config,
  2. a service tier is configured for that pair, and
  3. the support map says that tier is supported for that pair.

[!NOTE] This extension injects the provider payload field service_tier. For Pi's built-in OpenAI providers, Pi also has an internal serviceTier stream option used for cost accounting. This extension is intentionally broader and payload-hook based, so it does not adjust Pi's internal cost multiplier.

Prerequisites

  • Pi installed and available as pi.
  • Node.js >=22.
  • git, if installing directly from GitHub.
  • A provider/model that supports service_tier if you want injection to happen.

Quick start

Option A: install from npm

Install globally for your Pi user settings:

pi install npm:pi-provider-service-tier

Or install only for the current project:

pi install -l npm:pi-provider-service-tier

Restart Pi, or run this inside Pi:

/reload

Then select a provider/model and enable priority mode:

/fast-project on

Check the current project setting:

/fast-project status

Option B: install from GitHub

Install globally for your Pi user settings:

pi install git:github.com/luxmargos/pi-provider-service-tier

Or install only for the current project:

pi install -l git:github.com/luxmargos/pi-provider-service-tier

Option C: clone locally

git clone https://github.com/luxmargos/pi-provider-service-tier.git
cd pi-provider-service-tier
npm install

Load it temporarily for one Pi run:

pi -e .

Or install the local checkout for the current project:

pi install -l .

Restart Pi or run /reload, then enable a tier:

/service-tier-project priority

Verify or remove

List installed Pi packages:

pi list

Remove the user-global npm install:

pi remove npm:pi-provider-service-tier

Remove the project-local npm install:

pi remove -l npm:pi-provider-service-tier

Remove the user-global GitHub install:

pi remove git:github.com/luxmargos/pi-provider-service-tier

Remove the project-local GitHub install:

pi remove -l git:github.com/luxmargos/pi-provider-service-tier

Remove the project-local local checkout install:

pi remove -l .

[!TIP] Do not load the same checkout with pi -e . while it is also installed with pi install -l .. Pi may load duplicate commands with numeric suffixes.

Common usage

Fast mode

Fast mode is a convenience wrapper for enabling service_tier: "priority" for the current provider/model.

| Command | Scope | Description | | --- | --- | --- | | /fast-project | Current project | Toggle priority tier for the current provider/model. | | /fast-project on | Current project | Enable priority tier. | | /fast-project off | Current project | Disable this extension for the current provider/model in this project. | | /fast-project status | Current project | Show the current project setting. | | /fast-user | User-global | Toggle priority tier for the current provider/model. | | /fast-user on | User-global | Enable priority tier as a user default. | | /fast-user off | User-global | Disable the user-global setting for the current provider/model. | | /fast-user status | User-global | Show the current user-global setting. |

Explicit service tiers

Use these commands when you want a tier other than priority.

| Command | Scope | Arguments | | --- | --- | --- | | /service-tier-project <tier> | Current project | priority, flex, default, auto, scale, off, status | | /service-tier-user <tier> | User-global | priority, flex, default, auto, scale, off, status |

Examples:

/service-tier-project flex
/service-tier-project off
/service-tier-user priority
/service-tier-user status

Commands apply only to the current provider/model pair. Argument completions are available; type a command plus a space, then press Tab.

Build or refresh the support map

/service-tier-build-map
/service-tier-build-map-all
  • /service-tier-build-map updates the support map for the current provider/model.
  • /service-tier-build-map-all updates the support map for all models returned by Pi's model registry.

With aggressive probing off, map building uses bundled presets. With aggressive probing on, the extension sends low-token probe requests for each tier and model.

[!WARNING] Aggressive probing can cost money and trigger provider rate limits. It is off by default.

Debug injection decisions

/service-tier-debug on
/service-tier-debug off
/service-tier-debug status

Debug mode is session-local. When enabled, the extension notifies whether each provider request was injected with service_tier or skipped.

Configuration files

This package uses pi-provider-service-tier for package and config-file identity.

Project config:

.pi/extensions/pi-provider-service-tier.json

User-global config:

~/.pi/agent/extensions/pi-provider-service-tier.json

Global support map:

~/.pi/agent/extensions/pi-provider-service-tier-map.json

Project and user configs are merged:

  • user config provides defaults,
  • project config overrides fields for the same provider/model key,
  • provider/model entries that exist only in user config still apply in projects unless overridden.

If you previously used an older local package name, move or copy any existing pi-service-tier*.json files to the filenames above.

Config schema

Example:

{
  "version": 1,
  "aggressiveProbe": false,
  "entries": {
    "openai/gpt-5.5": {
      "active": true,
      "serviceTier": "priority"
    },
    "openai/gpt-4.1": {
      "active": false,
      "serviceTier": "flex"
    }
  }
}

aggressiveProbe defaults to false. Set it manually in either config file. Project config overrides user config for this field.

Support map schema

Example:

{
  "version": 1,
  "entries": {
    "openai/gpt-5.5": {
      "provider": "openai",
      "id": "gpt-5.5",
      "api": "openai-responses",
      "supported": true,
      "tiers": ["priority", "flex", "default", "auto", "scale"],
      "source": "preset",
      "updatedAt": "2026-05-19T00:00:00.000Z"
    }
  }
}

Preset support currently includes:

| Provider/API | Models | Tiers | | --- | --- | --- | | openai + openai-responses | all | priority, flex, default, auto, scale | | openai + openai-completions | all | priority, flex, default, auto, scale | | openai-codex + openai-codex-responses | probed models in presets/openai-codex.json | priority, default | | openai-codex + openai-codex-responses | fallback for other models | priority | | opencode-go + openai-completions | probed models in presets/opencode-go.json | model-specific; usually priority, flex, default, auto, scale |

Other providers/models are marked unsupported by presets until aggressive probing or future presets add support.

Unsupported tier errors

If a provider returns an error indicating service_tier is unsupported or invalid, the extension:

  1. removes that tier from the map entry for the current provider/model,
  2. records it in unsupportedTiers,
  3. notifies the user, and
  4. does not retry the failed request.

Development

git clone https://github.com/luxmargos/pi-provider-service-tier.git
cd pi-provider-service-tier
npm install
npm run check

Local smoke test:

pi -e . --provider openai --model gpt-5.5

npm run check runs TypeScript type checking, Node tests, and npm pack --dry-run to verify the published package contents.

License

MIT