@qmahyar/pi-9router
Connect pi to 9Router — multi-provider chat models plus image, speech, search, and fetch tools
Package details
Install @qmahyar/pi-9router from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@qmahyar/pi-9router- Package
@qmahyar/pi-9router- Version
1.2.1- Published
- Jul 26, 2026
- Downloads
- 269/mo · 269/wk
- Author
- qmahyar
- License
- MIT
- Types
- extension
- Size
- 106.5 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/9router.ts",
"./extensions/9router-tools.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Install
pi install npm:@qmahyar/pi-9router
Or from git:
pi install git:github.com/QMahyar/pi-9router
Requires a running 9Router instance (npm i -g 9router → default http://localhost:20128).
What you get
| Command | Role |
|---|---|
/9router |
Connect · full/quick sync · diagnose · register chat models as provider 9router |
/9router-tools |
Enable tools · set default models · output folder |
| Tool | On by default | Does |
|---|---|---|
nr_image_generate |
Yes | Text → image file |
nr_tts |
Yes | Text → speech file |
nr_web_search |
Yes | Live web search |
nr_web_fetch |
Yes | URL → markdown |
nr_embed |
No | Text → embeddings |
Off tools leave the model context. Only enabled tools expose schema + usage guidelines to the agent.
Model names
Sync uses smart enrich: when a list row already has name + capabilities (common
for chat), it skips /v1/models/info. Thin rows still get a lookup so display names
are real — openrouter/openai/tts-1-hd shows as TTS-1 HD, not "Openai/Tts 1 Hd".
- Full sync — all tool catalogs + voice TTS probes
- Quick sync — chat only (keeps previous image/tts/web catalog)
- Diagnose — health, per-kind latency, sample info, voice probes
Each tool description lists available ids (and params when known). A model
argument is resolved locally first — nano-banana maps to a real id or fails with
candidates listed, instead of No credentials for provider: nano.
edge-tts / google-tts are free and absent from /v1/models/tts. Full sync
probes them and only adds live ones.
60-second start
1. 9router # start the gateway
2. /9router → Sync models (full catalog)
3. /model → provider 9router
4. /9router-tools → pick defaults
Optional: Quick sync when you only need chat models refreshed; Diagnose when something is slow or voice TTS is missing.
Pair with Exa (optional)
For dedicated Exa neural search with multi-key rotation (separate from 9Router’s web tools):
pi install npm:@qmahyar/pi-exa-search
→ @qmahyar/pi-exa-search · npm
Use one search stack at a time if you want to avoid overlapping tools.
Docs
| Doc | |
|---|---|
| Setup | Install, first run, env vars |
| Usage | Menus, tools, on/off behavior |
| Dev | Layout for contributors |
Links
License
MIT