Parallel sandboxes for agent evals and RL rollouts

Evals, benchmarks and reinforcement learning runs need many short, isolated environments at once. Give every rollout its own Firecracker sandbox, run them in parallel and pay per second.

One sandbox per rollout

from concurrent.futures import ThreadPoolExecutor
from e2b import Sandbox, CommandExitException


def rollout(task):
    with Sandbox.create(timeout=900) as sbx:
        sbx.files.write("/home/user/solution.py", task["code"])
        try:
            r = sbx.commands.run("python3 /home/user/solution.py", timeout=300)
            return task["id"], r.exit_code, r.stdout
        except CommandExitException as e:
            return task["id"], e.exit_code, e.stderr


with ThreadPoolExecutor(max_workers=50) as pool:
    for task_id, exit_code, output in pool.map(rollout, tasks):
        print(task_id, exit_code)

Each rollout starts from a clean microVM in about half a second and is removed when the with block ends. A failing task does not affect the others: non-zero exit codes arrive as CommandExitException.

Prepare the environment once

If every rollout needs the same repository and packages, build a custom template with the E2B template SDK. Each sandbox then starts with everything installed instead of running pip install a thousand times. Templates go up to 8 vCPU and 64 GiB RAM.

Limits

Paid accounts run up to 50 sandboxes at a time, the free trial 5. Need more for a benchmark run? Write to support@getrollouts.dev before you start. If a start is refused because a limit is reached, retry with a short backoff.

What a run costs

1,000 rollouts of 10 minutes each at 2 vCPU and 2 GiB RAM are about 167 sandbox-hours: $17.67 at $0.106 per hour, billed per second. Nothing is billed between runs and there is no monthly fee.

Try it free   Read the docs

Code tested on getrollouts.dev on 2026-12-02 with e2b 2.64. Works with the official E2B SDKs after setting E2B_API_KEY and E2B_DOMAIN=getrollouts.dev. getrollouts.dev is not affiliated with E2B.