1 · Route automatically

model:"auto" classifies the task and picks a tier; check X-Selected-Model to see who answered.

What it is

A request that asks for model:"auto" instead of a real model name. routsi scores the last user message (low/medium/high), maps that level onto the global tiers: map, and forwards to whichever model is behind that tier — all before the first byte goes upstream.

Why

Use this when callers shouldn't have to know or care which model answers — cheap questions should cost cheap-model money, and only the genuinely hard ones should burn a strong (expensive/slow) model. It's the default "just point your SDK at routsi" mode: no per-request routing logic in the client.

Configure

models.yaml
default: gpt-cheap

tiers:                  # what "auto" routes over
  cheap: gpt-cheap       # low
  strong: gpt-strong     # high

models:
  - name: gpt-cheap
    type: forward
    base_url: https://api.deepseek.com/v1
    api_key_env: DEEPSEEK_API_KEY
    upstream_model: deepseek-chat
  - name: gpt-strong
    type: forward
    base_url: https://api.openai.com/v1
    api_key_env: OPENAI_API_KEY
    upstream_model: gpt-5.2
cheap task → cheap model
curl -i localhost:8080/v1/chat/completions \
  -d '{"model":"auto","messages":[{"role":"user","content":"say hi"}]}'
# → X-Selected-Model: gpt-cheap
hard task → escalated model
curl -i localhost:8080/v1/chat/completions \
  -d '{"model":"auto","messages":[{"role":"user","content":"design a distributed consensus protocol with proofs"}]}'
# → X-Selected-Model: gpt-strong

See the exact classification rules: How auto decides.

How to adapt

Point cheap/strong at any two models in your own catalog — a forward (OpenAI-compatible upstream), a dynamic group, or even a CLI agent all work as tier members. To add a real medium tier instead of letting it fall back to the nearest declared level, add a third models: entry and reference it under tiers: (the tiers map currently only has cheap/strong aliases for low/high — a raw medium: key is accepted the same way). If you want per-conversation stickiness on top of this (same thread keeps its escalated tier), see Routing & stickiness.

Next: Bypass to a concrete model →