How a request is routed
Every request goes through three steps in the gateway:1
Classify the request
The harness asks for an Opus-, Sonnet-, Haiku-, or Fable-class model, and Valar sorts the request into one of those four aliases. Anything that matches none of them is treated as Sonnet, the working tier for most coding traffic.
2
Assign the engineer to a cohort
Using the client id on the request (most harnesses send it as an
X-Valar-Client-Id header; Cursor, which cannot set headers, rides it as a token suffix), Valar assigns the engineer to one cohort in the key’s split. The assignment is deterministic and sticky, so the same engineer always lands in the same cohort for a given key and split. Their experience stays consistent from one request to the next.3
Resolve the target model
The cohort pins each alias to a target model. Valar looks up the target for the request’s alias and routes there. For example, an engineer whose cohort maps Sonnet to GLM-5.2 has their Sonnet-class calls served by GLM-5.2.
Auto mode vs. Manual mode
ValarCode has two ways to decide the split.- Auto (default)
- Manual
Valar picks the target model for you. A new coding key starts on Auto, so routing works before you configure anything.Auto runs a Balanced objective today. Max savings and Max quality appear in the dashboard marked “Soon”.
Editing routing
Routing is set per coding key, in the dashboard under ValarCode → Routing:- Pick the coding key.
- Choose the target model for each class (Opus, Sonnet, Haiku, Fable). To run more than one selection at once, split traffic across cohorts and set models per cohort.
- Enter a reason and save. If you use multiple cohorts, their shares have to total 100%.
Changes are versioned and take effect for new requests once you save. Because assignment is sticky to the current split, changing a cohort’s share can move some engineers to a different cohort. That is expected when you rebalance an experiment.
Cohorts
A cohort is one arm of a split. Each cohort has:- a share, the percentage of engineers it covers, and
- a target model for each alias: Opus, Sonnet, Haiku, and Fable.
Next steps
Models
Which models you can route to, and how each harness’s traffic is served.
Analytics & savings
Compare cohorts and see what each split saved.