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

@stablekernel/pi-bifrost

v0.13.2

Published

Pi extension that registers the Bifrost gateway as a model provider, resolving per-project virtual keys via gateway-cli.

Downloads

1,762

Readme

@stablekernel/pi-bifrost

Pi extension that registers a Bifrost LLM gateway as a model provider, with per-project virtual-key resolution delegated to gateway-cli.

What it does

  • Registers two providers:
    • bifrost-openai — the OpenAI-compatible surface, every chat model the gateway serves. First-party OpenAI GPT models (not gpt-oss) are sent over the Responses API (api: "openai-responses" per model): gpt-6-class models reject chat completions through the gateway.
    • bifrost-anthropic — the Anthropic Messages surface, Claude models only. The Anthropic wire carries prompt-cache control blocks that only Claude accepts, so non-Claude models are registered on the OpenAI surface instead of being listed twice with one copy broken.
  • Fetches each surface's model list, limits and pricing through gateway-cli models --wire=… at startup — no catalog is checked in.
  • Seeds reasoning capability per model: catalog-flagged models register reasoning: true. On the OpenAI surface they also get a thinkingLevelMap translating pi's thinking levels to the model's effort values (unapplicable levels are hidden, never passed through by name) plus supportsReasoningEffort, so pi's per-request effort picker sends the provider's own values. On the Anthropic surface the capability is flagged and pi's Claude thinking handling applies; claude-sonnet-5-5 also sets forceAdaptiveThinking, because pi 1.4.0 otherwise sends thinking.type=enabled and Bifrost returns a 400 (verified live 2026-11-25; Opus 5.5, Haiku 5.5 and Fable 5.2 work without it). Models with effort levels also set supportsPerMessageEffort (omp); those whose id is in pi-ai 1.7.0's catalog of mid-conversation-effort Claude models (Opus 5 and 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.1 and 5.2) also set supportsMidConvoEffort (the flag pi reads) so thinking-level changes keep the prompt cache. Cache-keeping has been verified live only on claude-opus-5-5 through Bifrost; other models remain unverified (G-012). Toggle-only reasoning models get no effort map. The default effort itself is pi's own thinking-level default.
  • Adds rolling prompt-cache breakpoints for GPT-6.2 on Bedrock (bedrock/openai.gpt-6.2-*). Those models reuse a cached prefix only up to a content block marked prompt_cache_breakpoint: {mode: "explicit"}, so without markers every agent turn was a full cache write. A before_provider_request hook marks the last input item of each request and the item that ended the previous request; string content on a marked item is sent as a one-block input_text list. Other models, 6.0/6.1 included, cache implicitly and are left untouched. Verified live 2026-11-24 on gpt-6.2-sol through omp: cache reads per turn went from 0, 0, 0, 0 to 44.5K, 46.0K, 47.6K, 49.0K (about 97% of the prompt).
  • Sets user on chat-completions requests to Fireworks models (fireworks/*) to a hash of the conversation's first messages, Fireworks' documented session-affinity key (Bifrost forwards it), so a session's turns tend to reach the replica that holds its cached prefix. It is a hint, not a pin: measured live 2026-11-24 on kimi-k3.1, follow-up turns that missed the previous prefix fell from 26% to 18% (200 turns each). The rest is Fireworks routing (G-020). A user the harness already set is kept.
  • Never holds the key: pi resolves it per request via the !gateway-cli key print command form, so the per-project key cascade (environment override → project → user default) applies on every turn.

/bifrost-refresh

Reconciles the model list on demand, in pi and omp alike (one package, one implementation, one command):

  • With gateway-cli on PATH it runs gateway-cli sync — the same reconcile as the background sync — and shows that command's own output. It rewrites the saved selection and the harness configs on disk.
  • Without it it asks the gateway directly: $BIFROST_DISCOVERY_URL (or $BIFROST_GATEWAY_URL) with $BIFROST_VK, falling back to the key in ~/.config/bifrost/keys/default.env. It then reports how many models the gateway offers and which are new or gone against the ids this session registered. This mode reports only — it writes nothing, and the key is never printed. Project lookup also honors committed .gateway/shared.json, with personal > shared > user precedence per deployment. A saved project selection is the exception: refresh refuses before making a request and tells you to install gateway-cli, because direct discovery cannot apply the project context.

Either way the answer arrives as a notification, and any failure is one readable line rather than an error thrown into the session.

Restart the session to use a newly added model. Pi and omp build a provider's model list once, while the session starts, and neither can re-register one to a running session — so the report names the new models and says to restart, and nothing here fakes a reload.

Requirements

  • gateway-cli on PATH (or the GATEWAY_CLI_BIN env var pointing at it), connected once with gateway-cli connect.

Without it nothing is registered — there is no credential to hand pi — but /bifrost-refresh still reports the gateway's live list from the environment (see above).

Install

pi install npm:@stablekernel/pi-bifrost

Works in omp (the Pi fork) too — its plugin loader accepts the same package and pi.extensions manifest:

omp plugin install npm:@stablekernel/pi-bifrost

License

UNLICENSED — published for installation convenience; all rights reserved. Intended for use within the organization that operates the Bifrost gateway.