@bacnh85/pi-9router
v0.1.8
Published
Pi extension that connects to a 9router AI routing proxy instance via its OpenAI-compatible API.
Maintainers
Readme
@bacnh85/pi-9router
Pi extension for 9router — connect to your 9router AI routing proxy instance.
Install
pi install npm:@bacnh85/pi-9routerUsage
Configure connection
/login-9routerPrompts for:
- Endpoint URL (default:
http://localhost:20128/v1) - API key (required if your 9router has
REQUIRE_API_KEY=true)
Once configured, models from 9router appear in Pi's /model picker under the 9router/ provider prefix.
Toggle reasoning/thinking levels
/9router-reasoningToggles Pi thinking-level support for 9router models ON/OFF.
When ON, use Shift+Tab, --thinking high, or model suffixes like
9router/...:high to control reasoning_effort sent to 9router.
Check status
/9router-statusShows connection status, model count, and current configuration.
Environment variables
| Variable | Default | Description |
|----------|---------|-------------|
| NINE_ROUTER_BASE_URL | — | Overrides saved endpoint URL |
| NINE_ROUTER_API_KEY | — | Overrides saved API key |
| NINE_ROUTER_ENABLE_REASONING | — | Overrides saved reasoning toggle (true/false) |
How it works
- On startup, loads config from
~/.pi/agent/9router-config.jsonand registers the9routerprovider - Models are fetched dynamically from
GET /v1/modelson first use - Pi's built-in OpenAI completions API handles all streaming and tool calling
- No built-in providers are overridden —
9router/models are a separate namespace
Changelog
See CHANGELOG.md for release history.
License
MIT
