Skip to content
Cette page a été générée et traduite avec l'aide de l'IA. Si vous remarquez des inexactitudes, n'hésitez pas à contribuer. Modifier sur GitHub

Heuristic Router ​

The heuristic router uses a rule-based scoring system to select the optimal model for each query. It analyzes query features (length, complexity, tool requirements) and matches them against model capability profiles.

Fonctionnement ​

  1. Feature extraction -- analyze the query for length, keyword patterns, and tool requirements
  2. Capability scoring -- score each model's suitability based on extracted features
  3. Cost weighting -- apply cost preferences to favor cheaper models for simple queries
  4. Selection -- choose the highest-scoring model that meets minimum quality thresholds

Scoring Factors ​

FactorWeightDescription
Capability match0.4Model's ability to handle the query type
Elo rating0.2Historical model performance
Cost efficiency0.2Tokens per dollar
Latency0.1Average response time
Context window0.1Fits the conversation context

Configuration ​

toml
[router]
strategy = "heuristic"

[router.heuristic]
complexity_threshold = 0.6
prefer_cheap_below = 0.4
elo_weight = 0.2
cost_weight = 0.2

Voir aussi Pages ​

Released under the Apache-2.0 License.