Models, Routing & Thinking

A Model Route (/models) maps a client-facing Model ID to one or more upstream provider targets with explicit purpose validation, priority tiers, failure recovery, and optional client billing.

Routing priority lanes and pre-commit failover diagram

Model editor contract section highlighting Model ID and Purpose fields

Prerequisites

  • At least one configured provider: Ensure the provider's Upstream models list shows the target model you want to bind.

Route purpose (single purpose per route)

Every route declares one purpose (replacing legacy output-modality selectors):

PurposeIntended useEligible upstream models
Inference (inference)Chat, Responses, Messages, Gemini, Media understanding, Platform tasks, and Local Web Search reasoningModels capable of text/multimodal inference
Image Generation (image_generation)Media generation (generate tool / image endpoints)Upstream models reporting image generation capability
Web Search (web_search)External Route backend in Web Search (DeepSeek, Codex, Antigravity native search)Upstream models with native search capability
Switching purposes & capability tags

web_search routes do not appear in client model catalogs or Console Chat. If you change an existing route's purpose, any incompatible targets—even disabled ones—must be removed or replaced before saving. Trait tags such as image_input, reasoning, structured_output, or upstream endpoint paths do not block inference or web_search eligibility; only explicit operation capabilities (infer, search, media_image, image_output) restrict route purposes.

Steps

  1. Create, search, or compare routes

    On /models, use instant keyword search across display names, client Model IDs, target models, provider names, status, and route purpose. You can also click Model Picker (https://model-picker.stravia.cn/) from the header to explore upstream models, or click New model (/models/new) to create a route.

  2. Bind targets into priority lanes

    Model editor target lane showing a valid bound upstream model

    Drag targets using the mouse or touch handle across Lane 0, lower-priority backup lanes, or the disabled pool:

    • Balance mode: Choose Traffic equalization or Latency preference within a lane.
    • Priority & affinity: Normally Stravia exhausts higher-priority lanes before trying lower-priority backup lanes; note that active session affinity rules can prioritize an affinity target before plain lane order.
    • Per-target resilience: Configure First-token timeout (first_token_timeout_ms), Target retry budget (target_retry_budget), and Target cooldown (target_cooldown_ms).
  3. Review thinking-level mappings

    For inference routes, Stravia maps client thinking levels (off, minimal, low, medium, high, xhigh, max) using canonical effort controls only: each row either maps to an upstream level (Map to level / Effort) or skips the target for that level (Disable level / Hidden). Legacy manual-budget models (older Claude, Bedrock Claude, Gemini 2.5, Cohere) and toggle-based vendors (DeepSeek, Xiaomi, Zhipu/ZAI, Alibaba/Qwen, Baseten, MiniMax M3, pure-toggle Kiro) translate canonical efforts at egress via shared static budget tables (minimal: 1024, low: 2048, medium: 8192, high: 16384, xhigh: 24576, max: 32768) or vendor-native switches. Open any target card if Thinking map needs a change appears and adjust or disable affected rows.

    Breaking in v0.7.6 for legacy thinking budgets

    Inbound Anthropic requests sending thinking.type = "enabled" or non-null thinking.budget_tokens, and Google Gemini requests sending non-null thinkingConfig.thinkingBudget, are rejected with HTTP 400. Migrate clients to Anthropic thinking: {"type": "adaptive"} + output_config.effort (or thinking: {"type": "disabled"}) and Gemini thinkingConfig.thinkingLevel.

  4. Understand pre-commit failover & upstream RPM queues

    • Pre-commit failover: Before output commits to the client, Stravia can retry the same target or move to another eligible target on retryable failures (respecting Retry-After without exceeding the overall request deadline). A clean empty-stream EOF before any output commits can trigger at most one extra retry on the same target (when policy permits) before failing over to the next target. Non-recoverable errors such as context-length exceeded, content filtering, or invalid parameters stop immediately.
    • Upstream RPM queue: If an upstream model has a shared RPM limit configured on /providers/[id], all routes sharing that target model share that queue, controlled globally via Settings → Upstream RPM queue.
  5. Configure optional Route Billing

    Independent of provider cost tracking, you can enable route Billing (per_call fixed amount or per_token tiered pricing with optional timezone peak windows) in USD or your configured custom currency.

Verify

Save the route, confirm every intended target sits in an active lane without purpose or thinking-mapping badges, and test a request through Chat (/) or an API key.

Troubleshooting

  • Target shows "Purpose does not match this route": The bound upstream model does not advertise capabilities matching the route's selected purpose. Remove the target or switch the route's purpose.
  • Route missing from Connect clients or /codex/models: Confirm the route is enabled, its purpose is inference (or image_generation where supported), and the selected API key authorizes it.

Next