Skip to main content

Overview

85% of agent traffic is simple queries hitting expensive models. The ModelRouter classifies incoming requests by complexity and routes them to the cheapest model that can handle them, achieving 40–85% cost savings.

Quick Start

Built-in Complexity Classifier

The built-in classifier runs in under 1ms with no LLM call. It scores on:

Custom Routing Rules

Override the classifier with explicit rules:

Outcome Tracking

When outcomeTracking: true, the router logs success/failure per tier in a ring buffer:

Events