How Salesforce is advancing global-scale model serving with cross-Region inference routing in Amazon SageMaker AI

Salesforce's Agentforce Foundation team, which serves models behind Agentforce and the Salesforce Trust Layer, has adopted cross-Region inference routing in Amazon SageMaker AI as the failover layer inside its Internal Gateway. The team serves in-house and open source models across more than 30 global Regions and hundreds of AWS accounts, and previously ran its own path for pushing overflow traffic to other Regions, backed by basic health checks, retries and Region-switching logic. The account is described in an AWS Machine Learning Blog post credited in part to Amit Gupta, Senior Director of AI/ML, and Mark Wang, Software Engineering PMTS, at Salesforce.
The capacity problem is structural. Salesforce provisions capacity per customer according to that customer's traffic, served from the Region the request arrives in. Customer peak windows overlap, so provisioning for the combined peak would be safe but too expensive, while adding capacity Region by Region leaves fragmentation: idle instances in some Regions and exhausted ones in others. The earlier gateway had no capacity signals from local or remote endpoints, so it could not judge when to shift traffic or whether a destination had room. Cross-Region calls also left the VPC through a NAT gateway and internet gateway over public AWS networking. Design reviews flagged cascading failures, the risk that moving traffic during an incident overloads the next Region, so a cap on cross-Region traffic was needed.
How the router works
The inference router is a Regional SageMaker AI resource created in the caller's account. Applications invoke the router instead of an endpoint, passing a routing target name alongside the same body and content type they already send to InvokeEndpoint. A routing target names one logical model, such as a toxicity classifier, and lists the endpoints and inference components that may serve it by full Amazon Resource Names. A router holds one routing target per model, so trouble with one model's endpoints does not move traffic for the others, and a target can mix single-model endpoints with inference components. Because destinations are identified by ARN, they can sit in another Region or another AWS account; the owning account grants access through a resource-based endpoint policy that permits one named router to invoke it.
The router prefers its own Region and keeps requests there while the local destination succeeds. It scores each destination from recent request outcomes: platform faults, 5xx errors from the model container, throttles and timeouts all lower health. As those persist, a growing share of new requests goes to healthy destinations, typically beginning within about a minute, though a lightly used destination can take several minutes. Scaling progress and failed instance launches influence how quickly the router reacts but do not move traffic on their own. After recovery, traffic returns over several minutes, slower than it left, to avoid oscillation. If a destination fails a request without running the model, for example by throttling, the router retries once elsewhere. Client errors such as invalid input do not trigger movement, since they would fail identically anywhere, and neither does model latency, because a slow response often reflects a long prompt or output rather than an unhealthy endpoint. The router does not deploy models, copy artifacts or add instances; it consumes deployed capacity, and each endpoint's autoscaling adds instances as its traffic grows.
Integration into the Internal Gateway
In Salesforce's gateway, the router call now sits exactly where the direct InvokeEndpoint call was: in the per-request egress path, after the data residency check and before response handling. That check is the one routing decision the gateway retains. A request tagged as residency-bound is pinned to an in-Region routing target whose only destination is the local endpoint, so it cannot cross a boundary. Everything else goes to the router with unchanged body, content type and accept type. Capacity awareness, health assessment and failover have moved out of Salesforce's code and into the routing layer.
Salesforce treats the two routing fields returned on every response as first-class telemetry. The gateway logs InvokedRoutedResourceArn and RoutingReason on the same structured line as request and trace IDs and emits them as APM tags. Because the ARN encodes Region and account, one log line shows whether a request ran locally or crossed a boundary and why. The gateway timeout accounts for cross-Region round-trip latency, and the gateway adds no retries of its own because the router already retries once, which keeps attempts from multiplying during an incident.
Setting it up
In the documented example, the endpoint owner attaches a resource-based policy to an endpoint in us-east-2 in account 444455556666, allowing account 111122223333 to invoke it with a condition on sagemaker:SourceInferenceRouterArn that restricts access to one named router in us-west-2, applied with put-endpoint-policy. The router need not exist first, and the owner can revoke with delete-endpoint-policy. The router account then calls create_inference_router in us-west-2 with a RoutingTargets entry listing both destination ARNs; each additional model becomes another entry. DescribeInferenceRouter reports each destination's RoutingStatus: Routable means SageMaker AI could read it and it can serve traffic, Unroutable means it was read but cannot serve now, for example because the endpoint is not InService, and Unknown means it could not be read with the caller's credentials or, across accounts, the policy does not grant Describe. Invocation moves from the sagemaker-runtime client's invoke_endpoint to the sagemaker-inference-router-runtime client's invoke_inference_router, passing router and routing target names. InferenceId and CustomAttributes pass through, while members such as TargetVariant and InferenceComponentName are unused because the routing target replaces them.
Observability
Each response carries the serving destination's ARN and a reason, in the InvokedRoutedResourceArn and RoutingReason fields and in matching X-Amzn-SageMaker headers. The reason is one of local-preferred, failover, capacity-available or only-healthy. The router also publishes OpenTelemetry metrics to CloudWatch in its own account and Region, tagged with router name and destination ARN: invocations with an error.type split into invocation_4xx, invocation_5xx (including timeouts) and invocation_model_error; destination.duration and overhead.duration, the latter covering router-added time including network to a remote Region; and destination.status reporting healthy, overloaded or degraded. These are queried with PromQL in CloudWatch Query Studio and can sit beside existing endpoint metrics on a cross-account dashboard.
What the test showed
Salesforce validated same-Region routing in us-west-2 and then cross-account, cross-Region routing with an endpoint in us-east-2 owned by a separate account, confirming both destinations reported Routable and that live traffic was served locally with local-preferred.
For failover, the team saturated the local us-west-2 endpoint while a probe invoked the router and recorded where each request landed. Across roughly five minutes of saturation, p50 probe latency climbed from 0.2 seconds to 45-58 seconds and all traffic stayed in us-west-2, which is intended: latency alone does not move traffic. Once requests exceeded the container's 60-second handler timeout and began returning errors, the router started shifting. The first requests reached us-east-2 about two minutes after the first errors, and within another minute about 78 percent of probe traffic was served there. The remaining 20 to 25 percent stayed local so the router could detect recovery. With traffic moved, p50 latency returned to 0.2 seconds, and the cross-Region path added under 100 milliseconds at p50. After the local endpoint recovered, traffic returned over about 10 minutes, and the probe recorded no errors during failover or failback. The response fields and per-destination CloudWatch metrics documented the whole sequence without extra instrumentation.
This suggests the interesting design choice is what the router ignores. By keying on errors rather than latency, it avoids chasing slow-but-correct responses, but the trade-off is roughly five minutes of severely degraded latency before any failover begins, as the probe data shows. Holding back a fifth to a quarter of traffic locally is a sensible way to keep a recovery signal, though it means the remote Region carries most of the load during an incident. Salesforces's planned next steps are to rerun the test with the local endpoint saturated longer, measure cross-Region latency to millisecond precision, assess cascading-Region behaviour at the cross-Region cap, and roll the router out to more Regions.
Why it matters: Teams running inference endpoints in many Regions or accounts get a managed, capacity-aware routing path instead of hand-rolling health checks and failover in every application, and the resource-policy condition plus residency pinning give a concrete answer to data-residency requirements. The main migration cost is small, a client and operation swap in the egress path, but the operational details matter: retries should not be duplicated above the router, timeouts must accommodate cross-Region round trips, and dashboards should track the routing reason fields to see when traffic crossed a boundary and why. Inference: organisations with per-customer peak traffic and residency constraints are the clearest beneficiaries, while those with uniform load may find their existing autoscaling sufficient.
Based on reporting from the original publisher. Visit the source for full context and later updates.
Publisher excerpt
Learn how Salesforce uses the cross-Region inference router in Amazon SageMaker AI to turn fragmented Regional capacity into reliable model serving. Salesforce adds capacity securely across Regions and accounts while keeping its data residency commitments, and sees per request where each call was served and why.