Modal vs Together Code Sandbox
Modal gives you short-lived sandboxes you can start today, next to GPUs and in regions around the world, and each one ends within 24 hours. Together Code Sandbox starts VMs from Docker-image snapshots and can save their memory when they end, but Together has to turn it on for your organization.
The companies and products
Modal
Modal is a serverless cloud for AI work: inference, training, batch jobs and sandboxed code, all driven from Python, TypeScript or Go code.
Modal Sandboxes are containers you create from code, run commands in, and then terminate. By default they run under gVisor, a user-space kernel from Google; since October 2026 you can also pick a VM runtime with its own Linux kernel for Docker and FUSE (Battleships tracks that as a separate card, Modal VM Sandboxes). It suits teams that already run models on Modal and want short-lived, scalable code execution next to their GPUs.
Together Code Sandbox
Together AI is a cloud for running and training AI models, and Code Sandbox is its product for running code in isolated VMs.
You build a snapshot from a Docker image or Dockerfile on Together's builder, then start sandboxes from it and run commands and file operations through the together-sandbox SDK or CLI. When a sandbox ends you can save its disk, and its memory too, as a new snapshot to start more sandboxes from. It is aimed at model-generated code, agent tool calls and reinforcement learning rollouts, and it must be enabled for your organization by Together. Together also sells Code Interpreter, a separate API that runs Python code in short sessions.
Which use cases each one fits
For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “19th cheapest of 345” means 18 of the other 344 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.
| Use case and its workload | Modal: price rank | Together Code Sandbox: price rank | boat: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month A software factory needs Docker, root and a disk that stays; boat has all three on every machine, Modal's default sandbox resets its root disk, and Together does not document Docker inside. | Can't run it | 65th of 367, with limits $528 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB An always-on agent hits Modal's 24-hour limit and Together's 60-minute Code Interpreter sessions, while a boat sandbox has no session cap on paid plans. | 196th of 366, with limits $1,924 a month | 152nd of 366, with limits $1,095 a month | 5th cheapest of 366 $657 a month |
| Code interpreter bursts 100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month For many short code runs, Modal's fast starts and high concurrency fit best; Together's self-serve option is a Python-only interpreter billed per 60-minute session. | 19th cheapest of 345 $181 a month | 326th of 345, with limits $2,190 a month | 186th of 345, with limits $2,000 a month |
| Sandboxes for your users 300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month Giving each user a sandbox they come back to fits boat, because a stopped sandbox keeps its disk and costs nothing; Modal fits if sessions are short, and Together makes every port public. | 11th cheapest of 361 $811 a month | 234th of 361, with limits $900 a month | Cheapest of 361 $209 a month |
| RL rollouts 1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month Modal is built for huge bursts of short sandboxes, and Together can branch many copies from one memory snapshot once it enables the VM product for you. | 5th cheapest of 360 $19,038 a month | 315th of 360, with limits $21,900 a month | 34th of 360, with limits $2,000 a month |
| Agent evals 250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month Modal runs eval sandboxes at scale from code, Together documents a Harbor guide for agent evals, and boat ships the coding agents with an API to prompt and follow each run. | 59th cheapest of 364 $1,244 a month | 258th of 364, with limits $450 a month | 10th cheapest of 364 $200 a month |
| CI runners 40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month | 126th cheapest of 377 $1,793 a month | 251st of 377, with limits $180 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB | 138th of 368, with limits $23 a month | 210th of 368, with limits $22 a month | 18th cheapest of 368 $26 a month |
| Computer-use agents 50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month Neither Modal nor Together offers a desktop, so you set up VNC or a browser yourself; boat streams a 60fps desktop with Chromium in every sandbox. | 98th of 369, with limits $183 a month | 184th of 369, with limits $600 a month | 6th cheapest of 369 $200 a month |
| Browser-use agents 50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month | 177th of 367, with limits $136 a month | 301st of 367, with limits $900 a month | 7th cheapest of 367 $200 a month |
| Scraping & bots (startup scale) 50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month | 267th of 346, with limits $394 a month | 219th of 346, with limits $180 a month | 6th cheapest of 346 $90 a month |
| Mass scraping & bots (undetectable) 1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month | 223rd of 338, with limits $8,795 a month | 124th of 338, with limits $3,600 a month | 71st of 338, with limits $1,800 a month |
| Parallel red teaming 200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month | Can't run it | 167th of 360, with limits $150 a month | 2nd cheapest of 360 $200 a month |
| GPU eval jobs 10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month Modal rents GPUs from T4 to B300 next to its sandboxes, while Together Code Sandbox and boat have none in the sandbox. | 19th cheapest of 98 $1,187 a month | Can't run it | Can't run it |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Can't run it | Can't run it | Can't run it |
Key features
| Feature | Modal | Together Code Sandbox | boat |
|---|---|---|---|
| Isolation | gVisor by default; VM runtime with its own kernel available | A VM per sandbox on Together's infrastructure | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| Getting started | Self-serve; Starter is free with $30 of monthly credit | The VM product must be enabled for your organization; only Code Interpreter is self-serve | Sign up and start a sandbox from the API, CLI or dashboard |
| Docker inside | Only with the VM runtime | Not documented; Dev Containers and Docker Compose are not read | Docker, systemd and root on every machine |
| Nested virtualization | VM runtime only, Team and Enterprise plans, on request | Not documented | Yes, /dev/kvm for Android emulators and VMs |
| Longest session | 24 hours (default 5 minutes) | VMs run until you end them or their time to live ends; Code Interpreter sessions last 60 minutes | No cap on paid plans (default TTL 1 h, changeable) |
| Saving state | No paused state; only Volumes keep files; memory snapshots in alpha end the sandbox | End a sandbox with a snapshot of its disk, or disk and memory | Disk saved every minute and on stop; a stopped sandbox costs nothing; resume boots the machine again |
| Fork | Snapshot the filesystem into an image and boot new sandboxes from it | No live fork: the parent stops, then you start many sandboxes from its snapshot | Fork a running sandbox; the original keeps running |
| Machine size | Set CPU and memory per sandbox; maximum not published | 0.1 to 16 cores, 1 to 8 GB of memory per core; disk size fixed | 2 to 16 vCPU with 2 GB per vCPU, up to 16 vCPU / 32 GB on the $100 plan and above |
| GPUs | T4 to B300; 10 at once on Starter, 50 on Team | None in the sandbox | None |
| Regions | US, EU and Asia-Pacific; pinning costs 1.15x to 1.75x | Not published | EU only: Germany, Finland, France |
| Reaching the sandbox | Encrypted and raw TCP tunnels, connect tokens, inbound IP allowlist | All ports public; preview URLs coming soon; experimental inbound allowlist | HTTPS URLs for up to 50 ports, token-protected by default, plus raw TCP |
| Outbound network rules | Block all, IP-range allowlist, domain allowlist (beta) | No egress allowlist documented | No provider-side allowlist |
| Desktop and computer use | Not offered; an example shows how to set up VNC yourself | None; headless command and file access only | 60fps desktop, Chromium and computer-use API built in |
| Coding agents and API keys | Examples only; secrets are environment variables or your own sidecar proxy | Run your own agent through execs; no credentials proxy documented | Claude Code, Codex and others preinstalled with an API to drive them; a credentials proxy keeps real keys out |
Every feature Battleships tracks (43)
| Feature | Modal | Together Code Sandbox | boat |
|---|---|---|---|
| Full VM (own kernel) | No | Yes | Yes |
| Docker inside | No | Not published | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Yes | Not published | Yes |
| Desktop GUI | No | No | Yes |
| Browser | No | No | Yes |
| Computer-use API | No | No | Yes |
| SSH | Yes | No | Yes |
| Persistent disk | Yes | Yes | Yes |
| Pause/resume | No | Yes | Yes |
| Automatic snapshots | No | No | Yes |
| Fork/clone | Yes | Yes | Yes |
| Live fork (no pause) | No | No | Yes |
| Memory fork | Yes | Yes | No |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | No | No |
| Wake on request | No | No | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | Yes | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | Yes | No | No |
| Secret proxy | No | No | Yes |
| Secret proxy for any API | No | No | Yes |
| Preinstalled agents | No | No | Yes |
| Agent harness API | No | No | Yes |
| MCP server | No | Yes | No |
| GPU | Yes | No | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | No | No | No |
| BYOC | No | No | No |
| Open source | No | No | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Not published | Yes | Yes |
| Usage per sandbox (API) | Not published | Yes | Yes |
| Audit logs | Yes | Not published | No |
| SSO | Yes | Yes | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | Yes | No | No |
| EU data residency | Yes | Not published | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
In the same StarSling hpc-sandbox-benchmarks run at 4 vCPU / 8 GB, boat finished 26.69 Node.js build-and-test runs per second and Modal's default gVisor sandbox finished 12.79, so boat did about twice the work. Together Code Sandbox was not part of that run, so there is no comparable score for it.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Modal measured on: Sandbox (gVisor), request = size, any region. Together Code Sandbox has no published run in this suite yet, so there is no like-for-like number to compare.
Pricing in five scenarios
Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario.
| Scenario | Modal, a month | Together Code Sandbox, a month | boat, a month |
|---|---|---|---|
| One coding agent, workdays 4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days | $15 · Starter · with limits | $5 · Together pay-as-you-go (prepaid credits; Code Interpreter only) · with limits | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $178 · Starter · with limits | $22 · Together pay-as-you-go (prepaid credits; Code Interpreter only) · with limits | $26 · $20/mo |
| 50 agents in parallel 50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside | $2,229 · Starter · with limits | $264 · Together pay-as-you-go (prepaid credits; Code Interpreter only) · with limits | $317 · $20/mo × 3 seats |
| Sandboxes for your users 2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once | $792 · Team | $900 · Together pay-as-you-go (prepaid credits; Code Interpreter only) · with limits | $200 · $100/mo × 2 seats |
| 1,000 short jobs at once 2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month | $3,193 · Team · with limits | $6,000 · Together pay-as-you-go (prepaid credits; Code Interpreter only) · with limits | $2,000 · $2000/mo · with limits |
Modal: Modal bills by the second for the higher of what you request and what you use, and an idle sandbox pays until it ends. Starter is free with $30 of monthly credit, Team is $250 a month with $100 of credit, and pinning a region costs 1.15x to 1.75x.
Together Code Sandbox: Together lists Code Sandbox at $0.0446 per vCPU-hour and $0.0149 per GiB-hour, but the VMs must be enabled for your organization. The table prices Code Interpreter instead, its only self-serve product: $0.03 per 60-minute session from prepaid credits.
Together Code Sandbox: boat charges one hourly rate per machine size, by the second, only while a sandbox runs. Plans start at $20 a month and the whole fee becomes usage credit.
Limits in those scenarios
On Modal a sandbox lives at most 24 hours and only files in a Volume survive, and Docker needs the VM runtime, so the 50-agent fleet does not fit the default sandbox. The Together column is Code Interpreter, so its 60-minute Python sessions with no disk and no published machine size decide every row. On boat the limit that bites is starts: 1,000 short jobs at once need more starts per hour and per day than even the $2,000 plan allows, so they queue.
| Scenario | Modal | Together Code Sandbox | boat |
|---|---|---|---|
| One coding agent, workdays |
|
| None that bite |
| One agent that never stops |
|
| None that bite |
| 50 agents in parallel |
|
| None that bite |
| Sandboxes for your users | None that bite |
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use Modal when
you want to start today, need GPUs or regions outside Europe, or run huge bursts of short sandboxes that finish in minutes.
- Start today, with GPUs nearby. Modal is self-serve and rents GPUs from T4 to B300 on the same platform, useful if your agent runs models.
- Regions and outbound rules. Modal runs in the US, EU and Asia-Pacific and can block outbound traffic or allow only chosen domains.
- Huge bursts of short jobs. For thousands of sandboxes that finish in minutes, Modal runs up to 5,000 containers on Team.
Use Together Code Sandbox when
you already run models on Together and want light VMs you can save with their memory and branch from, or a simple Python runner billed per session.
- Memory snapshots to branch from. A Together sandbox can end with its memory saved, and every copy started from it comes back with processes running.
- Very small machines. Sandboxes start at a tenth of a core, which suits large numbers of light tasks once Together enables them.
- Sandboxes next to your models. If you already run inference or fine-tuning on Together, sandboxes and model calls share one account and API key.
Where boat fits
If your agents work for hours or days, both Modal and Together make you rebuild the machine around them: Modal ends a sandbox within 24 hours, and Together needs approval and documents no Docker inside. boat gives each agent a full VM you can start today, with Docker, a desktop and coding agents built in, that keeps its disk and is never cut off on paid plans.
A machine that keeps its work
A Modal sandbox ends within 24 hours and its root disk goes with it unless you save to a Volume. Together saves state only when a sandbox ends. boat saves the disk every minute, and a stopped sandbox costs nothing.
Docker, root and /dev/kvm everywhere
On Modal, Docker needs the VM runtime and /dev/kvm needs a Team plan request. Together documents neither Docker inside nor nested virtualization. Every boat sandbox has Docker, systemd, root and /dev/kvm for emulators.
Desktop, agents and keys built in
Neither Modal nor Together has a desktop, and both leave keys inside the sandbox where a prompt injection can read them. boat ships a 60fps desktop, preinstalled coding agents you drive from outside, and a credentials proxy for any HTTPS API.
Use boat when your agents do real work for hours: installs, builds, Docker, emulators, a browser and servers, on a fast machine that keeps its disk and that you can start today. Compare it one to one: boat vs Modal and boat vs Together Code Sandbox.
Questions people ask
Is Modal cheaper than Together Code Sandbox?
It depends on the job. Together's self-serve price is Code Interpreter, which looks cheaper for one agent ($22 against $178 a month always on) but does not fit, since sessions end after 60 minutes and keep no disk. At scale Modal is cheaper: $792 against $900 for sandboxes for your users, and $3,193 against $6,000 for 1,000 short jobs at once.
Which is faster, Modal or Together Code Sandbox?
Only Modal has a public score: 12.79 runs per second at 4 vCPU / 8 GB in the StarSling benchmark. Together was not measured. boat finished 26.69 in the same run, about twice Modal's default sandbox.
Can Modal or Together Code Sandbox run Docker?
Modal runs Docker only with its VM runtime. Together builds sandboxes from Docker images but does not document Docker inside a sandbox. Every boat sandbox runs Docker with no extra setting.
How long can a sandbox run on each?
A Modal sandbox lasts 5 minutes by default and 24 hours at most. Together VMs run until you end them or their time to live ends, while Code Interpreter sessions last 60 minutes. boat has no session cap on paid plans.
Can I use Together Code Sandbox without contacting Together?
Not the VM product: the together-sandbox SDK and CLI must be enabled for your organization. Code Interpreter, a Python-only API, is self-serve with prepaid credits. Modal and boat are both self-serve.
Which one has GPUs?
Modal, with GPUs from T4 to B300 that a sandbox can use directly. Together Code Sandbox and boat sandboxes are CPU machines.
Try boat
Install the CLI, then run boat new.
7-day free trial