runtime.py, and the same pattern places rollouts on any infrastructure you can start a container on. The full walkthrough, with the concurrency and warm-pool measurements, lives in Daytona’s guide.
Open the source
The complete project: the environment, the runtime, the task list, and the benchmark receipts behind the numbers.
The environment
One file. A workspace with a shell, seeded bugs incalc.py, and a grader that pays 1.0 only when every test passes.
claude agent needs a HUD_API_KEY or an ANTHROPIC_API_KEY:
Write the runtime
A runtime is a callable that takes the task being placed and returns an async context manager yielding aRuntime: the address of the environment’s control channel. HUD connects there, runs the rollout, and exits the context, which is where the runtime tears its host down.
DaytonaRuntime in runtime.py is the whole thing, four steps top to bottom, each registering its own teardown:
- The environment travels as a Docker image. The first rollout builds
Dockerfile.hudinto a Daytona snapshot; later ones reuse it. The snapshot name is a hash of the files that go into the image (snapshot.py), so editing the environment builds a new snapshot instead of running the old one. - The control channel goes over SSH. Daytona exposes sandbox ports only as HTTPS previews, so the runtime forwards a local port to the sandbox’s
hud serveand yieldstcp://127.0.0.1:<port>. - A crashed run leaves nothing billing. Sandboxes auto-stop after 10 minutes without activity and, being ephemeral, are deleted when they stop. An open SSH forward does not count as activity, so the runtime refreshes the sandbox once a minute while the rollout runs; if the process dies, the refreshes stop and the sandbox goes.
- Sizing is Daytona’s own. Pass
resources=Resources(cpu=..., memory=...)and the snapshot is built with it. A task that setsruntime_configis refused, so a requirement is never silently dropped.
Run every variant wide
fix_calc takes a variant from 0 to 23, each a different set of seeded bugs. Run them all as one taskset, group attempts each, with up to max_concurrent sandboxes at once:
bench/baseline.py runs this and breaks the pass rate down by how many functions each variant breaks.
Run it
Source code
Runnable project: the environment,
runtime.py, and bench/ with the concurrency and warm-pool receipts.Designing tasks for signal
Build rewards with enough signal to distinguish better trajectories.
Daytona sandboxes
Spin-up measurements to 256 concurrent, warm pools, and sizing rules.