pi-precision-router0.1.1
Quality-first, concrete-model routing before every Pi model step
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 Precision Router
Per-step model and thinking-level routing for Pi, powered by TypeSafe Jev.
Why · Install · Use · How it works
🤔 Why
One model and one thinking level rarely fit every step of a session. Hard reasoning deserves your strongest model; routine follow-ups after tool calls do not.
This extension asks TypeSafe Jev to choose a model and thinking level before each agent step, including follow-ups after tool calls. You define the candidates and your priorities; Jev picks among them.
📦 Install
Install the published npm package. Requires Pi 0.87.1+ and Node 22.19+.
pi install npm:pi-precision-router
🔑 Export your TypeSafe API key, start Pi, then run the setup skill:
export TYPESAFE_API_KEY="your-api-key"
/skill:precision-router-setup
The agent discovers available providers and models, helps choose your model/effort roster, and asks before saving a global or project config. If Pi is already running, use /reload to discover the installed skill.
Prefer manual setup? Copy the example config to ~/.pi/agent/pi-precision-router.json and replace the placeholders.
🧭 Use
Routing starts enabled. Manual model selection does not pause routing.
| Command | Action |
|---|---|
/precision-router off |
Pause routing. |
/precision-router on |
Resume routing. |
/precision-router feedback on |
Show per-turn routing decisions. |
/precision-router feedback off |
Hide per-turn routing decisions. |
Feedback commands override notifyDecisions for the current session without changing your config or pausing routing. A new session or extension reload restores the config default.
There are no built-in model choices. Your config defines:
| Field | Purpose |
|---|---|
models |
Provider, model ID, description, and effortMap for each candidate. |
efforts |
Effort labels and descriptions Jev chooses between. |
preferences |
Your routing priorities. |
jevModel |
TypeSafe evaluator model; defaults to jev-latest. |
notifyDecisions |
Show a notification for every routing attempt; defaults to false. |
Each model's effortMap must cover every effort label and use thinking levels that model supports: off, minimal, low, medium, high, or xhigh. For models without reasoning, map every label to off.
[!TIP] Project settings in
.pi/pi-precision-router.jsonoverride global settings. Arrays and objects are replaced, not merged. Config is reread each turn.PI_CODING_AGENT_DIRoverrides the global config directory.
🔍 How it works
Before each agent step, the router sends Jev a routing request and applies the chosen model and effort without confidence thresholds. Only configured, available models can be selected. Missing configuration, invalid responses, or a Jev timeout leave your current settings unchanged.
Jev requests have a two-second timeout and no retries. An already-started Pi model switch can take longer and cannot be cancelled by the extension.
Each routing request sends TypeSafe excerpts of your current request, recent messages (including tool results), system/project instructions, model descriptions, and preferences. Images and reasoning blocks are excluded.
[!WARNING] These excerpts may contain private code or instructions. Use this extension only where sending that content to TypeSafe is acceptable.
Released under the MIT License · Contributing · Security