cd /news/ai-agents/show-hn-a-minimal-pareto-optimal-ope… · home topics ai-agents article
[ARTICLE · art-135126] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: A minimal Pareto-optimal OpenRouter model router for pi, based on Jev

A developer released pi-jev-router, a minimal Pareto-optimal OpenRouter model router for the pi coding agent that classifies tasks with a single Jev call and assigns models per role: anthropic/claude-sonnet-5 for planning, openrouter/pareto-code for code, and openai/gpt-5.4-mini for writing. The project reports writing tasks 89% cheaper and code tasks 88% cheaper under the empirical_cost profile, with planning scoring 100% pass on claude-sonnet-5. Workers dispatched via dispatch_task run in isolated Git worktrees on task/<id> branches and merge only when verifierCommand exits 0.

read1 min views1 publishedSep 20, 2026
Show HN: A minimal Pareto-optimal OpenRouter model router for pi, based on Jev
Image: Michielbdejong (auto-discovered)

Jev-classified model routing for pi.

Role Model Thinking
Planning anthropic/claude-sonnet-5 high
Code openrouter/pareto-code medium
Writing openai/gpt-5.4-mini low

Writing tasks get STE and Humanizer rules. Code tasks run unit tests. Planning tasks get a structure check.

/router          show status
/router shadow   recommend only (default)
/router auto     switch models per task
/router off      stop routing
/router profile pareto_code | empirical_cost
/router budget <usd>
node --experimental-strip-types eval/index.ts

Results: writing 89% cheaper. Code 88% cheaper with empirical_cost. Planning 100% pass on claude-sonnet-5.

npm install

Set OPENROUTER_API_KEY, or reuse the key stored in ~/.pi/agent/auth.json. Copy config/models.openrouter.json into ~/.pi/agent/models.json.

Auto-load globally:

mkdir -p ~/.pi/agent/extensions
ln -sf ~/Documents/GitHub/pi-jev-router ~/.pi/agent/extensions/pi-jev-router

Then start pi normally (no -e required).

Workers dispatched via dispatch_task execute in isolated Git worktrees:

  • Worker edits code on a separate task branch (task/<id> ).

  • If verifierCommand passes (exit 0), changes merge cleanly into the repository.

  • If verification fails or aborts, the worktree is cleaned up without leaving dirty changes.

  • src/classifier.ts — Jev call. One request, five questions.

  • src/selector.ts — policy. No model calls.

  • src/board.ts — SQLite task state.

  • src/dispatch.ts — worker spawn and handshake.

  • extensions/router.ts — pi hooks and commands.

  • eval/ — benchmark tasks, verifiers, runner.

── more in #ai-agents 4 stories · sorted by recency
── more on @pi-jev-router 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-a-minimal-pa…] indexed:0 read:1min 2026-09-20 ·