CODEX SIFT
Model router for the Codex CLI
Each user turn goes to flash, craft or forge before Codex bills it. The policy estimated a quota reduction of 48.8% versus always-forge across 12 prompts.
Results
48.8% less estimated quota on 12 prompts
The routing test classified representative Codex prompts into flash, craft or forge. Estimated quota fell from 16.2 to 8.3 policy units against an always-forge baseline.
Estimated Codex quota, 12 prompts
Always-forge baseline
every turn on gpt-5.6-sol
16.20
Sift routed
flash + craft + forge lanes
8.30
The estimate from npm run e2e:report uses the policy’s model and reasoning-effort weights. Read the full report.
12 / 12
turns classified by live Jev
0 degraded
12 / 12
landed on the expected lane
policy expectation
249 ms
average Jev latency
in this run
4 · 4 · 4
flash · craft · forge
lane mix
Lane usage per prompt
Gray shows the always-forge estimate. Blue shows the routed lane estimate.
- flash · gpt-5.6-luna
- craft · gpt-5.6-terra
- forge · gpt-5.6-sol
How it works
A decision layer before Codex spends the turn
you
codex-sift
Codex TUI
model=sift
Sift proxy
127.0.0.1 · Jev + policy.yaml
Upstream
chatgpt.com/backend-api/codex or api.openai.com
Intercepts the Responses call
Codex has no hook that changes the model before a turn is billed. Sift starts a loopback Responses proxy and launches Codex with process-local -c overrides. TUI, sessions and sandbox stay native.
Asks Jev six atomic questions
On every user turn Sift asks Jev for task_kind, difficulty, needs_reasoning, needs_planning, high_stakes and cross_cutting. Typed signals come back in about 300 ms. Jev never writes code or picks a model.
Maps signals with policy.yaml
YAML rules turn those signals into flash, craft or forge. If Jev times out or the key is missing, Sift fails open to on_jev_down (default craft) and marks the decision degraded.
Rewrites model and effort only
Only model and reasoning.effort change. Your ChatGPT or API-key login is forwarded upstream. Tool-loop continuations stay pinned to the chosen lane.
What is not routed
- Tool-loop continuations of the same user turn
- codex-auto-review and compact/review prompts
- Codex housekeeping that is not a /responses call
- Invocations with -m / --model pointing at a real model
Sift is Codex-only. It is not an MCP server and does not patch ~/.codex/config.toml. Pin another model in /model and routing pauses until you pick Sift again.
Quick start
Install, set up, then run Codex through Sift
Install with npm install -g codex-sift, run codex-sift setup to assign models to flash, craft and forge, then start a session. Arguments match codex.
Install from npm, then assign a model to flash, craft and forge.
# recommendednpm install -g codex-siftcodex-sift setup# or without a global installnpx codex-sift setupnpx codex-siftFAQ
Questions about Codex Sift
- What is Codex Sift?
- Codex Sift is a model router for the OpenAI Codex CLI. It sends each user turn to the flash, craft or forge lane before Codex bills the turn.
- How does Codex Sift choose a model?
- On every user turn Sift asks TypeSafe Jev for typed signals such as task_kind and difficulty. Your policy.yaml maps those signals to a lane. First matching rule wins.
- Does Codex Sift change the Codex TUI?
- No. Sift launches Codex through a loopback model_provider. Sessions, tools and sandbox stay native to Codex.
- How many tokens did Codex Sift save in the repository benchmark?
- Across 9 repository runs per strategy, Codex Sift used 51.7% fewer total input and output tokens than fixed-model gpt-5.6-sol. Input includes cached tokens.
- How much quota can routing save?
- In a 12-prompt routing test, the policy estimated 48.8% less relative quota than always using forge. The estimate uses model and reasoning-effort weights.
- Who built Codex Sift?
- Codex Sift was built by Roman Meclazcke (github.com/romanmeclazcke, x.com/romanmeclazcke_, linkedin.com/in/roman-meclazcke) and is released under the MIT license.
- How do I install Codex Sift?
- Install from npm with npm install -g codex-sift, then run codex-sift setup. You can also use npx codex-sift without a global install. The package is at npmjs.com/package/codex-sift.
Next step
Install Sift and keep the Codex TUI
Stop spending your strongest model on “explain this file”. Add the decision layer in front of Codex, then check the difference with codex-sift report. Built by Roman Meclazcke.