{"slug": "show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev", "title": "Show HN: A minimal Pareto-optimal OpenRouter model router for pi, based on Jev", "summary": "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.", "body_md": "Jev-classified model routing for pi.\n\n| Role | Model | Thinking | \n|---|---|---|\n| Planning | `anthropic/claude-sonnet-5` | high | \n| Code | `openrouter/pareto-code` | medium | \n| Writing | `openai/gpt-5.4-mini` | low | \n\nWriting tasks get STE and Humanizer rules. Code tasks run unit tests. Planning tasks get a structure check.\n\n```\n/router          show status\n/router shadow   recommend only (default)\n/router auto     switch models per task\n/router off      stop routing\n/router profile pareto_code | empirical_cost\n/router budget <usd>\nnode --experimental-strip-types eval/index.ts\n```\n\nResults: writing 89% cheaper. Code 88% cheaper with `empirical_cost`.\nPlanning 100% pass on `claude-sonnet-5`.\n\n```\nnpm install\n```\n\nSet `OPENROUTER_API_KEY`, or reuse the key stored in `~/.pi/agent/auth.json`.\nCopy `config/models.openrouter.json` into `~/.pi/agent/models.json`.\n\nAuto-load globally:\n\n```\nmkdir -p ~/.pi/agent/extensions\nln -sf ~/Documents/GitHub/pi-jev-router ~/.pi/agent/extensions/pi-jev-router\n```\n\nThen start `pi` normally (no `-e` required).\n\nWorkers dispatched via `dispatch_task` execute in isolated Git worktrees:\n\n- Worker edits code on a separate task branch (`task/<id>` ).\n- If `verifierCommand` passes (exit 0), changes merge cleanly into the repository.\n- If verification fails or aborts, the worktree is cleaned up without leaving dirty changes.\n\n- `src/classifier.ts` — Jev call. One request, five questions.\n- `src/selector.ts` — policy. No model calls.\n- `src/board.ts` — SQLite task state.\n- `src/dispatch.ts` — worker spawn and handshake.\n- `extensions/router.ts` — pi hooks and commands.\n- `eval/` — benchmark tasks, verifiers, runner.", "url": "https://wpnews.pro/news/show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev", "canonical_source": "https://github.com/philippdubach/pi-jev-router", "published_at": "2026-09-20 14:00:17+00:00", "updated_at": "2026-09-20 14:23:07.902724+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-products", "developer-tools"], "entities": ["pi-jev-router", "OpenRouter", "pi", "anthropic/claude-sonnet-5", "openrouter/pareto-code", "openai/gpt-5.4-mini", "Jev"], "alternates": {"html": "https://wpnews.pro/news/show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev", "markdown": "https://wpnews.pro/news/show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev.md", "text": "https://wpnews.pro/news/show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev.txt", "jsonld": "https://wpnews.pro/news/show-hn-a-minimal-pareto-optimal-openrouter-model-router-for-pi-based-on-jev.jsonld"}}