LLM Classifier Routing
LLM classifier routing asks a classifier model to evaluate each request, then
sends the request to a weak or strong backend. Use it when routing should
depend on request content, tool use, context needs, or risk level instead of a
fixed traffic split.
The classifier runs before the selected backend. Low-confidence and abstained
results use the configured default tier. Classifier errors do the same when
classifier_fail_open is enabled, which is the default. The built-in two-tier
policies default to strong.
Choose a policy
Set profile for the traffic you expect:
For coding-agent traffic, start with profile: coding_agent.
Configure a classifier route
Define the strong, weak, and classifier models in a deterministic route:
Start the server with:
The route ID (smart) is the model ID clients select for classifier-based
routing.
Try the profile with representative requests:
Treat these as smoke checks, not fixed test vectors: the classifier model and prompt determine the verdict.
Useful options
For a self-hosted strong, weak, or classifier target, configure it like any other OpenAI-compatible endpoint. See Self-hosted targets.
Session affinity
LLM classifier routing supports optional session affinity through
DeterministicRoutingConfig. Set session_affinity: true to share one affinity
store between the classifier and tier selector. After any configured
affinity_warmup_turns, the first confident verdict pins the tier. Later turns
reuse that tier before classification, so they skip the classifier call;
abstain, low-confidence, missing-signal, and fail-open decisions do not pin.
Configure these fields on the type: deterministic entry in the routes:
bundle. See Session Affinity for YAML and
How session affinity composes for
the interaction with routing decisions.
If the per-request classifier cost is too high, use Stage-Router Routing, which can route many turns from tool and agent-progress signals without an extra classifier call.