omp-bifrost-provider0.1.0
A Bifrost AI Gateway provider for oh-my-pi
Built for omp
The author tagged this package omp-plugin.
Reports 0
No reports yet.
Readme
Bifrost provider for oh-my-pi
An oh-my-pi (OMP) provider for the Bifrost AI Gateway. It discovers chat models from Bifrost and routes requests through Bifrost's OpenAI Chat Completions integration.
This project is a fork of pi-bifrost-provider, rewritten to use OMP's native extension, provider, credential, and model-discovery APIs.
Installation
omp install npm:omp-bifrost-provider
Restart OMP after installation, then configure the connection:
/login bifrost
OMP prompts for a Bifrost URL and optional API and virtual keys. The login validates the connection by discovering models, then saves all three values in OMP's credential store. The saved URL and keys are used for later model discovery and inference. Run /login bifrost again to change the connection.
Select a discovered bifrost/* model using /model, or pass a model selector when launching:
omp --model bifrost/anthropic/claude-sonnet-4-6
Configuration
Interactive login is recommended. For non-interactive use, set environment variables or pass OMP extension flags:
| Environment variable | CLI option | Required | Description |
|---|---|---|---|
BIFROST_URL |
--bifrost-url |
Yes | Bifrost instance URL, such as http://localhost:8080. Existing /v1 or /openai/v1 bases are accepted. |
BIFROST_API_KEY |
--bifrost-api-key |
No | API/auth key sent as a Bearer token. |
BIFROST_VIRTUAL_KEY |
--bifrost-virtual-key |
No | Bifrost virtual key sent as x-bf-vk. |
Example:
export BIFROST_URL=http://localhost:8080
export BIFROST_API_KEY=your-api-key # optional
export BIFROST_VIRTUAL_KEY=sk-bf-... # optional
omp --model bifrost/anthropic/claude-sonnet-4-6
Command-line flags override environment values. A saved /login connection takes precedence over ambient configuration. Prefer environment variables for secrets because command-line values may appear in shell history and process listings.
When a virtual key is supplied, model discovery returns only models available to that key. API and virtual keys are independent and can be used together. Keyless gateways do not receive a bogus Authorization header.
URL behavior
For an instance URL such as http://localhost:8080, the provider uses:
http://localhost:8080/openai/v1/modelsfor model discoveryhttp://localhost:8080/openai/v1/chat/completionsfor inference
An existing /v1 base is preserved, including reverse-proxy mounts.
Model metadata
The provider maps Bifrost's model catalog to OMP models, including context and output limits, image input support, reasoning effort, and token pricing when available. Models advertising only non-chat methods (such as embeddings) are omitted. Missing context/output limits use conservative 128k/8k defaults.
Development and testing
Requires Bun 1.4.4 or newer and Node.js 22.19 or newer for the Bifrost fixture tooling.
bun install
npm run check
npm test
Load the local extension directly while developing:
omp --extension ./index.ts
To test it as a locally linked plugin:
omp install .
The OMP unit tests use bun test test and local HTTP mocks. They cover URL normalization, full login setup and saved credentials, discovery/model conversion, keyless and keyed headers, and streamed completions.
Run the end-to-end smoke test against a real Bifrost gateway and aimock upstream with:
npm run test:integration
This starts Bifrost and aimock using npx, then launches OMP with this local extension and sends a real streaming request through the gateway. The first run requires network access. Fixture settings can be overridden with BIFROST_TEST_BIND_HOST, BIFROST_TEST_HOST, BIFROST_TEST_PORT, AIMOCK_TEST_BIND_HOST, AIMOCK_TEST_HOST, AIMOCK_TEST_PORT, BIFROST_TEST_PACKAGE, AIMOCK_TEST_PACKAGE, BIFROST_TEST_START_TIMEOUT_MS, and BIFROST_TEST_VERBOSE.
Contributing
AI policy and usage disclosure
This repository welcomes both AI-assisted and agent-generated contributions. All code changes receive final review from at least one human.
For any AI-involved commit, pull request, or issue, disclose whether the contribution was AI-assisted or agent-generated, the model used, and the agent harness or other AI tooling used. For commits, a trailer line is sufficient; PRs and issues should include an AI disclosure section.
License
MIT. See LICENSE.