s1d1-router / integrations /policy.example.yaml
scombat's picture
Loader from the Hub (tokenizer config, vocab map, MLX/ONNX), four tiers, train.py, judge/, card fixes (docs/16)
58d8bb0 verified
Raw History Blame Contribute Delete
3.29 kB
# Example policy for s1d1-router: which model and which reasoning effort for each request.
# Rules are tried in order; the first one that matches wins. Thresholds sit halfway between the tier scores
# (trivial 0.01 | low 0.25 | medium 0.50 | high 0.75; the score itself goes up to 1.00), so 0.375 / 0.625 separate
# the tiers and 0.875 isolates the top of the scale.
# START HERE, THEN CALIBRATE ON YOUR OWN TRAFFIC: these numbers are a reasonable default, not a validated optimum.
version: 1
effort_scale: [low, medium, high, xhigh, max] # from least to most reasoning
# Used when no rule matches, and when the router is unavailable or too slow (set your own timeout, ~150 ms).
default: {tier: mid, effort: medium}
# A prompt that starts with one of these strings is forced to that tier (the user always wins).
overrides:
"!small": small
"!mid": mid
"!large": large
"!frontier": frontier
# Within one session: never go down once escalated (a model switch breaks the prompt cache and the
# reasoning blocks of the previous turns), and switch at most N times.
session:
escalate_only: true
max_switches: 6
rules:
# 1. The top of the scale: the top model, high effort.
- name: very-hard
when: {complexity_min: 0.875}
tier: frontier
effort: xhigh
# 2. Hard prompts. Code, maths, reasoning and planning get more thinking than the rest.
- name: hard-technical
when: {complexity_min: 0.625, task_in: [coding_debugging, math, reasoning, planning, data_analysis]}
tier: large
effort: high
- name: hard-other
when: {complexity_min: 0.625}
tier: large
effort: medium
# 3. Anything that acts on tools (files, shell, browser, external data) never goes to the smallest tier:
# small models make more tool-call mistakes, and a failed loop costs more than a bigger model.
- name: agentic
when: {needs_tools: true, complexity_max: 0.625}
tier: mid
effort: medium
- name: agentic-task
when: {task_in: [action_execution, data_analysis], complexity_max: 0.625}
tier: mid
effort: medium
# 4. Medium prompts.
- name: medium-reasoning
when: {complexity_min: 0.375, task_in: [math, reasoning, planning]}
tier: large
effort: medium
- name: medium-code
when: {complexity_min: 0.375, task_in: [coding_debugging]}
tier: mid
effort: medium
- name: medium-other
when: {complexity_min: 0.375}
tier: mid
effort: low
# 5. Trivial and low prompts without tools: the smallest model, minimal reasoning.
- name: easy
when: {complexity_max: 0.375, needs_tools: false}
tier: small
effort: low
# One profile per harness: how the tiers map to its model ids, and which efforts it accepts.
profiles:
claude_code:
models: {small: claude-haiku-5-5, mid: claude-sonnet-5-5, large: claude-opus-5-5, frontier: claude-fable-5-1}
efforts: [low, medium, high, xhigh, max] # request body field output_config.effort
codex:
models: {small: "<your-small-model>", mid: "<your-mid-model>", large: "<your-large-model>", frontier: "<your-top-model>"}
efforts: [low, medium, high, xhigh] # config key model_reasoning_effort
generic:
models: {small: local-small, mid: cloud-mid, large: cloud-large, frontier: cloud-top}
efforts: [low, medium, high]