pi-jev-model-router
Pi extension asking Jev four questions per prompt (task kind, complexity, capability, deep reasoning) to pick a budget-aware model tier.
Overview
pi-jev-model-router routes every Pi prompt to a task-appropriate model. Before the turn, Jev answers four questions in one request: task_kind (plan, implement, debug, refactor, review, research, explain, operate, write, chat), complexity from trivial to architectural, capability_deserved from minimal to maximum ignoring price, and needs_deep_reasoning as a yes/no probability.
Code then composes demand (0.55 complexity plus 0.45 capability, plus a reasoning nudge), applies per-kind floors so planning and review never go cheap, and passes confidence, budget, availability and cache guards before switching the model and thinking level. Daily and monthly caps downgrade tiers automatically; each tier is a candidate chain so unavailable models fall through. The transcript shows the chosen model and the reasons. It fails open by default, with opt-in quota protection. The README sums it up as Jev judges the task, code owns the budget. MIT licensed.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | task_kind | plan · implement · debug · refactor · review · research · explain · operate · write · chat |
| Score | complexity (trivial to architectural) | — |
| Score | capability_deserved (minimal to maximum) | — |
| Yes / no | needs_deep_reasoning | yes · no |
How it works
- Ask four questions in one Jev request.
- Compose demand and apply kind floors.
- Apply confidence, budget, availability and cache guards.
- Set model and thinking level; record the reason.
Strengths
- Budget caps enforced in code.
- Transparent per-prompt reasons.
- Fallback chains per tier.
Caveats
- Requires credentials for all tier models.
- Fails open by default.
Getting started
pi install npm:pi-jev-model-router and set your TypeSafe key.At a glance
- Type
- Project
- Status
- beta
- Language
- TypeScript
- Runtime
- Pi extension
- Has code
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Route pi prompts to task-appropriate model tiers with TypeSafe Jev typed judgments. Budget-aware, with automatic fallback.
logicrw/awesome-jev-projectsRoute pi prompts to task-appropriate model tiers with TypeSafe Jev typed judgments. Budget-aware, with automatic fallback.
hellogumbo/awesome-jevReads each pi prompt with four typed questions before the turn starts and picks a model tier, with a budget and an automatic fallback.
MrJev/awesome-jev
Frequently asked questions
What does Jev decide?
Task kind, complexity, deserved capability and whether deep reasoning is needed.
Who controls spending?
Code applies budget caps; Jev only judges the task.
What if a model is unavailable?
The next model in the tier's chain is used.
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 model router using Jev via Vercel AI Gateway to pick a model and reasoning effort once per session, then stay pinned.
ServicebetaTypeScriptPi router that classifies each task with Jev via OpenRouter and picks a model from the quality-cost-latency Pareto frontier.
ProjectbetaTypeScript