Open source · Powered by Jev from TypeSafe

The right model for every prompt.

Jev Router is one OpenAI-compatible endpoint for all your LLMs. Send model: "auto" and Jev picks the right-sized model for each request, then tells you why.

Self-hosted · MIT licensed · Your keys stay on your server

POST /v1/chat/completions model: auto
Prompt
Jev decision
Ranking

    Illustrative routing. Try your own prompts in the built-in Playground.

    100%
    right-sized model picks in the 30-prompt eval
    35.6%
    cheaper than always using the strongest model
    295 ms
    median routing decision
    0
    hard prompts sent to a weak model

    Routes across the providers you already use

    • Liquid AI
    • OpenAI
    • Anthropic
    • Google Gemini
    • DeepSeek
    • Groq
    • OpenRouter
    • Ollama
    • LM Studio
    • vLLM

    Drop-in

    Change one line. Keep your code.

    Point any OpenAI SDK at Jev Router and set the model to auto. Streaming, tools and JSON mode work as before. Every response says which model answered and why it was picked.

    • Works with the OpenAI SDKs, LangChain, LlamaIndex, the Vercel AI SDK and curl
    • Choose a strategy per request: balanced, quality, cheapest, fastest or privacy
    • The decision also comes back as X-Jev-Router-* headers, so it works for streams too
    from openai import OpenAI
    
    client = OpenAI(
        base_url="http://localhost:8000/v1",
        api_key="your-router-key",
    )
    
    resp = client.chat.completions.create(
        model="auto",  # let Jev decide
        messages=[{"role": "user", "content": "Refactor this to be async..."}],
    )
    
    print(resp.model)
    # liquid/lfm2.5-24b-a2b
    print(resp.model_extra["jev_router"]["routing_reason"])
    # coding request, complex complexity; balanced strategy chose ...

    How it works

    Hard rules first. Then one Jev call decides.

    Most routers use keyword rules, embeddings or an extra LLM call that returns prose. Jev Router asks Jev a set of typed questions and gets back real probabilities it can rank models with.

    Jev Router architecture: clients (your app, the dashboard, the CLI) call one OpenAI-compatible FastAPI service. Each request runs a six-step pipeline (extract features, hard filters, one Jev decision, rank, execute with fallbacks, trace) backed by the model registry, Settings and storage, then goes to hosted, local or custom model providers.
    Select the diagram to open it full size
    1. 01

      Extract

      Read the prompt, history, token count, images, audio, tools and JSON mode.

    2. 02

      Filter

      Drop every model that can't serve the request: context, modality, privacy, budget. Record why.

    3. 03

      Decide

      One Jev call with typed questions: which model fits, how hard is it, does it need a frontier model.

    4. 04

      Rank

      Score each model on fit, capability, quality, cost and latency, weighted by your strategy.

    5. 05

      Execute

      Call the top model. If it fails or times out, the next capable model takes over.

    6. 06

      Trace

      Store the decision, ranking, attempts, tokens, cost and latency for every request.

    choiceWhich eligible model fits this request?
    score 0–3How technically demanding is it?
    noulDoes it genuinely need a frontier model?
    noulIs it harmful, an injection or PII?

    Features

    Everything a router needs. Nothing you have to babysit.

    Four routers in one

    Route to models, agents and tools, and screen requests with guardrails, all from the same engine.

    Five strategies

    balanced, quality, cheapest, fastest and privacy. Pick one per request with a header or body field.

    Automatic fallbacks

    If the chosen model errors or times out, the next-ranked capable model answers. Every attempt shows in the trace.

    Guardrails

    Block prompt injection, harmful content and PII before a request reaches any model, with a confidence score for each check.

    Never a single point of failure

    If Jev is slow or down, a local heuristic router takes over and the trace says so.

    Built-in dashboard

    Spend, savings, latency and model mix, plus a playground and a trace explorer for every decision.

    Bring your own keys

    Add provider keys and OpenAI-compatible servers in Settings. Keys are encrypted at rest and never sent to clients.

    Local models too

    Connect Ollama, LM Studio or vLLM. The privacy strategy keeps requests on local models only.

    Observability

    See every decision, not just the bill.

    Each request gets a trace: the model Jev picked, the ranking, the reason, every fallback attempt, tokens, cost and what it would have cost on your strongest model.

    Jev Router trace view showing the selected model, why it was picked, strategy, complexity, cost, latency and the model ranking

    Results

    Measured, not claimed.

    The repo ships a 30-prompt routing eval: 15 light and 15 heavy prompts across chat, coding, math, analysis, extraction and writing. Here is a live run with the Liquid models and the balanced strategy.

    MetricJev RouterHeuristic router
    Right-sized model (tier accuracy)100%53.3%
    Task-type accuracy83.3%46.7%
    Hard prompts sent to a weak model014 of 15
    Cost saved vs. always using the strongest model35.6%68.7%*
    Decision latency p50 / p95295 / 409 ms<1 ms

    * The heuristic only looks cheaper because it sends 14 of the 15 hard prompts to a model that's too weak for them.

    $ jev-router eval Run it against your own keys and prompts.

    Quickstart

    Running in about two minutes.

    Python 3.11+ or Docker. You need a Jev API key and at least one provider key, or a local Ollama.

    1

    Install

    git clone https://github.com/AIAnytime/Jev-Router.git
    cd Jev-Router
    uv venv && uv pip install -e ".[dev]"
    2

    Configure

    cp .env.example .env
    # JEV_API_KEY=...
    # LIQUID_API_KEY=...   any provider key works
    3

    Run

    jev-router serve
    # API + dashboard on http://localhost:8000
    Prefer Docker?
    docker compose up -d --build
    Full setup guide →

    Stop picking models by hand.

    Let Jev make the call on every request, and see exactly why it chose.