Jev LLM Cost Router
Python, Ollama, Jev, LLM Routing, Model Evaluation
Show descriptionHide description
A router that uses Jev, TypeSafe AI's decision model, to decide when a cheap small LLM (qwen3:1.7b) is good enough and when a prompt needs a larger one (qwen3:8b), plus an evaluation against simple baselines on a cost versus accuracy curve. It compares two designs on 400 prompts from MMLU, MMLU-Pro, ARC-Challenge and GSM8K, with thresholds tuned on a dev split and 95% bootstrap intervals on the test split: pre-routing, where Jev predicts from the prompt alone whether the small model will be right, and a cascade, where Jev checks the small model's answer and escalates only the likely wrong ones. Pre-routing did no better than random routing, but Jev proved a reliable answer checker (AUROC 0.927), and the cascade cut compute time by 41% against always using the large model, at 73% accuracy against 80%.


















