Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Route Profile

A route profile is a JSON file that controls how the inference router selects between models. The router computes a weighted score from prompt features and compares it against a threshold.

Schema versions

Two schema versions are supported. Version 2 adds additional prompt-analysis features.

v1

{
  "schema_version": 1,
  "bias": 0.0,
  "weights": {
    "token_count": 0.3,
    "question_mark": 0.2,
    "code_marker": 0.25,
    "tool_hint": 0.25
  }
}

v2

{
  "schema_version": 2,
  "bias": 0.0,
  "weights": {
    "token_count": 0.15,
    "question_mark": 0.10,
    "code_marker": 0.15,
    "tool_hint": 0.15,
    "prompt_length_bucket": 0.15,
    "reasoning_chain_depth": 0.15,
    "natural_language_ratio": 0.15
  }
}

Fields

FieldTypeDescription
schema_versionint1 or 2
biasfloatConstant added to the score before threshold comparison
weights.token_countfloatWeight for normalized token count
weights.question_markfloatWeight for presence of question marks
weights.code_markerfloatWeight for code-related markers (backticks, keywords)
weights.tool_hintfloatWeight for tool-use indicators
weights.prompt_length_bucketfloat(v2) Weight for prompt length category
weights.reasoning_chain_depthfloat(v2) Weight for detected chain-of-thought depth
weights.natural_language_ratiofloat(v2) Weight for ratio of natural language to structured tokens

The default classification threshold is 0.55. Scores above the threshold route to the higher-capability model; scores below route to the faster model. Override the threshold with router.threshold in runtime.toml.