Skip to content
System One

0xNatoshi/jev-codex-router

Per-call model routing for Codex: Jev answers four choice questions to pick the model tier and thinking depth, so the cheapest sufficient model serves each call. A 7-day replay of 237 real turns measured about 60% savings against always using Astra, under an older policy.

0xNatoshi/jev-codex-router on GitHub

Stars
262
Forks
31
Language
JavaScript
License
MIT
Last push
22 Sep 2026

Read from GitHub on . Counts change daily.

Reported by the author

Historical replay
~-60% costHistorical simulation: ≈ −60 % vs full Astra on 237 turns under the old policy.github.com

Jev Codex Router routes each Codex model call, including continuations after a tool runs, through a decision Jev makes: which model to use and how much thinking effort to give it, always at standard speed. The goal is enough capability for the next decision without spending quota unnecessarily. It is built as a self-contained monorepo around a maintained fork of Codex Router, connected to Jev through that fork’s generic-provider extension points, so there is no second checkout or hidden source clone to manage.

Each request asks Jev four choice questions: whether the call falls under a mandatory policy for the top model, Astra (architecture, final code review, risk-focused review); the cheapest sufficient tier among Luna, Terra, Sol and Astra; the minimum thinking depth; and how long the route should last (one call, a tool chain, or the whole user turn). Jev sees only a bounded decision state, while the executing model gets the full history Codex would normally send, including tool calls and results. Any Jev error fails open to a fallback route, and a local sentinel file can switch Jev routing off instantly.

The repository’s historical simulation, replaying 237 real turns from a week of use, measured about a 60% cost reduction against always using Astra. The maintainers say this was under an older policy and is not measured Codex quota savings or evidence for the current policy.

How it uses Jev

DISPLAY_NAME = "Jev Codex Router"
VERSION = "1.5"

API = "https://api.typesafe.ai/v1/systemone"
MODEL = "jev-latest"


# Generic ask surface (POST /ask): a thin typed pass-through to System One for
# callers that own their question set — the in-app browser chooser is the first
# one. No routing policy, no logging of the caller's state.
ASK_PATHS = ("/ask", "/v1/ask")
ASK_MAX_BYTES = 256 * 1024
ASK_MAX_STATE_CHARS = 120_000
ASK_MAX_QUESTIONS = 40
ASK_TIMEOUT = 15.0

View in server/jev_server.py

Open on GitHub

More like this

Use cases this is tagged with