Pi-Bifrost plugin

An extension for the Pi agent that sorts models into quick, general and frontier tiers and picks a healthy one per turn, no proxy

  • 79 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • Initialization and the speed probe send requests to connected models and can spend provider credits
  • The classifier receives the prompt text and the local cache keeps normalized prompt terms
All reasons and checks

iamaamir/pi-bifrost

Install

Manual install

pi install npm:pi-bifrost

Needs Pi 1.0.1+; then run /bifrost init inside Pi.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Initialization and the speed probe send requests to connected models and can spend provider credits
  • The classifier receives the prompt text and the local cache keeps normalized prompt terms

This is third-party code. Review the repository files before installing.

What it does

Pi-Bifrost is an extension for the Pi agent that routes every turn to a model from your pools. Models are put into named tiers such as `quick`, `general` and `frontier`, and each tier has a selection strategy: list order, price, context window, probe-sorted speed or random. Before a turn Bifrost resolves the tier, skips models with an open reliability circuit and sends the turn to the chosen model. The tier comes from a word at the start of the message, a rule, the classifier cache, an optional classifier or the default tier. A classifier only suggests a tier and cannot choose a model outside your pool. There is no hidden model pool, proxy or automatic prompt replay: a failed turn is never sent again.

Who it is for. Pi agent users with several providers and models of different price and speed who want to control model choice by rules.

Good fit when

  • You send a small edit to a fast cheap model and an authorization review to a strong one
  • A provider keeps returning errors and a model with an open reliability circuit must be bypassed
  • You want to preview the route with `/bifrost preview` without launching generation
  • You want to pin one model for the session so as not to lose the provider prompt cache
  • Tier choice must honor a word at the start of the message, such as `frontier review this`

Not a fit when

  • You do not work in Pi: the extension targets Pi 1.0.1 and newer
  • You have one model connected: there is nothing to choose between tiers
  • The session depends on one provider prompt cache: frequent model switching fragments it
  • You expect guarantees of better code, lower cost or latency: the author does not promise them

Example request

Set up Bifrost over my Pi models, show the quick, general and frontier pools and preview the route for a flaky test task

Limitations

It needs Pi 1.0.1 or newer and at least one authenticated model in Pi. The built-in configuration has empty model pools: you supply the real provider identifiers or `/bifrost init` drafts them. Initialization and the speed probe send small requests to models, which can spend credits or hit rate limits. An optional classifier receives your prompt text, and the local classification cache keeps normalized prompt terms and selected tiers, so treat them as potentially sensitive. The author does not promise better code, savings, speed or cache gains.

How to disable. The `/bifrost off` command stops routing and `/bifrost unpin` resumes it after pinning. The package can be removed with Pi tools, and the `.pi/bifrost.json` file is deleted by hand.

FAQ

How do I install Pi-Bifrost?

Run `pi install npm:pi-bifrost`, then the `/bifrost init` command in Pi: it checks available models, proposes `quick`, `general` and `frontier` pools and writes `.pi/bifrost.json` after confirmation.

What is Bifrost Auto?

It is an opt-in mode: pick `bifrost/auto` in the Pi `/model` picker and Pi dispatches every request to a suitable model by the same tiers. The footer shows which model answers.

Is a classifier required?

No. `/bifrost classifier off` turns on rules and default tier routing with no classifier call. There are three options: a prompt to a Pi model, TypeSafe with a key and Pi native `classify()`.

What does the extension do with a failed turn?

It never sends it again on its own. Repeated failures open a reliability circuit and later turns avoid that model until a controlled recovery trial.

How do I pick a tier for one message?

Start the message with the tier name as a single lowercase word, for example `frontier review this authorization flow`. Bifrost removes that word before the model receives the message.

Discussion

No questions or reviews yet.

Plugins

A Pi extension that turns prompt templates into slash commands that pick the model, the skill and the thinking level on their own

PluginExtended access322Repository stars

A plugin for the Pi agent: a fast model executes while a stronger one gives a second opinion before big decisions and at the end.

PluginExtended access65Repository stars

shitty-extensions adds fifteen extensions to the Pi agent: second opinions, plan mode, cost tracking and test loops.

PluginExtended access125Repository stars
Editors’ pick

A minimal terminal coding agent extended with skills, prompt templates and TypeScript packages

CLIBroad access121.8KRepository stars

An extension for the Pi agent: one programmable fabric_exec tool calls tools, MCP, agents and workflows from code

PluginBroad access335Repository stars

An extension for the Pi agent (pi.dev): subagents and orchestration in the Claude Code style, a widget and JavaScript scripts. Not for Claude Code

PluginExtended access1.4KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
Pi-Bifrost (this card)no79
Claude Code Routerno38,127a proxy that routes Claude Code requests to other models; Pi-Bifrost is a Pi extension with no proxy, tiers and reliability circuits
llm-routerno127a general-purpose plugin for model selection; here a Pi setup with pools, strategies and route preview

README in short

The README explains tier routing, shows the chain from prompt to Pi model, a sample configuration and a table of control commands. It also covers optional classifiers, when to keep one model and development commands.

README badge

Report a problem