Region selection

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

This may be useful if:

  • you are required (for regulatory reasons or by your customers) to process data within certain regions.
  • you want to reduce egress fees that result from reading data from a dependency like S3.
  • you have a latency-sensitive app where app endpoints need to run near an external DB.

Note that regardless of what region your Function runs in, all Function 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.

You can specify a region in addition to the underlying cloud. For instance, @app.function(cloud="aws", region="us-east") would run your Function only in "us-east-1" or "us-east-2".

Pricing 

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

RegionMultiplier
Any region in US/EU/UK/AP1.25x
Any region in CA/SA/ME/MX/AF2.5x

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

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 varying levels of granularity for regions. Use broader regions when possible, as this increases the pool of available resources your Function can be assigned to, which improves cold-start time and availability.

United States (“us”) 

Use region="us" to select any region in the United States.

European Economic Area (“eu”) 

Use region="eu" to select any region in the European Economic Area (EEA). Notably, this does not include the UK.

Asia–Pacific (“ap”) 

Use region="ap" to select any region in Asia–Pacific.

United Kingdom (“uk”) 

Use region="uk" to select any region in the United Kingdom.

Canada (“ca”) 

Use region="ca" to select any region in Canada.

Middle East (“me”) 

Use region="me" to select any region in the Middle East.

South America (“sa”) 

Use region="sa" to select any region in South America.

Africa (“af”) 

Use region="af" to select any region in Africa.

Mexico (“mx”) 

Use region="mx" to select any region in Mexico.

Region aliases 

The following are convenience aliases for selecting specific countries within broader geographic regions (e.g., Japan or Australia within Asia-Pacific).