Skip to navigation

Intelligent routing

Send each request to the cheapest model and reasoning level likely to handle it, or trade some cost for speed

The Intelligent strategy picks a model and reasoning level for each request from the models in your policy. Easy requests go to cheaper models and lower reasoning levels, hard ones to stronger models or higher levels. Use it for mixed workloads where one model is overpriced for some requests and underpowered for others.

How it works

  1. Gateway scores how hard the request is
  2. For each model in the policy, and each reasoning level it can run, Gateway estimates the chance of handling a request that hard, from Merge’s measurements of that model and level
  3. Options below Gateway’s quality bar drop out
  4. Among the rest, the preset picks the winner: the lowest cost per successful request on Cost, with speed counting for more on Balanced and Performance
  5. Gateway sends the request to that model and level, then picks its vendor

If no option clears the bar, the one most likely to succeed serves the request. With include_routing_metadata: true, the response’s routing block shows the model and routing.reasoning_effort_applied.

Reasoning level

Gateway chooses the level only when nothing else sets it:

  • A reasoning.effort in the request wins
  • Otherwise a policy default level wins
  • Otherwise Gateway picks one, within the policy’s minimum and maximum for that model

To let Gateway choose, leave the policy’s default level unset and use the minimum and maximum to keep it in range. See reasoning effort.

Cost, Balanced, and Performance

Each policy has a cost and speed preset, Cost by default.

PresetPicksAPI cost_speed_preset
CostThe cheapest option that clears the quality barSAVE_COST
BalancedA faster option when the time saved is worth the extra costBALANCED
PerformanceFaster options, accepting a larger cost increasePREFER_SPEED

Every preset uses the same quality bar, so a faster pick is still one Gateway expects to handle the request.

The presets only change requests that include tools, such as coding agent and other agent calls; other requests route as Cost. Speed comes from Merge’s measurements of agent tasks per model and reasoning level. An option without speed measurements gets no speed advantage, so a policy whose models have none routes the same on every preset. The gain is largest when a policy mixes models with very different speeds.

Which models it can choose

Intelligent chooses among the policy’s models that Merge has measured. It ignores models without measurements, so they never serve requests. If fewer than two of the policy’s models have measurements, or scoring fails or takes over 500 ms, the policy’s most capable model serves the request.

Configure an Intelligent policy

WhereHow
DashboardRouting policies → Policies, strategy Intelligent, then a Cost and speed preference
/v1/routing-policies API"strategy": "INTELLIGENT", allowed_models, and cost_speed_preset (SAVE_COST, BALANCED, or PREFER_SPEED, default SAVE_COST). See the API reference

Next steps