Skip to main content
Regional environments route inference traffic for a deployment exclusively to workload planes within a designated geographic region. Use regional environments to meet data residency and compliance requirements, such as GDPR, without managing separate models per region.
Regional environments require initial configuration by Baseten. Contact support to set up regional restrictions for your environments.

How regional environments work

Regional environments build on environments and restricted environments to add region-level routing guarantees. When Baseten configures regional restrictions for an environment, two things happen:
  1. Replicas are constrained to workload planes within the designated region — deployments promoted to that environment only run in the allowed region.
  2. A regional inference endpoint becomes available that routes traffic directly to the region-specific workload plane, guaranteeing data stays in the designated region.

Comparing regional and standard endpoints

Standard environment endpoints don’t guarantee regional routing. Traffic may pass through a workload plane outside the intended region depending on DNS resolution. Regional endpoints use a different URL format that maps directly to a region-specific workload plane:
Endpoint typeURL formatRegional guarantee
Standardhttps://model-{model_id}.api.baseten.co/environments/{env_name}/predictNo
Regionalhttps://model-{model_id}-{env_name}.api.baseten.co/predictYes
The standard endpoint continues to function after you enable regional environments. However, it doesn’t guarantee that traffic stays within the restricted region.
If you use regional environments, migrate your calling code to the regional endpoint to maintain compliance. The standard endpoint routes traffic through the original CNAME, which may point to a workload plane outside the restricted region.

Calling a regional endpoint

Regional endpoints accept the same request format as standard predict endpoints:
Create an httpx.Client with the regional endpoint as the base_url. Reuse the client across requests for connection pooling. See Configure HTTP clients for recommended timeout and pool settings.
import httpx
import os

model_id = "<your-model-id>"
env_name = "prod-us"

client = httpx.Client(
    base_url=f"https://model-{model_id}-{env_name}.api.baseten.co",
    headers={"Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}"},
)

response = client.post("/predict", json={"prompt": "Hello, world!"})
print(response.json())

Setting up regional environments

  1. Create environments with region-specific names (for example, prod-us, prod-eu, staging-eu). Use restricted environments to control access.
  2. Contact Baseten support to configure regional restrictions for your environments. We’ll work with you to set them up per your required specs.
  3. Update your calling code to use the regional endpoint format: https://model-{model_id}-{env_name}.api.baseten.co/predict.

Environment naming requirements

Environment names used with regional environments must be valid DNS subdomain labels:
  • Lowercase alphanumeric characters and hyphens only.
  • Can’t start or end with a hyphen.
  • Maximum 40 characters.
  • development is a reserved name and can’t be used.
Regional environments apply across all models in a team. If you name an environment prod-us on one model, creating prod-us on another model in the same team applies the same regional restrictions.

Deploying to regional environments

Deploy and promote to regional environments the same way as standard environments:
truss push --environment prod-us
Replicas spin up only in workload planes within the allowed region.

Promotion behavior

When you promote a deployment to a regional environment, Baseten ensures regional restrictions are enforced. If the deployment was previously running without regional restrictions, a forced redeploy occurs to ensure compliance. This happens even when “turn off redeploy on promotion” is on for the model.

Supported regions

Baseten can configure regional restrictions for a variety of geographic regions, including US, EU, UK, and Australia. Contact support to discuss your specific regional requirements.