ai / router

A router picks the model for each task. I do not choose one per prompt.

Why route

Models differ in cost and capability, and the gap moves every few months. A fixed choice goes stale. A router holds the policy in one place, so a new model is a change to the policy and not to my habits.

My policy

A custom router in my harness sorts each task by complexity. A rename needs less reasoning than a design change across packages.

CursorBench is my go-to benchmark for coding models. It tests agents on ambiguous, multi-file tasks from real Cursor sessions. I give it the most weight when I choose models to test on my own work.

I checked CursorBench 4.0 on November 13, 2026. These options have different costs per task:

Model and reasoning Score Cost per task
Sonnet 5.5 High 47.8% $1.20
Opus 5.5 Medium 52.5% $2.91
Opus 5.5 High 56.0% $3.97
Gemini 4 Carbon Medium 60.1% $8.49

These are benchmark task costs, not token prices. Cursor warns that small score differences may not be meaningful. I treat steps as a separate measure; fewer steps do not prove a shorter elapsed time.

I would test Sonnet High for easy tasks and keep Opus Medium or High as candidates for harder work. This is a test plan, not a record of a router configuration change. I compare cost per accepted task and elapsed time with the same tools and checks.

Gemini Flash 3.8 is absent from the current board. That gives me no current score to compare; it does not establish that the model is unavailable.

When a provider goes down, the router moves to the closest model from another provider. I keep one router as my default and change its model choices as the evidence changes.

Inside an application

The same idea applies when my program calls a model. I map a task tier to a model alias, and the alias is the only place a model name appears. See ai / api. A hosted router such as OpenRouter moves that mapping and the failover out of my code. It costs one more hop and one more vendor.

For example, this map reads the model names from configuration:

var models = map[string]string{
	"fast": os.Getenv("MODEL_EASY"),
	"deep": os.Getenv("MODEL_HARD"),
}

← All articles