Skip to content

Jev Model Router — lucianfialho

A Python library that routes each prompt to the cheapest OpenRouter model that can handle it: Jev classifies domain and complexity, then a deterministic scoring function ranks OpenRouter's live catalog against that classification.

Stars
2
Language
Python
License
MIT
Published by
Community
Author
lucianfialho
Last verified
Oct 2026

Cost-optimized OpenRouter model router using TypeSafe's Jev, with a live full-catalog scorer instead of a hardcoded model list

Forks
0
Last pushed
Updated Sep 2026

Repo stats from the GitHub API, cached Oct 2026.

This is one of several Jev listings for the same project. The canonical entry is Jev Model Router — satviksinha.

About this project

A cost-optimized model router for OpenRouter, using TypeSafe's Jev to classify each request and pick the cheapest model that can actually handle it. Distributed as jev-model-router; imported as modelrouter (from modelrouter import Router) -- the PyPI/repo name and the Python import name differ, same as e.g. scikit-learn installs as sklearn.

Quoted from the project's README. Read the full README.

Highlights

  • Jev never sees the model list — five narrow questions classify the request, and pure code ranks the live catalog by blended price.
  • Hard constraints like needs_vision and min_context_tokens filter the catalog before any classification call is spent.
  • If the Jev call fails it falls back to cheapest-first ranking with no fabricated classification, rather than blocking or guessing.
  • A Python package with pip install and a Router object, not a proxy you have to repoint clients at.

Watch out

The only evaluation in the digest is eight hand-labeled prompts across four domains, which the README itself calls a small, directional harness rather than a formal benchmark, and it explicitly is not a rigorous cost-savings claim. Ranking targets a price percentile derived from the classified complexity score, so a cheap pick is a policy consequence of the classifier rather than a verified capability match. Nothing is hardcoded: the catalog is refetched from OpenRouter on every decision behind a 600-second TTL, so routing shifts whenever OpenRouter's catalog does. The prompt text goes to TypeSafe for classification, and to OpenRouter as well when you call .complete(). The README also notes an earlier pricing formula silently sent mid-complexity requests to roughly 67 times the catalog median price, caught in review before it shipped. Copy reviewed against the repository README on 2026-10-04, not from running it.

Questions about this entry

Short answers drawn from the linked project or page.

More Jev resources like this

9GitHub stars
Hermes Agent plugin exposing Jev as four coding-workflow tools for parallel judgments, binary checks, option routing and rubric scoring, with a bundled question-design skill.
Jev Agents & MCP#community#jevbest#catalog-import
LangChain deepagents middleware that replaces SkillsMiddleware with per-turn judging, loading only the SKILL.md files a turn needs so large catalogs stay out of the prompt.
Jev Agents & MCP#community#jevbest#catalog-import
72GitHub stars
MCP server over stdio that gives coding agents fourteen Jev judgment tools, turning evidence plus an enumerable question into auto, review, or escalate actions from calibrated probabilities.
Jev Agents & MCP#community#jevbest#catalog-import
25GitHub stars
Agent-oriented playbook for using Jev as a cheap, fast decision layer that triages, classifies, scores, and gates work before expensive browser, research, retry, or subagent steps.
Jev Agents & MCP#community#awesomejev#catalog-import
23GitHub stars
Coding-agent plugin that routes prompt classification, subagent tiering, edit rule checks, and fast Jev-backed compaction through small typed judgments.
Jev Agents & MCP#community#jevbest#catalog-import
14GitHub stars
Polymarket bot that pairs a web-search researcher brief with Jev pricing, trading only where Jev probability clears the order book by a set edge.
Jev Agents & MCP#community#awesomejev#catalog-import
Back to all resources

From the Jev community

Posts from builders shipping with Jev right now.

Follow @typesafeai