pi-jev-router
A Pareto-optimal OpenRouter router for Pi, decided by Jev.
Philipp Dubach’s router asks Jev what a task needs, then picks the cheapest OpenRouter model on the quality-and-price frontier that meets it.
# pi-jev-router: a minimal Pareto-optimal OpenRouter model router for pi, based on Jev Jev-classified model routing for pi. ## Model rules The router ranks the whole OpenRouter catalog for each task. It filters the catalog to models that fit the task, computes a Pareto frontier over quality, cost and latency, then picks the knee point. The knee is the frontier member farthest from the chord that joins the cheapest and dearest models. It needs no weights, so the pick follows the catalog and the recorded evidence on every task. A frontier too small or too flat for a knee falls back to a weighted value function. Quality blends recorded runs from `eval/results` with the Artificial Analysis index. Writing quality uses the EQ-Bench Creative Writing v3 Elo in `src/writing-prior.ts` instead, because a general intelligence index says nothing about prose. Cost is a per-task estimate from catalogue prices, replaced by recorded mean cost as runs accumulate. Latency uses recorded means when they exist. There is one selection policy. `src/selector.ts` holds a small fallback table for the case where the catalog cannot be fetched and no frontier exists. Writing tasks get STE and Humanizer rules. Code tasks run unit tests. Planning tasks get a structure check. ## Commands ```text /router show status /router shadow recommend only (default) /router auto switch models per task /router off stop routing /router frontier show the frontier for the last decision /router pin <id> force a model /router pin off release the pin /router budget <usd> /router test classify a sample task and show the pick ``` ## Benchmarks ```bash npm run bench # fixed baseline vs frontier router npm run bench -- --all # adds the pinned role arm as a third con