omp packages

@ody./pi-llmgateway0.1.0

LLM Gateway as a native pi model provider: live catalog, routing preferences, billed cost and DevPass usage.

ody. Published 14 days ago MIT ~262 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

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_KEY in 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 sort values auto and price, tier values auto, default, and flex, and no provider pins.
  • Pay-as-you-go: Accepts every strategy, every tier, and any provider or provider:region listed for the model.
  • Pinned requests: Omit sort because the gateway rejects combining a strategy with a pin. Set fallback off to 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