Routing is the part of Sigil our customers touch most. Version 2 rewrites the router from the ground up so a single rule can balance cost, latency and quality at the same time, instead of picking one.
What’s new
Weighted policies: score each model on
cost,p95_latencyandtool_successand let Sigil pick the best fit per request.Provider fallbacks: when a provider returns a 429 or times out, the run moves to the next model in the chain within the same trace.
Shadow routes: send a copy of live traffic to a candidate model and compare results before switching over.
Migrating from v1
Existing rules keep working. To opt in, set router: "v2" on the agent and move your model list into a policy block:
ts
const agent = sigil.agent("support", { router: "v2", policy: { models: ["small", "large"], weights: { cost: 0.5, latency: 0.3, quality: 0.2 }, fallback: "next", }, })
Defaults
If you don’t set weights, v2 uses cost 0.4, latency 0.4 and quality 0.2, which matched or beat v1 on every workload we replayed.
We moved 70% of support traffic to a small model in an afternoon, and the fallback caught every timeout.
