@kshlm/pi-devpass-provider
v0.1.2
Published
pi extension: LLM Gateway / DevPass provider with auto-fetched models, rates, and credit balance
Downloads
43
Readme
@kshlm/pi-devpass-provider
A pi extension that registers a devpass model provider backed by LLM Gateway and the DevPass coding plan.
- Models and $/M rates are fetched live from the gateway at startup, with a 24 h on-disk cache and stale fallback when offline
- DevPass credit balance shows in the status line as
devpass balance $<balance>while adevpass/*model is active /devpassprints the full key status, loaded-model count, and premium credit usage
Install
pi install npm:@kshlm/pi-devpass-providerOr from a local checkout:
pi install /abs/path/to/pi-devpass-providerSetup
- Get a DevPass plan key (
llmgtwy_...) from https://devpass.llmgateway.io. - Make it available to pi, either by running
/login devpassinside pi and pasting the key (stored in~/.pi/agent/auth.json), or by exporting it:
export LLM_GATEWAY_API_KEY=llmgtwy_...A saved /login credential takes precedence over the environment variable.
Usage
/model: pick adevpass/*model. DevPass plan keys use root model ids (claude-sonnet-4-5); provider-pinned ids (anthropic/...) are unavailable on coding plans./devpass: show the credit balance and key status at any time.
Configuration
| Variable | Purpose |
| --- | --- |
| LLM_GATEWAY_API_KEY | DevPass plan key, used when no /login devpass credential is saved |
| LLM_GATEWAY_BASE_URL | Override the gateway base URL (default https://api.llmgateway.io/v1), e.g. for a self-hosted gateway or proxy |
Notes
- The model catalog is cached at
~/.pi/agent/cache/devpass-models-*.json(24 h TTL, keyed per base URL)./v1/modelsis public, so models load even without a key; requests and the balance display still need one. - Rates shown by pi are for display and cost tracking only; the gateway meters and bills your actual usage.
- A missing or invalid key never crashes pi: the provider registers with zero models and the status line carries the error.
Development
npm install
npm run check # tsc --noEmit + selfcheck assertsTry it live with pi -e ., then /login devpass and /model.
