How smart routing works

Seven analyzers, sub-millisecond decision, no LLM call.

Most LLM proxies route based on the model name you ask for. HiWay routes based on what your prompt actually needs. The decision is made by a deterministic CPU-only scoring engine in less than a millisecond — no second LLM call, no model in the loop, no surprise latency.

The seven analyzers

Each request runs through seven independent analyzers, each producing a score between 0 and 1. The weighted sum gives a complexity score, which maps to a tier (light, standard, heavy).

  • Intent — greeting, simple question, confirmation, action request, expert query…
  • Complexity — number of constraints, structured output requirements, multi-step instructions
  • Tools — presence of function/tool definitions and how many
  • System prompt — length and density (a 4 K-token system prompt usually means an agent context)
  • Code presence — does the user attach code blocks, mention file paths, talk about debugging?
  • Domain — finance, medical, legal, security, etc. → bumps to a higher tier
  • Conversation context — total tokens already exchanged, depth of the conversation

From score to tier

The default thresholds are: [0.0, 0.3] → light, [0.3, 0.7] → standard, [0.7, 1.0] → heavy. A confidence margin bumps requests near the boundary up by one tier, so we never undercut quality on borderline cases.

From tier to provider

Once HiWay knows the tier, it picks the actual model based on your settings: which providers you enabled in Settings → LLM Providers and your routing profile (Budget / Balanced / Quality). The resolver looks at every model that matches the tier across your enabled providers and picks one according to the strategy.

Routing profile cheatsheet

ProfileSelection strategyTypical winner for the light tier
BudgetCheapest input priceMistral Small ($0.10/M)
BalancedBest quality / dollar ratioClaude Haiku 4.5 ($0.80/M, quality 60)
QualityHighest quality_scoreClaude Haiku 4.5

Override anything

Add the X-Force-Model header to any request and HiWay sends it straight to that model, bypassing scoring. Useful for the few cases where you know better than the engine.