跳到主要内容
版本:最新版

Algorithms

Overview

An algorithm runs after a decision matches. It either selects one model from the decision's modelRefs or coordinates several of them through the Looper. It does not decide whether the route is eligible; signals and decisions do that first.

Key Advantages

  • Keeps route eligibility separate from model choice.
  • Makes selection and orchestration policy reviewable per decision.
  • Supports both stateless policies and bounded multi-model execution.

What Problem Does It Solve?

A matched route may have several valid model candidates. Algorithms make the choice explicit: fixed ordering, semantic fit, observed latency, multiple runtime factors, a learned selector, or multi-model orchestration.

When to Use

Add an algorithm when a decision has more than one candidate or deliberately runs a multi-model workflow. With one candidate, omit the algorithm unless the chosen Looper supports and needs a single-model execution plan.

Configuration

Algorithms are decision-local:

routing:
decisions:
- name: responsive-route
description: Prefer the model with the best observed latency.
priority: 100
rules:
operator: AND
conditions: []
modelRefs:
- model: small-model
- model: large-model
algorithm:
type: latency_aware
latency_aware:
tpot_percentile: 90
ttft_percentile: 95

Choose an algorithm from the inventory below, then follow its guide for the required fields and dependencies.

Algorithm Inventory

Selection Algorithms

Selection algorithms return one candidate model.

TypeStatusGoalMain dependencyGuide
staticsupportedUse declared order or fixed domain scoresNoneStatic
router_dcsupportedMatch request semantics to model descriptionsEmbedding runtime and useful model cardsRouter DC
latency_awaresupportedPrefer the candidate with the best observed TTFT/TPOTPer-process latency observationsLatency Aware
multi_factorsupportedBalance quality, latency, cost, and load with optional SLO filtersModel metadata and live local metricsMulti Factor
hybridsupportedBlend several selector scoresComponent selector inputsHybrid
automixexperimentalOptimize an estimated cost-quality valueCandidate pricing and quality metadataAutoMix
promptexperimentalLet a bounded helper model choose from declared candidatesOpenAI-compatible helper model and Looper endpointPrompt
knnexperimentalFollow similar labeled examplesTrained selector artifact and embeddingsKNN
kmeansexperimentalRoute through learned traffic clustersTrained selector artifact and embeddingsKMeans
svmexperimentalApply a learned decision boundaryTrained selector artifact and embeddingsSVM
mlpexperimentalApply a learned nonlinear classifierTrained selector artifactMLP

Looper Algorithms

Looper algorithms make additional model calls through global.integrations.looper.endpoint. They increase latency and token usage, and intermediate content is sent to every configured worker involved in the run.

TypeStatusGoalGuide
confidencesupportedEscalate sequentially until confidence clears a thresholdConfidence
ratingssupportedReturn one choice from each candidate with bounded concurrencyRatings
remomsupportedExplore several reasoning paths over multiple rounds, then synthesizeReMoM
fusionexperimentalRun an analysis panel and judge/synthesis passFusion
workflowsexperimentalExecute a bounded static or planner-generated worker flowRouter Flow

Treat experimental algorithms as evaluation features: validate them on your traffic before using them for production routing.

Operational Boundaries

  • Candidate model names must resolve through routing.modelCards and providers.models in a complete config.
  • Learned selectors need artifacts produced for the same embedding dimension and candidate labels used at runtime.
  • Latency and load observations are local to a Router process; they are not a cluster-wide scheduler.
  • Looper algorithms share request content with their configured workers. Apply privacy and provider-boundary decisions before choosing them.
  • Validate a complete config with vllm-sr validate --config config.yaml.