Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Modal 5 min read Announcement mediumAdept

Directory Snapshots: Resumable project state for Sandboxes

Modal's Directory Snapshots, now in public beta, capture a single directory from a running Sandbox and mount it into another Sandbox independently of the base image, instead of snapshotting the whole filesystem as one unit. This lets project state evolve separately from system dependencies, so base images can be patched without rebuilding project snapshots, and generic warm-pool Sandboxes can receive project code at claim time. Snapshots mount instantly and their contents are prioritized by Modal's lazy-loading filesystem. They persist for 30 days after last use and sit alongside full filesystem snapshots and memory snapshots.

Assumes: container imagessandboxed execution environments

Related posts

  • Memory snapshots: Checkpoint/restore for sub-second startup

    Modal mediumAdept

    Modal cuts serverless container cold starts roughly 2.5x by checkpointing a gVisor container's full process tree and filesystem mutations just before it accepts a request, then restoring it instead of re-running Python's syscall-heavy import path (import torch alone makes 26,000 syscalls through OverlayFS and a FUSE lazy-loading server). Restore speed depends mostly on getting the main process's memory pages into the page cache. gVisor loads pages in the background, prioritizing faulting pages, while the FUSE layer aggressively preloads the pages file. Snapshots are created on demand per worker because of CPU feature, NVIDIA driver and runtime compatibility. GPU state can't be saved, so models are loaded into CPU RAM before the snapshot and moved to the GPU after restore via snap=True/snap=False lifecycle hooks.

  • How Ramp built a full context background coding agent on Modal

    Modal easyNovice

    Ramp Inspect, an internal background coding agent, runs each session in a Modal Sandbox containing a full dev environment (Postgres, Redis, Temporal, RabbitMQ, OpenCode, VS Code server, VNC with Chromium) and now starts roughly half of merged pull requests at Ramp. Fast startup comes from a cron job that clones repos, installs dependencies and builds every 30 minutes, saving diff-based filesystem snapshots so sessions begin from a near-current state in seconds. Modal Dicts handle session locks and image metadata, and Queues route prompts from Slack, web and Chrome extension clients into shared multiplayer sessions, letting the system scale to hundreds of concurrent isolated sessions.

  • How Legora runs 2,000 parallel agent evals on Modal Sandboxes

    Modal mediumAdept

    Legora tests its long-running legal agent by booting the full application, pinned to a specific commit, inside a separate Modal Sandbox for each eval run. A typical experiment is about 2,000 runs (100 cases × 4 harness variants × 5 trials), all executed in parallel. Modal Volumes snapshot world state such as documents, database state, permissions and blobs, and also cache Docker images. An hourly pipeline pre-builds the image and pre-warms Sandboxes, and moving from gVisor to VM-backed Sandboxes let the team delete their Docker networking and FUSE workarounds. Agents now drive the eval CLI to hill-climb the harness, which helped cut agent cost by 30% through smarter compaction and custom tool search.

  • Inside Modal Notebooks: How we built a cloud GPU notebook that boots in seconds

    Modal mediumAdept

    Modal Notebooks runs Jupyter kernels inside Modal Sandboxes, using a `modal-kernelshim` daemon that translates ZeroMQ kernel protocol messages into HTTP tunneled through the control plane. Fast GPU boots come from a Rust FUSE lazy-loading container filesystem with a content-addressed tiered cache (page cache, SSD, zonal cache, regional CDN, blob storage). Supporting pieces include shared scheduling with idle-kernel pausing and VolumeFS (file trees in Spanner, eventually consistent ops) for persistent storage. Collaboration uses operational transformation via Rushlight over Redis Streams, with large outputs offloaded to S3 Express One Zone, and the editor adds LSP via Pyright, Ruff formatting compiled to WebAssembly, and AI next-edit suggestions.

  • How Abundant designed efficient rollout architecture with Modal Sandboxes

    Modal easyNovice

    Abundant runs its reinforcement learning rollout platform on Modal, with each of 75,000+ RL tasks executing in an isolated Modal Sandbox and Modal Functions powering the scheduler API. The design places a small monitor inside each Sandbox that sends heartbeats every 30 seconds, live events and final results over HTTP. The control plane retries three times before terminating a silent Sandbox. CPU and memory bursting let them request average rather than peak resources, cutting idle compute spend and avoiding OOMs. To counter evaluation awareness, they delete task instructions before work starts and add a reviewer agent that flags suspicious traces during verification.

The quest for software engineering knowledge.

Look:
Layout: