Skip to content

LLM Router

The PRX router is an intelligent model selection system that automatically chooses the best LLM provider and model for each request. It balances quality, cost, and latency using multiple routing strategies.

Overview

Instead of always using a single model, the router dynamically selects from configured models based on:

  • Query complexity and type
  • Model capability scores and Elo ratings
  • Cost constraints
  • Latency requirements
  • Historical performance data

Routing Strategies

StrategyDescriptionBest For
HeuristicRule-based scoring using query featuresSimple setups, predictable behavior
KNNSemantic similarity to past successful queriesLearned routing, high accuracy
AutomixStart cheap, escalate on low confidenceCost optimization

Configuration

toml
[router]
enabled = true
strategy = "heuristic"  # "heuristic" | "knn" | "automix"
default_model = "anthropic/claude-sonnet-4-6"

[router.models]
cheap = "anthropic/claude-haiku"
standard = "anthropic/claude-sonnet-4-6"
premium = "anthropic/claude-opus-4-6"

Released under the Apache-2.0 License.