Which is better, Modal or Vercel Sandbox?
It depends on where your app lives and what hardware it needs. For agents that mostly wait on a model, Runtime costs $0.64 for the job below, against $2.12 on Vercel and $3.97 on Modal. Like Vercel, it bills only the CPU used, at a lower rate. Its pause keeps memory and processes. Pick Modal for GPUs, or for sandboxes beside Modal functions and cron jobs. Pick Vercel Sandbox if your product is deployed on Vercel, or if you need sandboxes in 19 regions.
At a glance
Vercel's figures are at the rates of its default iad1 region.
| Modal Sandboxes | Vercel Sandbox | Runtime | |
|---|---|---|---|
| Isolation | gVisor, a user-space kernel that intercepts system calls | Firecracker microVM, own kernel | Firecracker microVM, own kernel |
| CPU | $0.1419 per physical core-hour (2 vCPUs), request or use | $0.128 per active CPU-hour | $0.025 per vCPU-hour of measured CPU, with a small floor |
| Memory | $0.0240 per GiB-hour, request or use | $0.0212 per provisioned GB-hour | $0.0075 per reserved GiB-hour |
| Plan fee | Starter $0 with $30 a month of compute; Team $250 a month | Hobby allowance free; usage beyond it needs Pro | None; prepaid credit from $10 |
| Free start | $30 of compute a month on Starter | 5 active CPU-hours and 420 GB-hours a month on Hobby | 100 free hours of a 1 GB machine in the first 30 days, no card |
| Session length | Up to 24 hours; snapshots carry state beyond that | 45 minutes on Hobby, 24 hours on Pro | No time limit: runs while it works, pauses itself after 300 seconds idle |
| Keeping state | Snapshots | Stop keeps the filesystem; processes start again | Pause keeps files, memory and processes while you have credit |
| Setup | A Modal App is needed outside Modal | A Vercel project and token | One call; no app or project |
Why does Vercel beat Modal for a waiting agent but not a busy one?
Modal charges the larger of what a sandbox asked for and what it used. A 2 vCPU sandbox is one physical core there, so it pays $0.1419 an hour for that core, even while it idles on a model call. Vercel charges only for active CPU: $0.128 an hour per CPU. That is dearer than Modal's $0.071 per vCPU, but idle seconds are free.
So the answer depends on how busy the code keeps the CPUs. At this size, Vercel stays cheaper until the sandbox averages about 1.2 busy CPUs out of 2, which is some 72 CPU-seconds in every minute. Above that, Modal's flat charge wins.
| 2 vCPU, 4 GiB, 1,000 one-minute runs | Modal | Vercel | Runtime |
|---|---|---|---|
| 20 CPU-seconds of work per run | $3.97 | $2.12 | $0.64 |
| Both CPUs busy throughout | $3.97 | $5.68 | $1.33 |
Runtime measures CPU the way Vercel does, at $0.025 a vCPU-hour. It is the lowest in both rows.
Cost for the same job
Here is the first row worked out: 1,000 runs, 2 vCPU (a single physical core on Modal), 4 GiB of memory (written 4 GB on Vercel), 60 seconds a run, and 20 CPU-seconds of actual computing in each.
- CPU
- 1,000 × 60 s × 1 core × $0.00003942
- $2.37
- Memory
- 1,000 × 60 s × 4 × $0.00000667
- $1.60
- CPU
- 1,000 × 20 s / 3,600 × $0.128
- $0.71
- Memory
- 1,000 × 60 s / 3,600 × 4 × $0.0212
- $1.41
- CPU
- 1,000 × 20 s / 3,600 × $0.025
- $0.14
- Memory
- 1,000 × 60 s / 3,600 × 4 × $0.0075
- $0.50
Over a month of 100,000 runs, Modal costs $396.60, Vercel costs $212.44, and Runtime costs $63.89. If both CPUs are busy for the whole minute instead, the job costs $1.33 on Runtime, $3.97 on Modal, and $5.68 on Vercel. Plan fees, creation charges, disk, network and free allowances are not in these totals.
gVisor or Firecracker?
Modal runs sandboxes under gVisor, a user-space kernel that intercepts the program's system calls. Vercel and Runtime run each sandbox as a Firecracker microVM with its own Linux kernel. Firecracker vs gVisor explains where each draws the boundary.
Which one to pick
- Modal, when the sandboxes need GPUs, or when the team already runs Modal functions, web endpoints and cron jobs and wants sandboxes in the same place. Outside Modal, a sandbox needs a Modal App first.
- Vercel Sandbox, when the product is already deployed on Vercel, or when sandboxes must sit in many places: 19 regions, and up to 10,000 at the same time on Pro.
- Runtime, when the job is an agent that mostly waits: a microVM per sandbox, CPU billed by use at 80% below Vercel's rate, pause and forks that carry memory and live processes, and no app, project or token to create first.
Moving to Runtime
Vercel Sandbox code keeps working with a changed import. It also stops needing a Vercel project or token:
TypeScriptimport { Sandbox } from "withruntime/vercel"; // was: from "@vercel/sandbox"Pythonfrom withruntime.vercel import sandbox # was: from vercel import sandboxModal code is ported call by call. modal.Sandbox.create(app=...) becomes
Sandbox.create(), sb.exec(*args) becomes exec, Sandbox.from_name becomes
Sandbox.getOrCreate(name), and idle_timeout becomes idlePauseSeconds:
Pythonfrom withruntime import Sandboxwith Sandbox.create() as box: box.files.write("/workspace/invoice.py", "print(sum([125, 250, 375]))\n") print(box.exec("python3 /workspace/invoice.py", check=True).stdout)A coding agent can do either port from the single instruction in migration, working on a branch and checking the result on the free usage. Credit you add within 30 days of signing up is matched, up to $1,000 in total. The long form is in Runtime vs Modal and Runtime vs Vercel Sandbox.
Runtime Cloud
Against these two, Runtime cuts the bill by 84% and 70%. One job, 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox, costs $3.97 on Modal, $2.12 on Vercel, and $0.64 on Runtime. Modal charges for the CPU a sandbox reserves. Vercel and Runtime charge for what it uses. Runtime's rate for that is 80% below Vercel's. Runtime also gives each sandbox a Firecracker microVM kernel of its own. Rates were checked 25 October 2026.
To try it, run npx withruntime login and use the free monthly usage. The
migration guide moves existing Modal or Vercel Sandbox code.
Sources
Modal and Vercel pricing pages were rechecked 25 October 2026. The rest were checked 25 October 2026.
- Modal pricing, Modal resources and billing, Modal Sandboxes, Modal security
- Vercel Sandbox pricing, Understanding Vercel Sandboxes
- Runtime pricing
Facts on this page were checked on 26 October 2026.