Catalog npm
PACKAGE EXPLORERView in registry

9router-pi

npm

Dynamic 9router model discovery for Pi Coding Agent

9routercustom-providermodel-discoverypipi-coding-agentpi-extensionpi-package
Versions collected1
Direct dependencies2From release 0.2.0
Last observed20 Oct, 21:41 UTC

README

Current package documentation

9router-pi

Use models exposed by a local 9router OpenAI-compatible gateway in Pi Coding Agent. The extension discovers the gateway's current model list from /v1/models, including model limits, vision support, and reasoning capability.

What it provides

  • Pi provider: 9router
  • Dynamic discovery at startup
  • /9router-pi refresh to fetch the latest catalog without restarting Pi
  • /9router-pi status and /9router-pi help
  • Static models.json entries remain usable when startup discovery is unavailable or PI_OFFLINE is set

Prerequisites

  1. A 9router instance running at http://localhost:20128/v1 (or another configured URL).
  2. Pi API-key configuration for provider 9router.

The discovery endpoint is currently queried without authentication. The API key is used for model requests through Pi.

Configuration

Add the provider credentials to ~/.pi/agent/models.json:

{
  "providers": {
    "9router": {
      "baseUrl": "http://localhost:20128/v1",
      "api": "openai-completions",
      "apiKey": "$NINE_ROUTER_API_KEY"
    }
  }
}

Pi also supports a literal apiKey. Do not commit real keys to this repository.

Optional environment variables:

  • PI_9ROUTER_BASE_URL — overrides the models.json gateway URL and default.
  • NINE_ROUTER_API_KEY — supplies the request key and overrides the models.json key when set.
  • PI_9ROUTER_FREE_ONLY — when set (default: true), only models marked as free by the 9router gateway are exposed. Set to 0 or false to include paid models as well.

Install from this repository

From the repository root:

pi -e ./extensions/9router-pi

Or install it persistently:

pi install -l ./extensions/9router-pi

Then run /reload in Pi (or restart it).

Usage

List discovered models:

pi --list-models 9router

Select a model:

pi --provider 9router --model openrouter/stealth/ox-alpha

Refresh after changing the models enabled by 9router:

/9router-pi refresh

Use /9router-pi status to see the discovery count and last error, if any.

In the TUI, bare /9router-pi opens a read-only menu with provider status, non-secret configuration-source presence, registered model count and registry-availability count, navigation/help, and Close. The panel never refreshes the catalog, tests the gateway, logs in, selects a model, or edits environment/model-file configuration; API keys, URLs, stderr, and user emails are not displayed. Escape or Close exits the panel. Detail views show one short display segment per page (long records continue on the next page without losing text); use Previous/Next to navigate and Back to return to the sections. Non-TUI bare /9router-pi and every explicit subcommand keep their existing behavior.

Development

cd extensions/9router-pi
npm install
npm test

The extension uses Pi's openai-completions API adapter and registers models returned by the gateway. The repository intentionally contains no API keys.

License

MIT — same as pi-extensions.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.0Registry latest28 Sept 20262

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
luongnv89/pi-extensions

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:41 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:045f38fae6991e657df129323b14649a94ca9bdafe8220aa461759c243a4fb53