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
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
Install
Manual install
pi install npm:pi-bifrostNeeds Pi 1.0.1+; then run /bifrost init inside Pi.
Access and checks
How we reviewExtended 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 taskLimitations
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.
Related
PluginsA Pi extension that turns prompt templates into slash commands that pick the model, the skill and the thinking level on their own
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.
shitty-extensions adds fifteen extensions to the Pi agent: second opinions, plan mode, cost tracking and test loops.
A minimal terminal coding agent extended with skills, prompt templates and TypeScript packages
An extension for the Pi agent: one programmable fabric_exec tool calls tools, MCP, agents and workflows from code
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
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| Pi-Bifrost (this card) | no | 79 | |
| Claude Code Router | no | 38,127 | a proxy that routes Claude Code requests to other models; Pi-Bifrost is a Pi extension with no proxy, tiers and reliability circuits |
| llm-router | no | 127 | a 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.