How a pooled call is routed
A model with a Deployment pool routes every call that names it across the pool’s deployments. Each deployment is another enabled model of the same modality in the same workspace.- The gateway orders the deployments by weight, at random, without repeats. A deployment with weight 3 is picked first three times as often as one with weight 1.
- It skips deployments that are off, can’t serve the request, are outside the allowed regions, or are cooling down after a recent failure.
- It calls the first remaining deployment. If that call fails with a rate limit, overload, timeout, transport error, or
5xx, and no output has reached you yet, it tries the next deployment. - It stops when a deployment answers, when it has made the maximum number of attempts, or when the request deadline passes.
Recovery settings
Recovery applies to every model, with or without a pool. Without a pool, a retry goes back to the same deployment after its cooldown.
A provider’s
Retry-After is respected within the deadline. A fallback never resets the deadline.
Region restriction
Each deployment can name the region it serves from, such asus-east-1. A pool can list Allowed regions, and then routes only to deployments whose serving region is on that list. A deployment with no serving region is skipped by a pool that lists regions.
A caller can narrow further, per request, with the x-gateway-model-regions header:
-, or _.
Before you begin
- You’re an organization admin. Only organization admins can change a model’s settings.
- The models you want as deployments are on, have the same modality, and live in the same workspace as the model you’re configuring.
1
Open the model's settings
In Model Gateway studio, open Models, select the model your callers name, and open the Settings tab.
2
Set each deployment's serving region
Skip this step if you don’t restrict regions. For each model you’ll add to the pool, open its Settings, find Serving region, choose Override, and enter the Region, such as
us-east-1. Select Save changes.3
Add the deployment pool
Back on the model your callers name, find Deployment pool and switch from Direct (default) to Pool. For each row, choose a Deployment and enter a Weight from 1 to 10,000. Select Add deployment for more rows, up to 16. To restrict regions, enter Allowed regions, comma-separated, such as
us-east-1, us-west-2.4
Adjust recovery
Optional. Under Recovery, switch from Default to Override and set Attempts, Deadline, ms, Backoff, ms with its maximum, and Cooldown, ms.
5
Save the model
Select Save changes. The bar above it lists what will change before you save.
Verify
- On the model’s Overview tab, Routing and health reads, for example,
Weighted across 2 deployments, only in us-east-1.andRecovery is overridden: …when you changed recovery. - Make a call that names the model. It answers as before; nothing changes for the caller.
- Open Calls and select the call. The drawer’s subtitle shows the number of attempts, and Served by shows the provider that answered.
400 with No authorized deployment meets the route constraints.
Related
- How Model Gateway works: where routing sits in a request.
- Connect model providers: add the providers your deployments come from.
- Model API compatibility: every request and response header.