jev-cc-codex-router
Single-file Python proxy that asks Jev which model tier each Codex turn needs, rewrites the model, and escalates on failures.
Overview
jev-cc-codex-router is a single-file Python proxy that sits between Codex and any OpenAI Responses API-compatible upstream, such as a local gateway or remote endpoint, and routes each turn to the cheapest model tier that can handle it. On every new user turn it sends Jev the current message plus recent conversation (up to 50 turns and about 4,200 characters, with tool calls and system prompts removed) and asks for one of four tiers, luna, terra, sol or astra, mapped to configurable model names and stored per session.
Tool-result follow-ups reuse the stored model with no extra Jev call, and bare continuation words such as continue or retry reuse the previous tier. If a tool output shows a clear failure, such as a traceback, non-zero exit code or failed tests, it asks Jev once more with the task and error and switches only upward, at most once every 20 seconds per session. Unknown tiers or failed calls fall back to a default model, and helper requests pass through unchanged. The README calls it early, with tier prompts still being tuned and only one small self-measured cost estimate, and advises not to expect a specific saving. It is MIT licensed.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which model tier does this task need? | luna · terra · sol · astra |
| Choice | Given this failure, should the tier be raised? | luna · terra · sol · astra |
How it works
- New user turn arrives at the proxy
- Jev picks a tier from the message and recent history
- Rewrite the model and keep it for the turn
- On clear failures, ask Jev again and only escalate
- Fall back to a default model on errors
Strengths
- No extra calls within a turn
- Escalation only upward on failures
- Works with any Responses-compatible upstream
Caveats
- Early; tier prompts still being tuned
- No reliable savings figure yet
At a glance
- Type
- Proxy
- Status
- prototype
- Language
- Python
- Runtime
- local HTTP proxy
- Has code
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Per-turn model routing proxy for Codex: asks Jev which tier each task needs, rewrites the model, retries flaky upstream errors.
logicrw/awesome-jev-projects
Frequently asked questions
What does Jev decide?
Which of four model tiers each new Codex turn needs, and whether to escalate after a failure.
Does it call Jev on every request?
No, only on new user turns and failure escalations.
Will it save money?
The README says not to expect a specific saving yet.
Related projects
- jev-router★ 593
Per-turn model routing for Claude Code and Codex: wraps the real CLI and lets Jev send simple turns to fast models and hard ones to strong.
ProxybetaJavaScript - jev-codex-router★ 274
Per-call router for Codex where Jev picks the model and thinking effort for every model call, including tool continuations.
ProjectbetaPython TypeScript/Bun launcher that asks Jev which model and reasoning effort each Codex, Claude Code or Pi turn should use.
ProjectbetaTypeScriptGo CLI model router that uses one Jev analysis to recommend a model, harness and effort level, then selects deterministically.
CLIbetaGoLocal bridge where Jev selects model and reasoning effort for Codex Desktop and CLI, with a Windows service and cache-aware routing.
CLIbetaTypeScriptmacOS wrapper for Codex that lets Jev pick the model and reasoning effort for a thread, then pins that route.
Projectbeta