Multi Factor
Overview
multi_factor is a selection algorithm that composes four raw runtime signals — quality, latency, cost, and load — into a single weighted score per candidate, with optional SLO hard ceilings that prune candidates before scoring.
It aligns to config/algorithm/selection/multi-factor.yaml and addresses issue #37.
Key Advantages
- Single-decision SLO-aware routing without orchestrating multiple selectors.
- Each signal is a live source: quality from
quality_scoreconfig, latency frompkg/latencypercentiles, cost from pricing, load frompkg/inflight. - Min-max normalization across the candidate set means weights have intuitive meaning regardless of absolute signal scales.
- No model state to train. No external service required.
- Hard SLO ceilings (TPOT, TTFT, cost, in-flight) prune unsafe candidates before scoring.
What Problem Does It Solve?
Real routes care about more than one dimension at once: a faster cheaper model and a slower better model both exist in the same candidate pool, and the "right" answer depends on current load and SLO targets, not just the static config. Existing single-signal selectors (latency_aware, cost-only routing, quality-only routing) force a hard choice. multi_factor lets one decision rule express a smooth tradeoff across all four dimensions, with optional hard SLO ceilings to fence off unsafe candidates.