← Catalog

pi-precision-router

Quality-first, concrete-model routing before every Pi model step

Package

Install

Install with PiG

pig install npm:pi-precision-router

Install with Pi

pi install npm:pi-precision-router
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.2 (README.md). PiG does not review it.

🎯 Pi Precision Router

Per-step model and thinking-level routing for Pi, powered by TypeSafe Jev.

CI npm version npm downloads Node TypeScript License

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.

CommandAction
/precision-router offPause routing.
/precision-router onResume routing.
/precision-router feedback onShow per-turn routing decisions.
/precision-router feedback offHide 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:

FieldPurpose
modelsProvider, model ID, description, and effortMap for each candidate.
effortsEffort labels and descriptions Jev chooses between.
preferencesYour routing priorities.
jevModelTypeSafe evaluator model; defaults to jev-latest.
notifyDecisionsShow 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.json override global settings. Arrays and objects are replaced, not merged. Config is reread each turn. PI_CODING_AGENT_DIR overrides 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.