Codex routing proxy picks models per call, but its 60% savings claim is only a backtest
on: 0xNatoshi/jev-codex-router
The routing problem this project solves is specific: OpenAI's Codex desktop client sends every model call to whatever model you've selected, with no awareness of whether the next call is a quick mechanical step or an independent architectural review. This repo inserts a local proxy between Codex and the backend that asks a separate classifier — Jev, from TypeSafe — to pick both the model tier and the thinking effort for each individual call before it goes out.
The four-tier ladder is Luna → Terra → Sol → Astra, roughly economical to frontier. Jev receives a compact decision dossier: the active task, step type, and a short tail of relevant context. It does not see the full conversation thread. The executing model, by contrast, gets the complete canonical replay unchanged — only the model selection, effort level, and service tier are swapped in. This two-projection design is the core architectural choice, and the README is careful to say that the decision dossier is bounded deliberately, citing TypeSafe's own guidance that irrelevant state reduces accuracy.
The routing policy is more nuanced than a simple complexity classifier. It handles four independent questions per call: whether the mandatory Astra policy applies, which capability tier is sufficient, what thinking depth is needed, and how long the route lease should hold. Mandatory Astra covers project architecture, independent final code review, and risk-focused review — security, auth, concurrency, migrations, public API compatibility, material performance risks. The word "review" alone does not force Astra; only those specific categories do. Routine quality checkpoints and score comparisons use ordinary routing.
The historical simulation showing roughly 60% quota reduction against always-Astra is flagged prominently as a backtest on 237 turns under an old policy, not a measured result under the current one. The README is unusually direct about this: it calls out that counterfactual token volumes and task quality have not been experimentally measured, that the model descriptions are capability priors rather than calibrated success rates, and that schema checks and synthetic routing samples establish wiring, not equal-quality savings. That level of epistemic honesty in a README is uncommon.
Fail-open behavior is layered throughout. A Jev error keeps the turn alive with a fallback to Astra at medium effort. A sentinel file bypasses Jev entirely. Native quota exhaustion triggers a separate discovery path that finds at most two local or configured candidates, explicitly excluding the jev/auto route to prevent recursion. Local Ollama models qualify only when their runtime answers and a prior real-Codex capability check passed.
The project is a macOS-only monorepo requiring Node.js 22.19+ and Python 3.11+, plus a TypeSafe API key. It embeds a fork of Codex Router directly under router/ rather than pulling it as a submodule. Code comments are currently in French, the author's working language. The status section is candid: early, running on the author's own setup, needing outcome calibration on real usage.
A per-call model router for Codex that's unusually honest about what its backtest does and doesn't prove.