BLACKFUEL
Cookbooks

Pi Coding Agent

Use the Pi Coding Agent with Blackfuel as the inference backend via the pi-blackfuel extension

pi is a coding-agent CLI. The pi-blackfuel extension registers Blackfuel as a model provider inside pi, so you can drive pi's agent loop with any text-generation model served by Blackfuel.

The extension discovers models live: on startup it fetches the model list from Blackfuel's OpenAI-compatible GET /v1/models endpoint and registers each text-generation model under a blackfuel provider. New model releases show up automatically — there's no static list to maintain and nothing to edit when the catalog grows.

Prerequisites

Install the extension

Install pi-blackfuel directly from GitHub:

pi install git:github.com/blackfuel-ai/pi-blackfuel

The extension auto-discovers Blackfuel's models on the next pi startup — no /reload needed.

Authenticate

Log in from inside pi:

  1. Run /login
  2. Choose Use an API key
  3. Select Blackfuel
  4. Paste your key when prompted

pi keeps the key, so you only do this once.

pi stores the key in plain text in ~/.pi/agent/auth.json. On a shared machine, use the environment variable below instead to keep the key out of that file.

To use an environment variable instead, set your Blackfuel API key before launching pi:

export BLACKFUEL_API_KEY=bf_mykey_xxxxxx

The extension reads the key stored via /login first, then falls back to BLACKFUEL_API_KEY. Add the export line to your shell profile (~/.bashrc, ~/.zshrc) to persist it across sessions.

Verify and use

List the available models to confirm the Blackfuel catalog loaded:

pi --list-models

The models appear under the blackfuel provider. Select one with the model selector (Ctrl+P), or switch directly with /model blackfuel. Browse Available Models to pick the right one for your workflow.

Each model carries the details Blackfuel serves for it:

  • Cost: the usage and cost pi shows in its footer and in /session use the model's Blackfuel per-token rates.
  • Thinking levels: /thinking offers only the reasoning efforts the model accepts.
  • Deprecation: a deprecated model's name shows its sunset date and, when Blackfuel names one, the successor to move to, in the form (deprecated, sunset YYYY-MM-DD, use <successor model ID>). See Model Lifecycle for the notice you get before a model is retired.

On this page