Install
Install with PiG
pig install npm:@ody./pi-llmgatewayInstall with Pi
pi install npm:@ody./pi-llmgatewayPackages 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": [
"./src/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.
pi-llmgateway
A pi extension that adds LLM Gateway as a model provider for DevPass and pay-as-you-go keys.
Install
pi install npm:@ody./pi-llmgateway
To run from a checkout, pass pi -e ./src/index.ts.
Authentication
Create an API key in the LLM Gateway dashboard, then do one of the following:
- Run
/login, choose LLM Gateway, and paste the key. pi stores it in~/.pi/agent/auth.json. - Set
LLMGATEWAY_API_KEYin your environment.
Model selection
Open /model and filter by llmgateway or by author, such as anthropic/. On the command line, pass --model llmgateway/anthropic/claude-sonnet-4-6.
- Live catalog: Includes active text models that stream and call tools. Refreshes at most once an hour or when the API key changes.
- Billed cost: Sets each completed message's total cost to the USD amount LLM Gateway charged instead of the list-price estimate.
Commands
Run /llmgateway for interactive configuration, or use the typed commands with Tab completion. All settings live in ~/.pi/agent/llmgateway.json and apply immediately.
| Command | Purpose |
|---|---|
/llmgateway | Open the settings menu for routing, per-model overrides, pins, footer statuses, and plan refresh |
/llmgateway-usage | Show pay-as-you-go spend or DevPass meters and reset timers |
/llmgateway-routing | Show or set routing strategy, service tier, and cross-provider fallback |
/llmgateway-pin | Show or pin a model to a serving provider or region |
Routing and provider pins
Configure defaults or per-model overrides in /llmgateway, or run /llmgateway-routing and /llmgateway-pin:
| Command | Effect |
|---|---|
/llmgateway-routing | Show effective routing for default and configured models |
/llmgateway-routing <default|model> sort <auto|price|throughput|latency> | Set the routing strategy |
/llmgateway-routing <default|model> tier <auto|default|flex|priority> | Set the service tier |
/llmgateway-routing <default|model> fallback <on|off> | Turn cross-provider failover on or off |
/llmgateway-routing <default|model> reset | Remove routing overrides and keep any pin |
/llmgateway-pin [model] | Show all pins, or one model's pin and pinnable provider[:region] options |
/llmgateway-pin <model> <provider[:region]|off> | Set or remove a model's pin |
Plan and gateway rules apply in both the menu and typed commands:
- DevPass: Accepts
sortvaluesautoandprice,tiervaluesauto,default, andflex, and no provider pins. - Pay-as-you-go: Accepts every strategy, every tier, and any provider or
provider:regionlisted for the model. - Pinned requests: Omit
sortbecause the gateway rejects combining a strategy with a pin. Setfallback offto stop low-uptime failover. Pins can also reach deployments with smaller context windows. - Ignored values: Requests omit stored settings that your plan or catalog rejects, and show commands mark them
(ignored ...).
Footer statuses
The extension sets no footer status by default. Toggle keys under Footer statuses in /llmgateway, or list them in "footer" in ~/.pi/agent/llmgateway.json.
| Key | Example | Shows |
|---|---|---|
llmgateway-provider | aws-bedrock:eu | Serving provider and region of the last response |
llmgateway-day | day 3.10/14.22 | DevPass daily meter |
llmgateway-premium | prem 5.00/18.96 | DevPass weekly premium meter |
llmgateway-month | mo 25.00/158.00 | DevPass monthly meter |
llmgateway-spend | $31.42/$50.00 | Pay-as-you-go spend and key limit |
llmgateway-premium-model | ★ | Selected model costs at least $5/M input or $15/M output |
Only keys that match your active plan render, and switching away from llmgateway clears every status.
License
MIT