
BanditRoute treats each AI model as an "arm" in a multi-armed bandit problem. Using Thompson Sampling conditioned on task type (code, math, QA, creative), it learns over time which model to send each query to balancing correctness against token cost and latency via a custom reward function, rather than optimizing for accuracy alone. No routing rule was ever hand-written; behaviors like sending math questions to the strongest model and easy QA to a cheap one emerged entirely from feedback. The project is validated two ways: a full simulation (2000 queries, 4 mock model profiles) that shows clean convergence and ~93% cost savings, and a live integration that runs the same bandit logic against real free-tier models via the OpenRouter API proving the approach works beyond simulation, not just in theory.
13 Jul 2026