pi-provider-omniroute0.2.0
Registers OmniRoute (diegosouzapw/OmniRoute) as a model provider in the Pi coding agent, with named server profiles
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-provider-omniroute
Pi coding agent extension for OmniRoute, the self-hosted AI gateway.
Install: pi install npm:pi-provider-omniroute
Discovers your OmniRoute models on startup and registers them as the omniroute provider. Supports multiple OmniRoute servers through named profiles.
Features
- Auto-discovery: loads chat models from
/v1/models, with context window, output limit, vision, thinking levels and pricing - Native login:
/login omniroutesaves your key in Pi's auth store - Multiple servers: add profiles such as
work, which becomes theomniroute-workprovider - Fails gracefully: Pi still starts if OmniRoute is down or not logged in yet
Quick start
/login omniroute
/model omniroute/auto
At /login, press Enter to keep the default endpoint (http://localhost:20128/v1) or type another one. Then paste an API key from the OmniRoute dashboard (API Keys).
Thinking
Models that OmniRoute reports as thinking models get Pi's thinking levels, so Pi's thinking selector and extensions such as pi-effort work. The level is sent as reasoning_effort.
| Model | Levels |
|---|---|
Lists effort tiers (chatgpt/gpt-6.2-sol) |
Those tiers, plus off |
No tier list (auto/best-coding) |
low, medium, high, plus off |
Effort variant (chatgpt/gpt-6.2-sol-high) |
Only its own tier. An -ultra variant shows as max |
no-think/..., or marked non-thinking |
None |
off sends none, which turns thinking off. pi-effort's /effort default sends nothing, so the model uses its own default.
Multiple servers
/omniroute add work # prompts for the server URL
/login omniroute-work # save its API key
/model omniroute-work/auto
| Command | Description |
|---|---|
/omniroute |
Open the profile menu |
/omniroute list |
Show profiles and model counts |
/omniroute add <alias> |
Add a server |
/omniroute update <alias> |
Change a server's URL |
/omniroute check <alias> |
Test the connection and refresh models |
/omniroute remove <alias> |
Remove a server (run /logout omniroute-<alias> to delete its key) |
Configuration
| Variable | Default | Description |
|---|---|---|
OMNIROUTE_BASE_URL |
http://localhost:20128/v1 |
Server URL for the default profile |
OMNIROUTE_API_KEY |
— | API key for the default profile (a key saved with /login takes precedence) |
Server URLs are saved in ~/.pi/agent/omniroute.json. API keys stay in Pi's auth store.
Troubleshooting
No OmniRoute models in /model. Check the server with curl http://localhost:20128/v1/models -H "Authorization: Bearer <key>", then run /omniroute check.
400 "exceeds the model's maximum context length". The upstream model accepts less context than OmniRoute reports. Set a smaller context window for that model in ~/.pi/agent/models.json:
{
"providers": {
"omniroute": {
"modelOverrides": { "glm/glm-5.3": { "contextWindow": 400000 } }
}
}
}
For a profile, use its provider name, for example omniroute-work.
License
MIT. See LICENSE.