Skip to content

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

Modal 4 min read Case study easyNovice

How Abundant designed efficient rollout architecture with Modal Sandboxes

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.

Assumes: reinforcement learning rolloutssandboxed execution

Related posts

  • 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.

  • Sandbox resourcing: burst, don't reserve

    Modal mediumAdept

    Modal Sandboxes default to a tiny guaranteed request (0.125 cores, 128 MiB) and burst into a shared pool of idle machine capacity, billed per second on actual use rather than a fixed peak reservation. Since typical sandboxes spend over half their life under 6% of peak CPU, costs should be estimated from average rather than peak usage; an illustrative 20-minute coding-agent task comes out 58% cheaper than a fixed-size reservation. Bursting works because unrelated workloads rarely spike together, but CPU contention slows sandboxes and memory pressure can OOM-evict those above their request, backed by an SLO of under 0.0001% per minute for sandboxes under 8 GiB. Set limits for consistent eval/RL environments or cost caps, and raise the memory request if evictions are unacceptable.

  • Building with Modal and the OpenAI Agents SDK

    Modal mediumAdept

    A custom agent harness built on the OpenAI Agents SDK runs coding agents inside Modal Sandboxes, optionally with GPUs, rather than on the host, where an unsandboxed exec tool can be abused by malicious prompts. The harness grows step by step: SQLite-backed Sessions for memory, an orchestrator that delegates to subagents with fresh context windows to limit context rot, and an asyncio-based subagent pool for parallel, non-blocking work. Hooks and a set_status tool let the orchestrator monitor subagents, and per-GPU-type quotas cap spend. Filesystem snapshots are also used to avoid duplicated work. The worked example targets OpenAI's Parameter Golf challenge, with parallel MNIST training as an intermediate test.

  • 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.

  • Scaling to 1 million concurrent sandboxes in seconds

    Modal mediumAdept

    Modal rebuilt its sandbox control plane to run 1 million concurrent sandboxes, creating all of them in under a minute, by removing central coordination and durable stores from the creation path. A horizontally scaled fleet of scheduling servers picks workers using in-memory state that workers publish to a Redis stream, then calls the worker directly over RPC; workers act as their own source of truth and reject requests when full. Kubernetes and Modal's old Postgres-backed design hit limits from O(pods) and O(nodes) etcd and Postgres writes and serialized scheduling. The new path takes two network hops, scheduling takes tens of milliseconds, and median start time is under 0.5s, with tail latency driven by kernel rtnl lock contention during container networking setup.

The quest for software engineering knowledge.

Look:
Layout: