@gzgz/pi-deeprelay-provider0.1.0
DeepRelay provider for pi: full chat and image model catalog with subscription quota status.
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.
Reports 0
No reports yet.
Readme
pi-deeprelay-provider
A pi provider for DeepRelay. It adds the full DeepRelay chat and image catalog. It also shows your flat-plan quota in a status widget.
What it does
- Reads the model catalog from
https://api.deeprelay.ai/v1/models. - Maps chat models to pi's
openai-completionsAPI. This includes tools, vision, andreasoning_effort. - Maps image models to a small OpenAI-compatible image API.
- Marks models that the flat plan covers with an
(included)suffix in the name. - Shows monthly and weekly quota, and the reset countdown.
pi drives the catalog refresh. It refreshes providers when you open /model and after /login. The extension also ships a snapshot as a fallback for the first offline start.
Requirements
- pi 1.1.0 or later.
- A DeepRelay API key.
Install
Install from npm:
pi install npm:@gzgz/pi-deeprelay-provider
Or install via Pi's Git provider:
pi install git:github.com/GZGavinZhao/pi-deeprelay-provider
Or install it locally after cloning this repository:
pi install <path-to-cloned-pi-deeprelay-provider>
Authentication
Run /login deeprelay in pi. The login flow checks the key against /v1/models before pi saves it to ~/.pi/agent/auth.json.
You can also write the credential directly:
{
"deeprelay": { "type": "api_key", "key": "deeprelay_live_..." }
}
pi uses DEEPRELAY_API_KEY as a fallback for CI and other non-interactive use.
Models
Use /model and search for deeprelay. Model IDs keep the API prefix, for example deeprelay/glm-5.3.
The flat plan covers four models at the time of writing:
deeprelay/deepseek-v4.1-flashdeeprelay/glm-5.3deeprelay/glm-5.3-flashdeeprelay/kimi-k3
These models show an (included) suffix. All other models use pay-as-you-go credit. Without credit, they return an insufficient_balance error.
Quota widget
The widget appears below the editor while a DeepRelay model is active. It uses the theme's dim color, like the footer. One line shows:
- The plan name.
- Weekly input and output usage as a percentage of the weekly quota.
- Monthly input and output usage as a percentage of the monthly quota.
- The time until the next weekly and monthly reset.
- The number of pay-as-you-go calls in the last 24 hours.
Commands
| Command | Function |
|---|---|
/deeprelay |
Show the quota detail. |
/deeprelay refresh |
Refresh the catalog and the quota now. |
/deeprelay models |
Show the number of chat and image models. |
pi update --models does not load extensions. It does not refresh this provider. Use /model, /login, or /deeprelay refresh instead.
Catalog snapshot
src/catalog-snapshot.json is a bootstrap fallback. The extension uses it only before the first successful network refresh.
Run this command to update the snapshot:
DEEPRELAY_API_KEY=... npm run snapshot
Development
npm install
npm run typecheck
Limits
- pi cannot drive video or embedding models. The provider omits them.
- The provider maps DeepSeek V4.1 Flash to its off-peak rate. It ignores the peak windows.
- pi tracks cost per token. Image models bill per image, so the provider reports image cost as zero.