@arhen/pi-add-9router

Pi Coding Agent extension for 9router — provider registration and model discovery only, no web tools

Packages

Package details

extension

Install @arhen/pi-add-9router from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@arhen/pi-add-9router
Package
@arhen/pi-add-9router
Version
1.0.1
Published
Aug 17, 2026
Downloads
257/mo · 194/wk
Author
arhen
License
MIT
Types
extension
Size
44.6 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-9router

npm version npm downloads License: MIT GitHub stars

Install

Requires the pi coding agent — install it first: npm install -g @earendil-works/pi-coding-agent.

pi install npm:@arhen/pi-9router

Pi Coding Agent extension for 9router — AI routing proxy.

Registers 9router as a Pi provider with dynamic model discovery. Provider only, no web tools — use pi-web-access for web search/fetch.

Features

  • Auto-discovers models and combos from 9router /v1/models on startup
  • Registers 9router provider with dynamic base URL + API key
  • Cached discovery (fast startup, credential-fingerprinted)
  • models.dev metadata enrichment (context window, max tokens, input modalities)
  • Reasoning support (thinkingLevelMapreasoning_effort)
  • Commands: /9router-status, /9router-models, /9router-config, /9router-reasoning, /9router-reload

Environment

Variable Default Description
NINE_ROUTER_BASE_URL http://localhost:20128 9router endpoint
NINE_ROUTER_API_KEY API key if 9router requires auth
NINE_ROUTER_ENABLE_REASONING 1/true to expose thinking levels

Config persists to ~/.pi/agent/9router-config.json (shared across Pi instances).

Commands

Command Purpose
/9router-config Configure base URL, API key, reasoning
/9router-status Connection status, model counts
/9router-models Browse models/combos and switch
/9router-reasoning Toggle thinking levels
/9router-reload Re-discover models

Why not pi-9router-ext?

pi-9router-ext bundles the same provider plus web tools (ninerouter_web_search, ninerouter_web_fetch) and web-route discovery (~1.2K tokens extra in context). This package is the provider flow only — same config file format, same env vars, so they're drop-in interchangeable.

License

MIT