Migrate from RunPod to Modal
handlers to functions.
RunPod Serverless runs your Docker image with a Python handler; Modal runs Python functions with images defined in code. You can bring the same image and wrap the handler.
Facts checked against each provider's own pages
The short answer
What maps to what
| On RunPod | On Modal | Notes |
|---|---|---|
| Serverless worker image | modal.Image.from_registry / from_dockerfile | Works with Docker Hub, nvcr.io, ECR, ghcr.io and other registries[1]. |
| handler(job) + runpod.serverless.start | @app.function + @modal.fastapi_endpoint | RunPod reads job['input'][6]; on Modal, fastapi_endpoint exposes the function over HTTP[2]. |
| Endpoint environment variables | modal.Secret.from_name | Injected as environment variables via secrets=[...][3]. |
| Network volume | modal.Volume.from_name | Mount with volumes={...}; call vol.commit() to persist writes[4]. |
| Flex workers, idle timeout 5 s | Scale to zero, scaledown_window 60 s | [7][8] |
| Active workers (always on) | min_containers | Keeps warm containers so the function never scales to zero[8]. |
| GPU tier per endpoint | gpu= on @app.function | Modal lists B300, B200, H200, H100, A100, L40S, A10, L4 and T4 per second[9]. |
The migration, step by step
- 01
Reuse the image
Point modal.Image.from_registry at the image your RunPod endpoint already uses, or build from its Dockerfile with modal.Image.from_dockerfile[1].
- 02
- 03
- 04
- 05
Deploy
Run modal deploy to publish the app and get the endpoint URL[5]. Test it with the same payloads your RunPod endpoint receives.
Things the docs warn about
- Modal bills during application load time as well as input processing[9]; with large weights, cold starts are a cost line, not just latency.
- Modal's GPU list prices are preemptible base prices. Non-preemptible runs cost 3×, and pinning a region multiplies prices by 1.15–1.75×[9].
- Modal charges $0.04/GiB of egress beyond the plan allowance[9]; RunPod Pods have no egress fees[10] (its Serverless docs list no egress line item).
- Request/response shapes differ: RunPod wraps payloads in a job with an input field; adapt clients, or accept the same shape in your Modal endpoint.
Run both during cutover, then switch
AW3 Host connects both your RunPod and Modal accounts, so the old and new deployments run side by side from one dashboard and API instead of a big-bang switch.
Weighted routing sends a small share of traffic to Modal first (for example 5%, then 25%, 50% and 100%) while RunPod serves the rest. Health checks every 60 seconds watch both; if the Modal side fails, failover moves traffic back automatically, and rollback to the previous release is one step. Daily cost sync shows what each provider costs during the overlap, and budget policies alert you if the double-running period gets expensive. Secrets for both are stored encrypted per environment. Because both scale to zero, running them side by side during the overlap mostly costs the warm capacity you choose to keep.
When Modal has carried all traffic cleanly for long enough that you no longer need the fallback, point DNS at it for good and decommission RunPod.
RunPod vs Modal at a glance
| RunPod | Modal | |
|---|---|---|
| Category | GPU cloud | Serverless GPU |
| Pricing model | Pay as you go: Pods, Serverless workers and Clusters billed by usage; storage per GB-month[11] | Plan fee plus per-second usage for GPU, CPU cores and memory[9] |
| Compute billing granularity | Per second for Pods and Serverless (Serverless rounded up to the nearest second)[7] | Per second (e.g. H100 $0.001097/s; CPU $0.0000131/core/s, minimum 0.125 cores)[9] |
| Internet egress (first paid tier) | No fees for data ingress or egress on Pods[10] | $0.04/GiB beyond the plan allowance[9] |
| Regions / locations | 31 global regions (also described as 30+)[11] | 9 broad and 11 narrow region codes for region selection (counted from list); pinning costs 1.15–1.75×[14] |
| Deploy model | Docker images: Pods from templates; Serverless workers run your image with a Python handler[12] | Python decorators define functions, images and endpoints; deploy with modal deploy[5] |
| Persistent volumes | Yes: volume disks ($0.10/GB/mo running) and network volumes ($0.07/GB/mo under 1 TB)[13] | Yes: Modal Volumes, $0.09/GiB/mo (1 TiB/mo free)[9] |
| Config file | — | None: configuration lives in Python decorators[14] |
Frequently asked questions
- Can I use my RunPod Docker image on Modal?
- Yes. modal.Image.from_registry pulls from public or private registries such as Docker Hub, nvcr.io, ECR and ghcr.io, and modal.Image.from_dockerfile builds from a Dockerfile.
- What replaces RunPod active workers on Modal?
- min_containers, which keeps a floor of warm containers so the function never scales to zero. RunPod active workers, by comparison, run 24/7.
- How is idle time billed on RunPod and Modal?
- RunPod flex workers wait up to the idle timeout (5 seconds by default) before scaling down. Modal keeps containers alive 60 seconds after the last input by default and bills that time; both are configurable.
Sources
- Modal Docs: Existing images. https://modal.com/docs/guide/existing-images (checked 2026-11-16)
- Modal Docs: Web endpoints. https://modal.com/docs/guide/webhooks (checked 2026-11-16)
- Modal Docs: Secrets. https://modal.com/docs/guide/secrets (checked 2026-11-16)
- Modal Docs: Volumes. https://modal.com/docs/guide/volumes (checked 2026-11-16)
- Modal Docs: Managing deployments. https://modal.com/docs/guide/managing-deployments (checked 2026-11-16)
- RunPod Docs: Handler functions. https://docs.runpod.io/serverless/workers/handler-functions (checked 2026-11-16)
- RunPod Docs: Serverless pricing. https://docs.runpod.io/serverless/pricing (checked 2026-11-16)
- Modal Docs: Scaling out. https://modal.com/docs/guide/scale (checked 2026-11-16)
- Modal: Pricing. https://modal.com/pricing (checked 2026-11-16)
- RunPod Docs: Pod pricing. https://docs.runpod.io/pods/pricing (checked 2026-11-16)
- RunPod: Pricing. https://www.runpod.io/pricing (checked 2026-11-16)
- RunPod Docs: Serverless overview. https://docs.runpod.io/serverless/overview (checked 2026-11-16)
- RunPod Docs: Network volumes. https://docs.runpod.io/storage/network-volumes (checked 2026-11-16)
- Modal Docs: Region selection. https://modal.com/docs/guide/region-selection (checked 2026-11-16)
Your next deploy
goes everywhere.
Connect a provider, point a service at it, and ship. Add the second provider when you're ready.
No card needed · Free tier · Pay as you go after that