Overview
The Complexity Router assigns each incoming request a Simple, Medium, or Complex tier, using a decision model, semantic reference phrases, or an LLM classifier. The tier is exposed as a flat string variable (complexity_tier) in Bifrost’s CEL routing engine, so you can write routing rules like:
complexity_tier. If it produces no tier (the classifier is unavailable, times out, or finds no match), the complexity rule does not match and the request continues through normal routing.
Routers do not set
complexity_tier. Rules that use it keep reading it from the Complexity Router until you move them. When a request matches such a rule and a router also takes it, the request is classified twice.Classifiers
The Complexity Router uses the same classifiers and settings as Routers. They are documented on the Routers page:- Choosing a classifier: the decision model, Semantic, and the LLM classifier compared.
- Decision model classifier: choosing the decision model, tier guidance, and timeout, confidence, and cost.
- Semantic classifier: reference phrases and how much conversation to embed.
- LLM classifier: a chat model that names the tier from a prompt you can edit.
- Fallback classifiers: the decision model or an LLM answering when no phrase matches.
- Session-aware routing: keeping a session on its highest tier.
- Which requests can be classified.
Configuration
Pick a classifier, then configure it. The decision model needs its provider configured with an enabled key (or keyless). Semantic needs an embedding provider and model with an enabled key. The dashboard warns about missing or broken keys.- Web UI
- API
- config.json
Navigate to Models > Complexity Router. On Classifier, choose Decision model, Semantic, or LLM classifier, then select Next. Switching later keeps the other classifier’s saved settings.
Decision model configuration


Both classifiers


- Tier guidance: each tier’s card shows its definition, Signals, and Examples, pre-filled with the defaults. Use the pencil icon to edit a definition; type and press Enter to add an entry, or × to remove one. A reset icon appears beside a changed field and restores it.
- Restore defaults (footer) resets all three tiers.
- Edit model configuration (header) opens Model configuration: the provider and decision model, Max messages to send (
previous_message_count), Classification timeout (ms), and Confidence threshold (min_confidence). If the provider is missing, failing, or has no enabled key, a warning links to the fix and Save stays disabled.

- Phrase to Tier Mapping: edit each tier’s reference phrases. Restore defaults (footer) restores the 150 shipped phrases.
- Edit embedding configuration opens provider, model, similarity floor, history, timeout, budgets, and phrase storage. The Classifier ready badge shows warmup state.
- When no phrase matches confidently (same sheet): choose Decision model or LLM classifier to set up a fallback. None keeps the saved fallback settings for later.
- Fallback Tier Guidance (main page, decision-model fallback): the same tier guidance as above. Reset all restores the defaults.
- Fallback Classification Prompt (main page, LLM fallback): Reset to default restores the shipped prompt.

- Session-aware routing: retains the highest tier reached by each identified session for 24 hours of inactivity. The toggle is off by default.
Classifier status and warmup
GET /api/routing/complexity-analyzer-status and the badge in the page header report Semantic’s warmup state (disabled, warming, ready, or failed), whether an llm block is configured, the shipped LLM fallback prompt (llm_default_prompt), and the shipped tier guidance (decision_defaults). POST /api/routing/complexity-analyzer-status/retry restarts a failed warmup. The decision model has no warmup and is not covered by the status.
The states work as they do for routers. See Status and warmup.
Routing with complexity_tier
Once a classifier is ready, use complexity_tier in any CEL routing rule, on its own or combined with headers, request type, scope, or any other condition.
Complexity Router only sets
complexity_tier; it does not create rules. Add a rule for each tier you want to route. A router does both in one place.Available operators
Combining with other rule conditions
For example:Use case examples
Complex carve-out
Route only frontier-worthy requests to your strongest model and let everything else keep using your existing routing:Full three-tier ladder
See Example: a three-tier ladder for the three rules and the single router that replaces them.Observability
When a routing rule referencescomplexity_tier, the request log records complexity_tier, complexity_mechanism (semantic, decision, llm, session, or skipped), and complexity_score (Semantic only). Filter the log explorer by tier and mechanism, or call the logs API:
complexity_score is shown but not filterable, and old REASONING rows are still filterable. The routing decision log lines, spans, and Prometheus metrics are the same as for routers; see Observability.
Troubleshooting
Rule not matching when complexity_tier is set
First check that the classifier publishes a tier: classification runs only when a routing rule referencescomplexity_tier, and the request needs user text (a system prompt alone is not enough). When classification is unavailable (unsupported input, provider failure, timeout, or a semantic match below min_similarity), the rule does not match and evaluation moves to the next rule, unless session state supplies a tier.
For classifier problems (everything skipped, wrong tiers, fallbacks not running), see Troubleshooting on the Routers page. The checks are the same, using GET /api/routing/complexity-analyzer-status for the status.
Latency doubled after adding a router
A request that matches acomplexity_tier rule and is then taken by a router is classified twice. Move the rule into the router and turn the rule off. See Moving from the Complexity Router.
Lexical keyword classifier (retired)
What this means for existing deployments:- Upgrades are safe. Old configurations still load. Until you configure Semantic or a decision model, no tier is published (
complexity_mechanism: skipped). - Keyword lists became phrase lists. Your entries are kept and mapped to three tiers: Simple stays Simple, Code and Technical become Medium, Reasoning becomes Complex. They are now reference phrases to embed, so short keywords like
"debug"or"api"classify poorly; replace them with full example requests. - Old logs are unchanged. Historical
REASONINGrows stay filterable, but update any routing rule that still matches"REASONING".
Next Steps
Routers
The replacement: classify requests and send each tier to its own model
Moving from the Complexity Router
Move your settings and complexity_tier rules to routers
Routing Rules
Full reference for CEL expressions, scope hierarchy, and rule chaining
Provider Routing
Understand how complexity routing fits into the full request routing pipeline

