Region selection

Modal allows you to specify the cloud region a Function or Sandbox runs in.

This may be useful if:

  • you are required (for regulatory reasons or by your customers) to process data within certain regions.
  • you have a latency-sensitive app where app endpoints need to run near an external DB.

Note that regardless of what region your Function or Sandbox runs in, all inputs and outputs go through Modal’s control plane in us-east-1.

Specifying a region 

To run your Modal Function in a specific region, pass a region= argument to the function decorator.

@app.function(region=["us-east"])
def f():
    ...

Sandboxes accept the same region= argument on Sandbox.create:

sb = modal.Sandbox.create(region=["us-east"], app=app)

Pricing 

A multiplier on top of our base usage pricing will be applied to any Function or Sandbox that has a cloud region defined.

Region typeMultiplier
Broad (e.g. us)1.5x
Narrow (e.g. us-east)1.75x

Here’s an example: let’s say you have a Function or Sandbox that uses 1 T4, 1 CPU core, and 1GB memory. You’ve specified that it should run in us-east. The cost to run it for 1 hour would be ((T4 hourly cost) + (CPU hourly cost for one core) + (Memory hourly cost for one GB)) * 1.75.

If you specify multiple regions and they span the two categories above, we will apply the smaller of the two multipliers.

Region options 

Modal offers different levels of granularity for regions. Use broader regions when possible, as this increases the pool of available resources your Function or Sandbox can be assigned to, which improves cold-start time and availability.

  Broad          Narrow               Notes
 ===========================================================
  "us"                                United States
                 "us-east"
                 "us-central"
                 "us-south"
                 "us-west"
------------------------------------------------------------
  "eu"                                European Economic Area
                 "eu-west"
                 "eu-north"
                 "eu-south"
------------------------------------------------------------
  "ap"                                Asia-Pacific
                 "ap-northeast"
                 "ap-southeast"
                 "ap-south"
                 "ap-melbourne"
                 "jp"                 Japan
                 "au"                 Australia
------------------------------------------------------------
  "uk"                                United Kingdom
------------------------------------------------------------
  "ca"                                Canada
------------------------------------------------------------
  "me"                                Middle East
------------------------------------------------------------
  "sa"                                South America
------------------------------------------------------------
  "af"                                Africa
------------------------------------------------------------
  "mx"                                Mexico

Specific regions 

Need access to more granular region definitions? Contact sales@modal.com.