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 workloadModal: price rankTogether Code Sandbox: price rankbochka: 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; bochka has all three on every machine, Modal's default sandbox resets its root disk, and Together does not document Docker inside.
Can't run it65th 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 bochka 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 bochka, 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 bochka 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; bochka 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 it167th 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 bochka have none in the sandbox.
19th cheapest of 98
$1,187 a month
Can't run itCan't run it
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Can't run itCan't run itCan't run it

Key features

FeatureModalTogether Code Sandboxbochka
IsolationgVisor by default; VM runtime with its own kernel availableA VM per sandbox on Together's infrastructureFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
Getting startedSelf-serve; Starter is free with $30 of monthly creditThe VM product must be enabled for your organization; only Code Interpreter is self-serveSign up and start a sandbox from the API, CLI or dashboard
Docker insideOnly with the VM runtimeNot documented; Dev Containers and Docker Compose are not readDocker, systemd and root on every machine
Nested virtualizationVM runtime only, Team and Enterprise plans, on requestNot documentedYes, /dev/kvm for Android emulators and VMs
Longest session24 hours (default 5 minutes)VMs run until you end them or their time to live ends; Code Interpreter sessions last 60 minutesNo cap on paid plans (default TTL 1 h, changeable)
Saving stateNo paused state; only Volumes keep files; memory snapshots in alpha end the sandboxEnd a sandbox with a snapshot of its disk, or disk and memoryDisk saved every minute and on stop; a stopped sandbox costs nothing; resume boots the machine again
ForkSnapshot the filesystem into an image and boot new sandboxes from itNo live fork: the parent stops, then you start many sandboxes from its snapshotFork a running sandbox; the original keeps running
Machine sizeSet CPU and memory per sandbox; maximum not published0.1 to 16 cores, 1 to 8 GB of memory per core; disk size fixed2 to 16 vCPU with 2 GB per vCPU, up to 16 vCPU / 32 GB on the $100 plan and above
GPUsT4 to B300; 10 at once on Starter, 50 on TeamNone in the sandboxNone
RegionsUS, EU and Asia-Pacific; pinning costs 1.15x to 1.75xNot publishedEU only: Germany, Finland, France
Reaching the sandboxEncrypted and raw TCP tunnels, connect tokens, inbound IP allowlistAll ports public; preview URLs coming soon; experimental inbound allowlistHTTPS URLs for up to 50 ports, token-protected by default, plus raw TCP
Outbound network rulesBlock all, IP-range allowlist, domain allowlist (beta)No egress allowlist documentedNo provider-side allowlist
Desktop and computer useNot offered; an example shows how to set up VNC yourselfNone; headless command and file access only60fps desktop, Chromium and computer-use API built in
Coding agents and API keysExamples only; secrets are environment variables or your own sidecar proxyRun your own agent through execs; no credentials proxy documentedClaude Code, Codex and others preinstalled with an API to drive them; a credentials proxy keeps real keys out
Every feature Battleships tracks (43)
FeatureModalTogether Code Sandboxbochka
Full VM (own kernel)NoYesYes
Docker insideNoNot publishedYes
Nested virtualizationNoNoYes
RootYesYesYes
SystemdYesNot publishedYes
Desktop GUINoNoYes
BrowserNoNoYes
Computer-use APINoNoYes
SSHYesNoYes
Persistent diskYesYesYes
Pause/resumeNoYesYes
Automatic snapshotsNoNoYes
Fork/cloneYesYesYes
Live fork (no pause)NoNoYes
Memory forkYesYesNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesNoNo
Wake on requestNoNoNo
HTTPS preview URLsYesYesYes
Raw TCP inboundYesNoYes
Public IPv4NoNoNo
Egress allowlistYesNoNo
Secret proxyNoNoYes
Secret proxy for any APINoNoYes
Preinstalled agentsNoNoYes
Agent harness APINoNoYes
MCP serverNoYesNo
GPUYesNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoNoNo
BYOCNoNoNo
Open sourceNoNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsNot publishedYesYes
Usage per sandbox (API)Not publishedYesYes
Audit logsYesNot publishedNo
SSOYesYesNo
SOC 2YesYesNo
HIPAAYesNoNo
EU data residencyYesNot publishedYes
Zero data retentionNot publishedNot publishedYes

Performance

Modal12.79 runs/s
Together Code SandboxNot measured
bochka26.69 runs/s

In the same StarSling hpc-sandbox-benchmarks run at 4 vCPU / 8 GB, bochka finished 26.69 Node.js build-and-test runs per second and Modal's default gVisor sandbox finished 12.79, so bochka 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.

ScenarioModal, a monthTogether Code Sandbox, a monthbochka, 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: bochka 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 bochka 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.

ScenarioModalTogether Code Sandboxbochka
One coding agent, workdays
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • Together pay-as-you-go (prepaid credits; Code Interpreter only): sessions capped at 1 h
  • missing persistent disk
  • machine size not published
  • different kind of product: code interpreter
None that bite
One agent that never stops
  • Starter: sessions capped at 24 h
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • Together pay-as-you-go (prepaid credits; Code Interpreter only): sessions capped at 1 h
  • missing persistent disk
  • machine size not published
  • different kind of product: code interpreter
None that bite
50 agents in parallel
  • missing Docker inside
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • Together pay-as-you-go (prepaid credits; Code Interpreter only): sessions capped at 1 h
  • missing persistent disk, Docker inside
  • machine size not published
  • different kind of product: code interpreter
None that bite
Sandboxes for your usersNone that bite
  • machine size not published
  • different kind of product: code interpreter
  • machine size per session not published
  • egress price not published
None that bite
1,000 short jobs at once
  • shared vCPUs on this tier (Modal sells dedicated cores separately as “Sandbox (gVisor), request = size, any region”): heavy, sustained CPU use can be slowed by other tenants
  • machine size not published
  • different kind of product: code interpreter
  • machine size per session not published
  • egress price not published
  • max 2,400 starts/day (needs ~6,667)
  • max 600 starts/hour (needs ~1,000)
  • bursts above 90 starts/min are queued (a burst of 333 takes ~4 min to start)

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 bochka 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. bochka 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. bochka 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 bochka 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. bochka ships a 60fps desktop, preinstalled coding agents you drive from outside, and a credentials proxy for any HTTPS API.

Use bochka 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: bochka vs Modal and bochka 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. bochka 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 bochka 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. bochka 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 bochka 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 bochka sandboxes are CPU machines.

Try bochka

Install the CLI, then run bochka new.

Product preview

More comparisons

Bochka product preview · Pricing, benchmarks and commands are illustrative. Sandbox provisioning is not connected.