ClaudeMap

Jev Router

Per-turn model routing for Claude Code: TypeSafe's Jev classifies each fresh prompt and a loopback proxy moves you between Haiku, Sonnet and Opus — native picker, sessions and auth untouched.

SDKs & Toolingroutingcostproxyjevmodel-picker

Jev Router launches the real Claude Code (command jev-claude) with an extra 'Jev Router' entry in the native /model picker: for every fresh user turn, one call to TypeSafe's Jev decision model classifies the task and the proxy rewrites the tier — Fast maps to Haiku, Balanced to Sonnet, Strong to Opus, with an opt-in Long tier (Fable) behind JEV_ALLOW_FABLE=1. Selecting any concrete model pauses routing; selecting Jev Router resumes it. An injected status line shows the model used and its confidence, and a bundled /jev-explain skill renders the exact saved request and response — task complexity, reasoning, tool and context scores — locally. The policy has rails: explicit requests like 'use opus' win; low confidence never downgrades and caps upgrades at balanced; large conversations refuse downgrades that would waste more prompt-cache work than they save; unavailable tiers step upward rather than silently choosing weaker models; routing is fail-open, so a Jev failure never blocks the CLI. The loopback proxy forwards the CLI's existing authorization headers without reading, storing or modifying them, and tool-loop continuations keep the tier chosen at the turn's start. A second command, jev-codex, does the same for OpenAI Codex. Node.js 20.12+, npm package, MIT.

What it does

  • One Jev call per fresh user turn picks the tier (Haiku/Sonnet/Opus, opt-in Fable); tool-loop continuations keep the turn's tier
  • Shows up as a native /model picker entry — pick a concrete model to pause, pick Jev Router to resume; existing custom status lines are preserved
  • Policy rails: low confidence never downgrades, upgrades cap at balanced, big conversations refuse cache-wasting downgrades, fail-open on Jev errors
  • /jev-explain prints the saved routing factors (complexity, reasoning, tool, context scores) rendered locally from the exact request and response

When to use it

Subscription Claude Code users who want easy prompts to land on Haiku automatically instead of micro-managing the model picker, with visible confidence and an explain skill for every decision; Codex users get the same via jev-codex.

Getting started

npm install -g jev-router
echo "JEV_API_KEY=..." > ~/.jev-router.env   # key from the TypeSafe console
jev-claude   # launches Claude Code with Jev Router selected in /model

# Node.js 20.12+; your existing `claude login` is reused — no Anthropic key needed
# every CLI argument is forwarded: jev-claude --resume, jev-claude -p "..."

Things to know

MIT. Your prompt text is sent to TypeSafe for every routing decision — nothing else leaves, but it is a paid third-party API in the loop of every turn. The proxy depends on Claude Code's non-public request format; use JEV_DUMP to diagnose breakage after CLI updates. Developed and tested on Windows against Claude Code v2.1.101 and Codex v0.154.0. Jev adds latency only to the first request of a turn; unsupported request fields (e.g. adaptive thinking on Haiku) are stripped before forwarding.

Repository

gargpratyush/jev-router

Charted

Related on the map

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup