Skip to content

auto-model-router

Cost-, cache- and quota-aware LLM router that classifies each turn with a Jev-class model, prices every route, and checks cheap answers.

Projectprototype

Overview

auto-model-router sits in front of any number of OpenAI-compatible providers and picks a model per user turn so tasks are solved at the lowest expected cost. It runs as a local gateway for Claude Code, can route whole jobs to a coding agent's CLI, and offers an MCP tool so agents like Codex, opencode, Cursor or Hermes can hand bounded sub-tasks to cheaper workers.

A Jev-class model (local Laya on CPU by default, hosted Jev at about 0.6 s, or a heuristic) classifies each scrubbed, truncated turn: category, difficulty, tool, vision or long-context needs, whether it builds on the previous turn and the cost of a wrong answer. Each model is then priced using benchmark data and actual cache state, and the policy chooses, escalating on capability failures and falling back sideways on availability failures. When a cheap route answers, a Jev-class judge checks it with one typed question. The README reports Jev catching 85% of wrong coding answers (10% false alarms) and 73% of wrong maths answers in its tests. It is labelled experimental.

What the decision model decides

TypeQuestionAnswers
ChoiceWhat category and difficulty is this turn; does it need tools, vision or long context?—
Yes / noIs this cheap route's answer acceptable?yes · no

How it works

  1. Classify the turn with Jev (or Laya/heuristic)
  2. Look up prices, cache costs and capability per model
  3. Price each eligible model for this turn and choose
  4. Check cheap answers with a typed judge; re-run rejected ones on a stronger route
  5. Record the decision and verdict

Strengths

  • Cache- and quota-aware cost decisions
  • Only a scrubbed summary is sent to the classifier
  • Measured answer-checking results with method documented

Caveats

  • Experimental
  • Local CPU classifier is much slower than hosted Jev
  • Gateway mode only for Claude Code so far

At a glance

Type
Project
Status
prototype
Language
Python
Runtime
local gateway + MCP tool
Has code
yes

Use cases and integrations

How curated lists describe it

  • Picks a model per turn across any number of OpenAI-compatible providers against cost, cache and quota, with a Claude Code shim.

    MrJev/awesome-jev

Frequently asked questions

What does Jev decide?

How to classify each turn for routing, and whether a cheap route's answer should be accepted.

Does the classifier see my transcript?

No, only a scrubbed and truncated summary.

How well does answer checking work?

The README reports 85% of wrong coding answers caught with 10% false alarms in its tests.

Related projects

  • Host-agnostic routing layer that picks model, effort and provider per round for coding harnesses from trajectory evidence.

    ProxybetaTypeScript
  • Local-first, outcome-aware model router for coding harnesses that picks a capability tier per task with Jev and learns from history.

    ProjectprototypeRust
  • jev-router★ 593

    Per-turn model routing for Claude Code and Codex: wraps the real CLI and lets Jev send simple turns to fast models and hard ones to strong.

    ProxybetaJavaScript
  • Local OpenAI/Anthropic-compatible proxy where one Jev call picks the model route and thinking level for each coding-agent turn.

    ProxybetaGo
  • Local router for Claude Code and Codex that has Jev assess each new task, then pins a policy-chosen model and effort for the conversation.

    ProxybetaTypeScript
  • CLI that filters coding-agent subscriptions by quota and policy, then asks TypeSafe to rank the rest and pick a reasoning effort.

    ProjectprototypeTypeScript