← Open Source
gargpratyush

jev-router

Route to the cheapest model in claude code for your task using jev-router.

InfrastructureGatewayJavaScript
Open on GitHub
Momentum
+3stars in 24 hours+0.5%
600
Stars
90
Forks
+25
This week
3
Contributors
Created 2026-09-16 · Updated 2026-10-16 · #3196 today
Top developers
gargpratyushMrJevphetzy

gargpratyush/jev-router is ranked 3,196 with 600 stars.

Same-category comparison

gargpratyush/jev-router is ranked 3,196 among these 8 peers; humancomputerlab/LeLamp is ranked 3,199.

Same-category comparison
NameRankMetrics
CrispStrobe/CrispASR3,154
Language:
C++
Stars:
756
Forks:
120
Description:
C++ ggml runtime hub for multilingual ASR and TTS models: Cohere Transcribe, Parakeet TDT, Voxtral, Canary 1B v2, etc, plus universal forced alignment, and more.
myccarl/ai-shortVideo-pipeline3,159
Language:
Python
Stars:
741
Forks:
177
Description:
End-to-end AI short-video production pipeline. FastAPI orchestration + Spring Boot gateway with multi-model failover, circuit breaker, metering, and full-stack observability. AI quality gating: prompt anchoring, CLIP consistency, AV sync auto-rescue.
LiteReality/LiteReality-Agent3,190
Language:
Python
Stars:
609
Forks:
56
Description:
LiteReality-Agent: Turn the real world into simulation-ready environments.
MiaAI-Lab/Qwen3.8-Flash-Next-Single-DGX-Spark3,191
Language:
Python
Stars:
609
Forks:
90
Description:
Qwen3.8-Flash-Next on ONE DGX Spark (TP=1).
humancomputerlab/LeLamp3,199
Stars:
593
Forks:
102
Description:
Open-source Expressive Robot Lamp.
deepseek-ai/DeepGEMM-Ascend3,201
Language:
C++
Stars:
583
Forks:
48
Description:
DeepGEMM-Ascend: clean and efficient matrix multiplication kernel library for Huawei Ascend NPUs.
wuphilipp/gello_software3,212
Language:
Python
Stars:
558
Forks:
181
cubeplexai/cubeplex3,215
Language:
Python
Stars:
552
Forks:
47
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageJavaScript
CategoryInfrastructure
SubcategoryGateway
KeywordsAgent-ready APIs, Client integration, Inference optimization
Stars600
Forks90
Contributors3
Created date2026-09-16
Updated date2026-10-16
Stars in 1 day3
Stars in 7 days25
Rank3,196
Previous rank6,809
Rank change3,613
7-day stars rank2,420
Previous 7-day stars rank2,106
7-day stars rank change-314
Total stars rank16,778
Previous total stars rank16,819
Total stars rank change41
README summary

jev-router Automatic per-turn model routing for Claude Code and OpenAI Codex. Jev sends simple work to the fast tier and difficult work to the strong tier, while preserving each CLI's native interface, tools, sessions, permissions, and authentication. Jev only chooses the model for a fresh user turn. 12+ and at least one supported CLI: Claude Code or OpenAI Codex. Local repository On Windows PowerShell: Get a key from TypeSafe. Then launch either interface from any repository: No Anthropic

or OpenAI API key is required when the corresponding CLI is already logged in with a subscription. Every CLI argument is forwarded: For a local checkout, installs both commands. Claude Code interface launches Claude Code with **Jev Router** selected in . Selecting another model pauses routing; selecting **Jev Router** resumes it. The injected status line shows the model used for the last turn: Claude Code otherwise remains unchanged, including its keybindings, tools, permission prompts, , , and session handling. An existing custom is

preserved; set to disable Jev's status line. The explanation skill is bundled with the npm package and loaded automatically: run in , or in , to see the factors behind the last routing decision: The report is rendered locally from the exact prompt, System One request, and System One response saved when routing occurred. Recent decisions are retained per CLI session; invoking the explanation skill does not ask Jev to score the prompt again. Explanation data location Both and keep up to

20 recent routing exchanges in one JSON file per CLI session under Node. These temporary files contain prompt text and Jev's exact request and response, so they are readable only by you (the directory is created with mode 700 and each file with 600). Files not updated for 7 days are deleted automatically, and the operating system may also remove them during normal temporary-file cleanup. Choosing a model with can save it as Claude Code's default. restores the previous

default on exit so cannot break plain . OpenAI Codex interface launches Codex with a temporary **Jev Router** provider and selects . The native picker still contains the models available to the account. Selecting a concrete model pauses routing; selecting **Jev Router** resumes it. Each fresh decision appears as Codex commentary: installs or refreshes the packaged skill when it starts, so it is available from any repository without separate setup. Codex's footer shows because it displays the selected picker entry, not the

model chosen behind that provider. If Jev is unavailable, the commentary names the fallback model and explains how to set . How it works Each command starts a loopback proxy, launches the real CLI, and forwards the CLI's existing authorization headers without reading, storing, or modifying them. Claude Code uses ; Codex uses a temporary custom provider with . Claude and Codex both use as the routing sentinel. Any concrete model selected by the user passes through unchanged. Tool-loop continuations keep the

