codex-sift 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +38 -22
  2. package/dist/cli.js +3 -1
  3. package/package.json +12 -6
package/README.md CHANGED
@@ -1,39 +1,39 @@
1
1
  # Codex Sift
2
2
 
3
+ **Free, open-source model routing inside Codex CLI.**
4
+
5
+ Save your strongest model for the turns that need it.
6
+
7
+ [Install](#install) · [Demo](#routing-demo) · [Results](#how-much-usage-can-codex-sift-save) · [Commands](#commands) · [FAQ](https://codex-sift.vercel.app/#faq) · [Star history](#star-history)
8
+
9
+ [![CI](https://github.com/romanmeclazcke/codex-sift/actions/workflows/test.yml/badge.svg)](https://github.com/romanmeclazcke/codex-sift/actions/workflows/test.yml)
10
+ [![MIT license](https://img.shields.io/github/license/romanmeclazcke/codex-sift)](LICENSE)
11
+ [![npm version](https://img.shields.io/npm/v/codex-sift)](https://www.npmjs.com/package/codex-sift)
12
+ [![GitHub stars](https://img.shields.io/github/stars/romanmeclazcke/codex-sift)](https://github.com/romanmeclazcke/codex-sift/stargazers)
13
+
3
14
  Sift is a model router for the [OpenAI Codex CLI](https://developers.openai.com/codex). It keeps the native Codex experience, but routes each user turn to the cheapest model lane that should be able to handle it.
4
15
 
5
- The problem is simple: coding sessions mix tiny asks, everyday implementation, and genuinely hard work. Running every turn on the strongest model is easy, but it spends premium quota on prompts like “explain this file”, “run the tests”, or “rename this helper”. Sift adds a small decision layer before Codex spends the turn.
16
+ ## How much usage can Codex Sift save?
6
17
 
7
- On every **user turn**, Sift asks [TypeSafe Jev](https://docs.typesafe.ai) how hard the task is. Your YAML policy then picks a lane — **flash**, **craft**, or **forge** — and Codex runs against that model. You still talk to the native TUI.
18
+ **Codex Sift used 48.8% less estimated Codex quota** in a November 26, 2026 routing test on 12 representative requests, compared with sending every request to the `forge` lane (`gpt-5.6-sol`, high reasoning effort). The routing policy estimates quota from model and reasoning-effort weights. The estimate is specific to this workload and policy. [Full routing report and per-request results](https://github.com/romanmeclazcke/codex-sift/blob/main/reports/e2e-routing.md)
8
19
 
9
- Jev does not write code. It returns typed signals in about 300 ms. Sift’s YAML policy turns those signals into a model id.
20
+ ![Estimated quota over 12 requests: 16.20 units on always-forge and 8.30 units with Codex Sift](assets/readme/quota.png)
10
21
 
11
- This is a Codex-only router. It is not an MCP server, and it does not patch `~/.codex/config.toml`.
22
+ In a separate live Codex CLI test on three short coding questions, the models selected by Sift used **8.7% fewer input tokens** than always using `forge` (54,458 vs. 59,654). Both strategies answered **3/3** correctly. Sift took 17.7 seconds in total and the fixed model took 16.0 seconds. Each strategy ran once, and the input counts include cached tokens. [Benchmark methodology and comparison](https://codex-sift.vercel.app/benchmark) · [Raw CLI measurements](https://github.com/romanmeclazcke/codex-sift/blob/main/reports/model-comparison.json)
12
23
 
13
- ## Current E2E result
24
+ To reproduce the routing test with your TypeSafe API key, run `npm ci` and `npm run e2e:report` from the repository.
14
25
 
15
- The latest routing report in this repository was generated with:
26
+ The problem is simple: coding sessions mix tiny asks, everyday implementation, and genuinely hard work. Running every turn on the strongest model is easy, but it spends premium quota on prompts like “explain this file”, “run the tests”, or “rename this helper”. Sift adds a small decision layer before Codex spends the turn.
16
27
 
17
- ```bash
18
- npm run e2e:report
19
- ```
28
+ On every **user turn**, Sift asks [TypeSafe Jev](https://docs.typesafe.ai) how hard the task is. Your YAML policy then picks a lane — **flash**, **craft**, or **forge** — and Codex runs against that model. You still talk to the native TUI.
20
29
 
21
- Result:
30
+ Jev does not write code. It returns typed signals in about 300 ms. Sift’s YAML policy turns those signals into a model id.
22
31
 
23
- | Metric | Value |
24
- |---|---:|
25
- | Representative cases | 12 |
26
- | Live Jev cases | 12 |
27
- | Degraded cases | 0 |
28
- | Policy expectation match | 11/12 |
29
- | Average Jev latency | 418 ms |
30
- | Always-forge baseline | 16.20 |
31
- | Sift routed usage | 7.50 |
32
- | Estimated quota saved | 53.7% |
32
+ This is a Codex-only router. It is not an MCP server, and it does not patch `~/.codex/config.toml`.
33
33
 
34
- See [reports/e2e-routing.md](reports/e2e-routing.md) for the full table.
34
+ To get started, run `npx codex-sift setup` with Node.js 20+, the Codex CLI, and a TypeSafe API key. Then run `npx codex-sift` to launch Codex with routing enabled.
35
35
 
36
- This measures routing and quota efficiency against an always-forge baseline. It does not claim answer quality unless you run and score the same prompts through Codex.
36
+ [Reduce Codex CLI token usage](https://codex-sift.vercel.app/guides/en) · [Cómo reducir el consumo de Codex CLI](https://codex-sift.vercel.app/guides/es) · [Routing benchmark](https://codex-sift.vercel.app/benchmark) · [Manual model switching vs Codex Sift](https://codex-sift.vercel.app/compare)
37
37
 
38
38
  ## Why this shape
39
39
 
@@ -51,6 +51,18 @@ you → codex-sift → Codex TUI
51
51
 
52
52
  If you pin another model in `/model`, routing pauses. Pick **Sift** again to resume.
53
53
 
54
+ ## Routing demo
55
+
56
+ ![Animated demo of Codex CLI requests routed through Sift to flash, craft, or forge](assets/readme/routing.gif)
57
+
58
+ | Example | Lane | Why |
59
+ | --- | --- | --- |
60
+ | Explain package.json | `flash` | Short lookup |
61
+ | Add a loading state to the form | `craft` | Bounded implementation |
62
+ | Plan a production migration | `forge` | High-stakes change |
63
+
64
+ [Try the interactive demo](https://codex-sift.vercel.app/)
65
+
54
66
  ## Install
55
67
 
56
68
  Global (recommended):
@@ -235,3 +247,7 @@ npx tsx src/cli.ts route "rename the unused helper"
235
247
  ## License
236
248
 
237
249
  MIT
250
+
251
+ ## Star history
252
+
253
+ [![Codex Sift GitHub stars over time](https://api.star-history.com/svg?repos=romanmeclazcke/codex-sift&type=Date)](https://www.star-history.com/#romanmeclazcke/codex-sift&Date)
package/dist/cli.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { copyFileSync, mkdirSync, existsSync } from "node:fs";
3
+ import { createRequire } from "node:module";
3
4
  import { join } from "node:path";
4
5
  import { runDemo } from "./demo.js";
5
6
  import { runDoctor } from "./doctor.js";
@@ -47,7 +48,8 @@ async function main(argv) {
47
48
  if (!cmd)
48
49
  return launchCodex([]);
49
50
  if (cmd === "-v" || cmd === "--version" || cmd === "version") {
50
- process.stdout.write("codex-sift 0.1.0\n");
51
+ const { version } = createRequire(import.meta.url)("../package.json");
52
+ process.stdout.write(`codex-sift ${version}\n`);
51
53
  return 0;
52
54
  }
53
55
  if (cmd === "doctor")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codex-sift",
3
- "version": "0.1.0",
4
- "description": "Sift each Codex turn onto the cheapest model that can handle it. Judged by TypeSafe Jev, executed by the native Codex CLI.",
3
+ "version": "0.1.1",
4
+ "description": "Model router for OpenAI Codex CLI. Choose a model per coding task to manage token, credit, and quota usage.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "codex-sift": "dist/cli.js"
@@ -29,10 +29,16 @@
29
29
  },
30
30
  "keywords": [
31
31
  "codex",
32
- "jev",
33
- "typesafe",
32
+ "openai-codex",
33
+ "codex-cli",
34
34
  "model-routing",
35
- "cli"
35
+ "model-router",
36
+ "codex-model-routing",
37
+ "token-usage",
38
+ "cost-optimization",
39
+ "cli",
40
+ "typesafe",
41
+ "jev"
36
42
  ],
37
43
  "license": "MIT",
38
44
  "author": "Roman Meclazcke",
@@ -43,7 +49,7 @@
43
49
  "bugs": {
44
50
  "url": "https://github.com/romanmeclazcke/codex-sift/issues"
45
51
  },
46
- "homepage": "https://github.com/romanmeclazcke/codex-sift#readme",
52
+ "homepage": "https://codex-sift.vercel.app",
47
53
  "dependencies": {
48
54
  "yaml": "^2.8.1"
49
55
  },