pi-tokenrouter-provider0.1.0
Pi extension + token-router fork that adds tokenrouter.com as a model provider for pi
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 TokenRouter Provider
A fork of token-router adapted to add tokenrouter.com as a model provider for pi.
It keeps the original lossless local line-routing Python router (scripts/router.py) and adds a TypeScript extension that lets you use tokenrouter.com models directly from pi.
Installation
From npm (appears in the Pi package gallery):
pi install npm:pi-tokenrouter-provider
From GitHub:
pi install git:github.com/rharagon/pi-tokenrouter-provider
Or with a local path for development:
pi -e ./pi-tokenrouter-provider
Authentication
Get an API key from your tokenrouter.com dashboard.
Then set it as an environment variable:
export TOKENROUTER_API_KEY=sk-...
On Windows PowerShell:
$env:TOKENROUTER_API_KEY="sk-..."
Or authenticate interactively in pi:
/login tokenrouter
and paste the API key when prompted.
Usage
Select a model:
/model tokenrouter
or start pi directly with:
pi --provider tokenrouter --model gpt-4o
Model discovery runs at startup and is cached. If the catalog is unreachable, the cached list is used as a fallback.
Refresh the model list:
/tokenrouter-refresh
Original token-router
The router still works as a standalone Python tool. See scripts/router.py and the original docs in docs/token-router/. A Pi skill is also included under skills/token-router/.
License
MIT