|
1 | | -# Jev Auto Router |
| 1 | +<h1 align="center">Jev Auto Router</h1> |
2 | 2 |
|
3 | | -[中文](README.md) | **[English](README.en.md)** |
| 3 | +<p align="center"> |
| 4 | + <strong>One model decision per Codex user turn.</strong> |
| 5 | +</p> |
4 | 6 |
|
5 | | -**One model decision per Codex user turn.** `jev-codex` launches the real Codex CLI, adds a virtual `jev-auto` model to the picker, asks [TypeSafe Jev](https://docs.typesafe.ai/introduction) once per fresh user turn, and keeps the selected model pinned through the entire tool loop. |
| 7 | +<p align="center"> |
| 8 | + <code>jev-codex</code> launches the real Codex CLI, adds <code>Jev Auto Router</code> to the model picker, asks TypeSafe Jev once per fresh user turn, and keeps the selected model pinned through the tool loop. Effort moves through cache-preserving <code>configuration_update</code> items. |
| 9 | +</p> |
6 | 10 |
|
7 | | -This is the first **turn-pinned Codex router**. It prioritizes a working loop, fewer switches, and cache-friendly behavior. The old per-call path is gone from the main entrypoint. |
| 11 | +<p align="center"> |
| 12 | + <a href="https://github.com/miniLV/Jev-Auto-Router/tags">Releases</a> · |
| 13 | + <a href="https://minilv.github.io/Jev-Auto-Router/">Homepage</a> · |
| 14 | + <a href="./README.md">简体中文</a> · |
| 15 | + <strong>English</strong> |
| 16 | +</p> |
8 | 17 |
|
9 | | - |
| 18 | +<p align="center"> |
| 19 | + <a href="https://github.com/miniLV/Jev-Auto-Router/actions/workflows/ci.yml"> |
| 20 | + <img alt="CI" src="https://github.com/miniLV/Jev-Auto-Router/actions/workflows/ci.yml/badge.svg" /> |
| 21 | + </a> |
| 22 | + <img alt="Release v0.1.0" src="https://img.shields.io/badge/release-v0.1.0-blue" /> |
| 23 | + <a href="./LICENSE"> |
| 24 | + <img alt="License" src="https://img.shields.io/github/license/miniLV/Jev-Auto-Router" /> |
| 25 | + </a> |
| 26 | + <img alt="Node 22+" src="https://img.shields.io/badge/node-22%2B-339933" /> |
| 27 | + <img alt="npm not published" src="https://img.shields.io/badge/npm-not%20published-lightgrey" /> |
| 28 | +</p> |
10 | 29 |
|
11 | | - |
| 30 | +<p align="center"> |
| 31 | + <img src="docs/assets/model-picker-jev-auto.png" alt="Codex model picker with Jev Auto Router" width="860" /> |
| 32 | +</p> |
12 | 33 |
|
13 | | -The control loop: pick → gate → run → learn. |
| 34 | +--- |
| 35 | + |
| 36 | +## 30-second version |
| 37 | + |
| 38 | +If you use Codex and often spend `frontier + high effort` on routine turns: |
| 39 | + |
| 40 | +- **one Jev decision per user turn**, not per model call; |
| 41 | +- **the model stays pinned** through the tool loop, avoiding repeated prefix rebuilds; |
| 42 | +- **effort is the fine control**, changed through `configuration_update` while preserving cache; |
| 43 | +- price break-even, cache warmth, session guards and upgrade triggers are deterministic policy; |
| 44 | +- supports **Codex CLI** and the **Codex app**. |
| 45 | + |
| 46 | +> **Status:** `v0.1.0` alpha; 63 deterministic tests pass; live GPT cache/quality evaluation is still pending. Effort routing is off by default. |
| 47 | +
|
| 48 | +## What it does |
| 49 | + |
| 50 | +| Capability | What it means | |
| 51 | +| --- | --- | |
| 52 | +| Turn-pinned routing | One Jev decision per user turn; the model does not change inside the tool loop | |
| 53 | +| Effort routing | Same model; low/medium/high/xhigh/max can move per turn | |
| 54 | +| Cache-aware gates | Price break-even, cache warmth, large-context and session guards | |
| 55 | +| Codex CLI | `jev-codex` launches real Codex with the `Jev Auto Router` entry | |
| 56 | +| Codex app | `jev-codex setup-app` configures the local provider and model catalog | |
| 57 | +| Evidence | 63 deterministic tests; a live savings evaluation plan is in the repo | |
| 58 | + |
| 59 | +- Design notes: [docs/codex-turn-router.md](docs/codex-turn-router.md) |
| 60 | +- Evaluation plan: [docs/evaluation-plan.md](docs/evaluation-plan.md) |
| 61 | +- Releasing: [docs/releasing.md](docs/releasing.md) |
14 | 62 |
|
15 | | -- Usage, configuration and design trade-offs: [docs/codex-turn-router.md](docs/codex-turn-router.md) |
16 | | -- Test samples and methods: [docs/evaluation-plan.md](docs/evaluation-plan.md) |
17 | 63 |
|
18 | 64 | ## Install |
19 | 65 |
|
20 | | -After the npm package is published: |
| 66 | +> [!IMPORTANT] |
| 67 | +> The npm registry release does not exist yet (`npm view jev-auto-router` returns 404). Use the source install now; the npm commands below become available after the first publish. |
| 68 | +
|
| 69 | +### From source (available now) |
| 70 | + |
| 71 | +```sh |
| 72 | +git clone https://github.com/miniLV/Jev-Auto-Router.git |
| 73 | +cd Jev-Auto-Router |
| 74 | +npm ci |
| 75 | +npm run build |
| 76 | +npm link |
| 77 | +jev-codex |
| 78 | +``` |
| 79 | + |
| 80 | +### npm (after release) |
21 | 81 |
|
22 | 82 | ```sh |
23 | 83 | npm install -g jev-auto-router |
24 | 84 | jev-codex |
25 | 85 | ``` |
26 | 86 |
|
27 | | -Or run it without a global install: |
| 87 | +Or: |
28 | 88 |
|
29 | 89 | ```sh |
30 | 90 | npx -y jev-auto-router |
31 | 91 | ``` |
32 | 92 |
|
33 | | -From source: |
| 93 | +### Codex app |
34 | 94 |
|
35 | 95 | ```sh |
36 | | -git clone https://github.com/miniLV/Jev-Auto-Router.git |
37 | | -cd Jev-Auto-Router |
38 | | -npm ci |
39 | | -npm run build |
40 | | -npm link |
41 | | -jev-codex |
| 96 | +jev-codex setup-app |
42 | 97 | ``` |
43 | 98 |
|
| 99 | +Then fully quit and reopen the ChatGPT/Codex app, create a new task, and select `Jev Auto Router`. See [Codex app](#codex-app) and [releasing](docs/releasing.md). |
| 100 | + |
44 | 101 | ## Result: one extra model in the picker |
45 | 102 |
|
46 | 103 | `jev-codex` does not fork Codex. It launches the real Codex CLI, injects a temporary provider, and (by default) adds one virtual model to the Codex CLI model picker / `/model`: |
@@ -123,7 +180,7 @@ Illustrative, not a measured bill. Real savings depend on the cache hit rate, th |
123 | 180 | > [!WARNING] |
124 | 181 | > Alpha: effort routing is off by default, and `configuration_update` has not been validated against a live Codex + GPT cache yet. Set `JEV_CODEX_EFFORT_ROUTING=turn` for a small smoke test before enabling it long-term. |
125 | 182 |
|
126 | | -## Quickstart |
| 183 | +## Usage |
127 | 184 |
|
128 | 185 | Requires Node.js 22+, a signed-in Codex CLI, and a TypeSafe Jev key. |
129 | 186 |
|
@@ -246,6 +303,15 @@ src/codex-router/ |
246 | 303 | - Encrypted reasoning cleanup is opt-in; compaction still needs live-session tests. |
247 | 304 | - Commentary modifies the Codex event stream; set `JEV_CODEX_COMMENTARY=0` for byte-identical forwarding. |
248 | 305 |
|
| 306 | +## Release status |
| 307 | + |
| 308 | +- Version: `0.1.0` |
| 309 | +- Git tag: `v0.1.0` |
| 310 | +- npm registry: **not published** |
| 311 | +- Release process: [docs/releasing.md](docs/releasing.md) |
| 312 | +- CI: `.github/workflows/ci.yml` |
| 313 | +- Release workflow: `.github/workflows/release.yml` (tag `v*` or manual) |
| 314 | + |
249 | 315 | ## License |
250 | 316 |
|
251 | 317 | [Apache License 2.0](LICENSE) |
0 commit comments