Install
Install with PiG
pig install npm:pi-bifrost-provider-enrichedInstall with Pi
pi install npm:pi-bifrost-provider-enrichedPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.4.1 (README.md). PiG does not review it.
pi-bifrost-provider-enriched
pi-bifrost-provider-enriched is a composite Pi extension. It adds missing reasoning effort metadata to models from provider bifrost.
The package loads pi-bifrost-provider version 0.3.3 as a runtime dependency. It registers providers bifrost and bifrost-enriched before Pi selects the initial model. The current supported baseline is Pi 1.6.0 and Pi 1.6.1; Pi 1.5.x is not supported.
Requirements
Version 0.4.1 uses this tested version baseline:
@earendil-works/pi-coding-agent1.6.0 and 1.6.1.@earendil-works/pi-ai1.6.0 and 1.6.1.pi-bifrost-provider0.3.3.- Bifrost transport 2.6.0.
- Node.js 24.x (
>=24.0.0 <25).
Pi 1.5.x is not supported. The package does not claim support for other versions.
Installation
Install only this Pi package. npm installs pi-bifrost-provider version 0.3.3 as its dependency.
pi install npm:pi-bifrost-provider-enriched@0.4.1
A separate pi-bifrost-provider installation is not a supported configuration.
Pi packages run with your user permissions. Review the source before installation.
Environment
Set BIFROST_URL to load models and send requests through Bifrost. The provider pair still registers when this variable is absent, but its source catalog is empty.
You can also set these authentication variables:
BIFROST_API_KEYsupplies the Bifrost API key.BIFROST_VIRTUAL_KEYsupplies the Bifrost virtual key.
For example:
export BIFROST_URL=http://127.0.0.1:8080
export BIFROST_API_KEY=your-api-key
export BIFROST_VIRTUAL_KEY=your-virtual-key
pi
You can omit either key when your Bifrost configuration does not require it. Virtual key authentication does not add an authorization value.
Provider selection
Start Pi after the package loads. Run /model, then select a model under provider bifrost-enriched.
If both providers contain the same exact model ID, the normal model list shows only the bifrost-enriched entry. A source-only model stays visible under provider bifrost.
You can also start Pi with the provider and an existing Bifrost model ID:
pi --provider bifrost-enriched --model openai/gpt-5
The extension preserves the original model ID. It delegates each enriched request to provider bifrost.
The extension also matches a valid provider-qualified suffix after a display prefix. For example, it matches Gateway model - openai/gpt-5 to the openai/gpt-5 metadata. The enriched model keeps the complete source ID, including the display prefix.
You can select a hidden paired source model directly:
pi --provider bifrost --model openai/gpt-5
Pi also restores a hidden source model from a saved default or a resumed session. Use direct source selection when you do not want fallback effort metadata.
Credentials
The extension uses the public authentication resolver from provider bifrost. It passes the authentication context and abort signal to that resolver.
The extension does not read auth.json. It also ignores a stored credential for provider bifrost-enriched and provides no login flow.
The extension does not copy, log, or cache Bifrost credentials. Provider bifrost remains responsible for request authentication.
Metadata and cache
The extension uses source model metadata when that metadata is complete. It uses models.dev only when source effort metadata is absent.
Before it registers the provider pair, the extension reads its validated cache. It uses a fresh or stale valid cache so the initial model has thinking metadata. If no valid cache exists, startup waits for one bounded request to this fixed endpoint:
https://models.dev/api.json
The request contains no Bifrost credential, header, provider configuration, or model request. It has a ten second timeout and a 25 MiB response limit.
The extension stores public metadata in this file under XDG_CACHE_HOME:
$XDG_CACHE_HOME/pi-bifrost-provider-enriched/models-dev-v1.json
If XDG_CACHE_HOME is absent, the extension uses this file:
~/.cache/pi-bifrost-provider-enriched/models-dev-v1.json
A fresh cache is valid for 24 hours. Startup can use an older valid cache while the session refreshes it in the background. If no valid cache exists and the startup request fails, Pi continues without fallback thinking metadata. The background request retries after the session starts.
The extension makes sure that remote and cached data are valid before use. Invalid data does not replace the active model catalog. A successful startup request is not repeated when the session starts.
Architecture
The factory loads the upstream extension and captures its bifrost provider. A compatibility adapter keeps accepted dynamic source refresh results visible when Pi 1.6.1 caches provider model arrays. It registers the adapted source availability wrapper and the enriched provider before session creation.
The session lifecycle starts metadata work, the source watcher, and offline refresh coordination. It stops those resources during session shutdown.
The enrichment layer performs provider scoped matching. It creates new model values and does not mutate source models.
The metadata layer validates the fixed models.dev response and manages the local cache. The refresh layer publishes complete catalogs and keeps the last good catalog after failure.
A five second in memory watcher detects source catalog changes. It performs no network request and does not keep Node.js running.
Development
Run these commands from the repository root:
npm install
npm run build
npm run typecheck
npm run format
The build writes JavaScript and type declarations to dist. The type analysis command does not write output.
Testing
Run the complete current test suite from the repository root:
npm test
The suite compiles tests before it runs them. It covers contracts, enrichment, matching, cache access, network limits, provider behavior, refreshes, lifecycle events, and data protection. The packed-install matrix runs against exact Pi 1.6.0 and Pi 1.6.1 environments.
The acceptance baseline uses the exact versions in the Requirements section. Do not use a passing test on another version as a compatibility claim.
Security
The extension treats all remote and cached JSON as untrusted data. It does not execute metadata values.
The extension loads the public package entry point from pi-bifrost-provider. It uses public Pi provider and lifecycle APIs.
The extension writes no Pi setting and changes no default model. It creates no command or prompt and writes nothing directly to the terminal.
The package owns the supported registration path for bifrost and bifrost-enriched. Routine enrichment failure registers the unchanged source provider and leaves bifrost available.
Removal
Remove the package from the same Pi scope that contains the installation:
pi remove npm:pi-bifrost-provider-enriched@0.4.1
Removal removes both provider registrations. You can delete the extension cache separately because it contains only public metadata.
Removal does not delete Pi settings or Bifrost credentials. Stop selecting either package-owned provider after removal.
Retirement
Retire this package when Bifrost and pi-bifrost-provider expose complete tested effort metadata through provider bifrost.
First, make sure that the supported test matrix passes with the source metadata. Then install pi-bifrost-provider directly:
pi install npm:pi-bifrost-provider@0.3.3
Select provider bifrost, then remove pi-bifrost-provider-enriched. The direct upstream installation keeps provider bifrost available after removal.
Release inspection
Review the package file list before publication:
npm pack --dry-run
The release review must inspect the tarball and make sure that npm access works. It must select the version and tag and prepare recovery steps.