tier chosen at the start of the turn. Main conversations and sub-agents are pinned separately. Routing is fail-open

Frequently asked questions

How many stars and forks are recorded?

gargpratyush/jev-router has 600 stars and 90 forks.

What is the repository rank?

gargpratyush/jev-router is ranked 3,196.

What language and category are recorded?

gargpratyush/jev-router has 600 stars, uses JavaScript and belongs to Infrastructure.

Which repository is closest in rank?

gargpratyush/jev-router is compared with humancomputerlab/LeLamp, ranked 3,199 with 593 stars.

README

jev-router

Automatic per-turn model routing for Claude Code and OpenAI Codex. Jev sends simple work to the fast tier and difficult work to the strong tier, while preserving each CLI's native interface, tools, sessions, permissions, and authentication.

Command Interface Authentication Routing decision
jev-claude Claude Code Existing claude login Status line
jev-codex OpenAI Codex Existing codex login Commentary line

Both commands launch the real upstream CLI. Jev only chooses the model for a fresh user turn.

Quick start

Requires Node.js 20.12+ and at least one supported CLI: Claude Code or OpenAI Codex.

1. npm package

npm install -g jev-router
echo "JEV_API_KEY=..." > ~/.jev-router.env

2. Local repository

git clone https://github.com/gargpratyush/jev-router.git
cd jev-router
npm install
npm link
echo "JEV_API_KEY=..." > ~/.jev-router.env

On Windows PowerShell:

Set-Content "$HOME\.jev-router.env" "JEV_API_KEY=..."

Get a key from TypeSafe. Then launch either interface from any repository:

jev-claude
jev-codex

No Anthropic or OpenAI API key is required when the corresponding CLI is already logged in with a subscription. Every CLI argument is forwarded:

jev-claude --resume
jev-claude -p "fix the failing test"
jev-codex resume --last
jev-codex exec "fix the failing test"

For a local checkout, npm link installs both commands. Without it, run node bin/jev-claude.mjs or node bin/jev-codex.mjs.

Claude Code interface

jev-claude launches Claude Code with Jev Router selected in /model. Selecting another model pauses routing; selecting Jev Router resumes it.

The injected status line shows the model used for the last turn:

⚡ haiku p=0.98 · my-project · 8% context
⏸ manual Opus 4.6 · my-project · 21% context

Claude Code otherwise remains unchanged, including its keybindings, tools, permission prompts, /compact, /resume, and session handling. An existing custom statusLine is preserved; set JEV_NO_STATUSLINE=1 to disable Jev's status line.

The explanation skill is bundled with the npm package and loaded automatically: run /jev-explain in jev-claude, or $jev-explain in jev-codex, to see the factors behind the last routing decision:

┌─────────────────────────────────┐
│ Jev Router                      │
│                                 │
│ Jev request                     │
│ Prompt: explain the router      │
│ Current tier: HAIKU             │
│ Context tokens: 6200            │
│                                 │
│ Jev response                    │
│ Task complexity     0.82        │
│ Reasoning required  0.91        │
│ Tool complexity     0.64        │
│ Context size        0.31        │
│                                 │
│ Recommended tier: SONNET        │
│ Selected model: SONNET          │
│                                 │
│ Confidence: 94%                 │
│ Decision: Jev recommendation    │
└─────────────────────────────────┘

The report is rendered locally from the exact prompt, System One request, and System One response saved when routing occurred. Recent decisions are retained per CLI session; invoking the explanation skill does not ask Jev to score the prompt again.

Explanation data location

Both jev-claude and jev-codex keep up to 20 recent routing exchanges in one JSON file per CLI session under Node.js's operating-system temporary directory:

Platform Default location
Windows %TEMP%\jev-claude\.json
macOS $TMPDIR/jev-claude/.json (normally under /var/folders/.../T)
Ubuntu/Linux ${TMPDIR:-/tmp}/jev-claude/.json

Print the exact directory selected on the current machine with:

node -e "console.log(require('node:path').join(require('node:os').tmpdir(), 'jev-claude'))"

Claude filenames use Claude Code's session UUID. Codex filenames use codex-.json. These temporary files contain prompt text and Jev's exact request and response, so they are readable only by you (the directory is created with mode 700 and each file with 600). Files not updated for 7 days are deleted automatically, and the operating system may also remove them during normal temporary-file cleanup.

Choosing a model with Enter can save it as Claude Code's default. jev-claude restores the previous default on exit so jev-router cannot break plain claude.

OpenAI Codex interface

jev-codex launches Codex with a temporary Jev Router provider and selects jev-router. The native /model picker still contains the models available to the account. Selecting a concrete model pauses routing; selecting Jev Router resumes it.

Each fresh decision appears as Codex commentary:

[Jev] routed this turn to gpt-5.6-sol (jev, confidence 0.91).

