pi-jev-router
Pi router that classifies each task with Jev via OpenRouter and picks a model from the quality-cost-latency Pareto frontier.
Overview
pi-jev-router (philippdubach) classifies each task with Jev, called through OpenRouter, and routes it to an OpenRouter model balancing quality, cost and latency under a role policy for planning, code and writing. The default mode is shadow, recording what it would pick without switching; /router auto enables switching.
Bare continuations keep the current model without a Jev call. Otherwise one Jev call asks five questions (category, complexity, risk, brief and decompose) with bounded session and repository context. If Jev is confident (0.7 or more) the brief needs clarification, the router abstains and the current model asks. Hard gates remove infeasible models (no tools, small context, sentinel prices, expired previews, measured pass rate below 0.65, too few runs for risky tasks), then a Pareto frontier over quality, cost and latency is built and a weighted value function picks, with the knee recorded for diagnostics. Quality comes from measured pass rates smoothed toward an external index prior.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Task category (including planning and writing) | — |
| Score | Complexity | — |
| Score | Risk | — |
| Yes / no | Does the brief need clarification? | yes · no |
How it works
- Skip Jev for bare continuations.
- Ask five classification questions in one call.
- Abstain if clarification is needed; otherwise gate eligible models.
- Pick from the Pareto frontier with weighted value.
Strengths
- Shadow mode by default.
- Measured quality with priors.
- Abstains instead of guessing on unclear briefs.
Caveats
- Relies on OpenRouter catalogue and eval data.
- Complex policy to tune.
Getting started
Install the extension into Pi with an OpenRouter key; use /router auto to enable switching.At a glance
- Type
- Project
- Status
- beta
- Language
- TypeScript
- Runtime
- Pi extension
- Has code
- yes
Use cases and integrations
How curated lists describe it
A minimal Pareto-optimal OpenRouter model router for pi, based on Jev.
hellogumbo/awesome-jevRanks the OpenRouter catalogue per task, takes the Pareto frontier over quality, cost and latency, and routes pi to the knee point.
MrJev/awesome-jev
Frequently asked questions
Does it switch models by default?
No, it starts in shadow mode.
How is a model chosen?
From the Pareto frontier over quality, cost and latency using a weighted value function.
What happens on vague requests?
If Jev is confident clarification is needed, it does not switch and the current model asks.
Related projects
TypeScript/Bun launcher that asks Jev which model and reasoning effort each Codex, Claude Code or Pi turn should use.
ProjectbetaTypeScriptCLI, Claude Code plugin and Pi virtual model that pick the right model per prompt from one Jev call with a complexity floor.
PluginbetaTypeScriptOh My Pi extension where Jev classifies each prompt as simple or advanced and switches the model role, defaulting to advanced on doubt.
PluginbetaTypeScriptPi extension routing plan and implementation phases to light, standard or heavy model tiers based on a Jev capability score.
ProjectbetaTypeScriptPi extension asking Jev four questions per prompt (task kind, complexity, capability, deep reasoning) to pick a budget-aware model tier.
ProjectbetaTypeScriptPi model router using Jev via Vercel AI Gateway to pick a model and reasoning effort once per session, then stay pinned.
ServicebetaTypeScript