V2 Sandboxes
“V2” refers to Modal’s next-generation Sandbox backend, which creates Sandboxes with higher throughput, runs more of them concurrently, and gets them interactive faster. It is not a separate API: once it becomes the default, all Sandboxes use it automatically.
Upgrade early
You can opt in ahead of the cutover by setting the MODAL_SANDBOX_V2=1 environment variable, or sandbox_v2 = true in your .modal.toml profile,
with these SDK versions or later:
- Python
1.5.4 - JavaScript
0.10.1 - Go
0.10.1
Sandbox.create(), Sandbox.from_name(), and Sandbox.list() (and their
JavaScript and Go equivalents) then use the new backend without any code
changes.
Sandboxes that use features the new backend does not support (such as GPUs) are created on the previous backend automatically.
Two things to be aware of when the flag is set:
- The new backend does not support the deprecated legacy filesystem API (
Sandbox.open,ls,mkdir,rm, andwatch). Migrate any code that is issuing deprecation warnings before opting in. - When
Sandbox.create()returns, the Sandbox has already been scheduled onto a machine, sowait_until_ready()completes faster and more consistently.
If you hit a rough edge, please reach out via Slack or email us at support@modal.com.