jev-codex installs or refreshes the packaged $jev-explain skill when it starts, so it is available from any repository without separate setup.

Codex's footer shows jev-router because it displays the selected picker entry, not the model chosen behind that provider. If Jev is unavailable, the commentary names the fallback model and explains how to set JEV_API_KEY.

How it works

Each command starts a loopback proxy, launches the real CLI, and forwards the CLI's existing authorization headers without reading, storing, or modifying them.

you -> Claude Code -> jev-claude proxy -> Anthropic
                         |
                         +-> Jev: choose a tier

you -> OpenAI Codex -> jev-codex proxy -> OpenAI
                         |
                         +-> Jev: choose a tier

Claude Code uses ANTHROPIC_BASE_URL; Codex uses a temporary custom provider with requires_openai_auth=true. Claude and Codex both use jev-router as the routing sentinel. Any concrete model selected by the user passes through unchanged.

Routing policy

One Jev call per fresh user turn selects a shared abstract tier:

Tier Claude Code default Codex default
Fast Haiku gpt-5.6-luna
Balanced Sonnet gpt-5.6-terra
Strong Opus gpt-5.6-sol
Long Fable gpt-6-astra

src/policy.mjs then applies these rules:

  • explicit requests such as use opus, use luna, or use strong win;
  • failure, timeout, or an unrecognised Jev answer keeps the current model;
  • low confidence never downgrades and caps upgrades at the balanced tier;
  • large conversations refuse downgrades that would waste more prompt-cache work than they save;
  • unavailable tiers step upward rather than silently choosing a weaker model;
  • the long tier is disabled unless JEV_ALLOW_FABLE=1.

Tool-loop continuations keep the tier chosen at the start of the turn. Main conversations and sub-agents are pinned separately. Routing is fail-open: Jev failure never blocks the CLI.

Configuration

Variable Interface Effect
JEV_API_KEY Both Enables routing. TYPESAFE_API_KEY also works.
JEV_ALLOW_FABLE Both Enables the opt-in long tier.
JEV_DEBUG Both Logs decisions and rewrites to ~/.jev-claude.log in interactive sessions.
JEV_DUMP Both Dumps request bodies for debugging wire-format changes.
JEV_NO_STATUSLINE Claude Disables the injected Claude status line.
JEV_CODEX_FAST_MODEL Codex Fast model; defaults to gpt-5.6-luna.
JEV_CODEX_BALANCED_MODEL Codex Balanced model; defaults to gpt-5.6-terra.
JEV_CODEX_STRONG_MODEL Codex Strong model; defaults to gpt-5.6-sol.
JEV_CODEX_LONG_MODEL Codex Long model; defaults to gpt-6-astra.

Existing environment variables have highest precedence, followed by .env in the launch directory, ~/.jev-router.env, and the legacy ~/.jev-claude.env.

Tier definitions, Jev's question, confidence thresholds, and timeouts live in src/config.mjs. Both launchers send Jev the exact models in the signed-in account's native catalog, so model versions such as claude-opus-4-8 and claude-opus-5 remain separate choices. Static model ids are used only until the CLI fetches its catalog.

Compatibility notes

  • Claude Code needs schema normalisation for older MCP JSON Schema fields when a custom base URL is active.
  • Claude request fields unsupported by a routed tier, such as adaptive thinking on Haiku, are removed before forwarding.
  • Codex's current request format stores tool definitions inside its Responses API input.
  • Codex's ChatGPT backend may stream SSE without a Content-Type header; the proxy detects the event stream from its first frame.
  • Codex workspace-specific enterprise origins are internal to its built-in provider and cannot be reproduced by a custom provider.

Development

npm install
echo "JEV_API_KEY=..." > .env

npm test
node test/live-routing.mjs
node bin/jev-claude.mjs -p "what is 2+2?"
node bin/jev-codex.mjs exec "what is 2+2?"

The test suite covers shared policy, both request formats, model rewriting, capability handling, settings restoration, Codex authentication forwarding, native model-picker injection, and decision display.

Limitations

  • The user's prompt text is sent to TypeSafe for the routing decision. Nothing else is.
  • Jev adds latency only to the first request of a turn; tool-loop continuations add none.
  • Claude Code and Codex request formats are not public contracts. Use JEV_DUMP to diagnose upstream changes.
  • Developed and tested on Windows against Claude Code v2.1.101 and OpenAI Codex v0.154.0.

Contributing

Issues and pull requests are welcome. Use Issues to report bugs, request improvements, or ask questions. Include the relevant Claude Code or Codex version, reproduction steps, expected behavior, and useful logs with secrets removed.

For a pull request:

  1. Open an issue first - all PRs by contributors should be linked with an approved issue. Explain the problem and validation in the issue description.
  2. Fork the repository and create a focused branch from master.
  3. Make the smallest change that solves the problem.
  4. Run npm test and include tests for non-trivial behavior changes.
  5. Claude/Copilot/Codex shall not be the contributors.

Please do not commit API keys or other secrets. All contributions require review, and only the repository owner can merge pull requests.

License

MIT

Nearby in the ranking
Similar items