What dvm.run is
dvm.run runs Docker images in sandboxes you create, drive, and stop through an API from Python, TypeScript, or Rust. Every sandbox runs on dvm, a deterministic virtual machine, and is recorded automatically. Once it exits, seek (replay the recording to a chosen moment) to any point in the run, step through events, and read files as they existed then.
A first sandbox
Section titled “A first sandbox”from dvm import Sandbox
with Sandbox.create("python:3.12") as sandbox: result = sandbox.run(["python", "-c", "print('hello from a sandbox')"]) print(result.exit_code, result.stdout.decode(), end="")
sandbox.write_file("/tmp/notes.txt", b"written before the end\n") sandbox.end()
point = sandbox.seek() print(point.read_file("/tmp/notes.txt").decode(), end="")import { Sandbox } from "dvm-run";
await using sandbox = await Sandbox.create("python:3.12");const result = await sandbox.run(["python", "-c", "print('hello from a sandbox')"]);console.log(result.exitCode, new TextDecoder().decode(result.stdout));
await sandbox.writeFile("/tmp/notes.txt", new TextEncoder().encode("written before the end\n"));await sandbox.end();
const point = await sandbox.seek();console.log(new TextDecoder().decode(await point.readFile("/tmp/notes.txt")));#[tokio::main]async fn main() -> dvm_run::Result<()> { let client = dvm_run::Client::from_env()?; let sandbox = client.create_sandbox("python:3.12").await?; sandbox .scope(async |sandbox| { let result = sandbox .run(["python", "-c", "print('hello from a sandbox')"]) .await?; print!( "{} {}", result.exit_code, String::from_utf8_lossy(&result.stdout) ); sandbox .write_file("/tmp/notes.txt", b"written before the end\n") .await?; Ok(()) }) .await?;
let point = sandbox.seek_end().await?; let notes = point.read_file("/tmp/notes.txt").await?; print!("{}", String::from_utf8_lossy(¬es)); Ok(())}This creates a sandbox from python:3.12, waits for it to start, runs a
command, prints its exit code and output, and writes a file. Closing its
input ends the sandbox. Seeking to the end returns a point (a recorded
moment in the run) where you can read that file back.
Install an SDK and set an API key to run it:
pip install dvm-run # Python 3.12 or newernpm install dvm-run # Node 22.12 or newercargo add dvm-run tokio --features tokio/macros,tokio/rt-multi-threadexport DVM_API_KEY=... # a key from the panel, or run `dvm-run login`Follow Getting in to get an account and API key.
Where next
Section titled “Where next”Getting inSign in, join the waitlist, and get an API key.
For coding agentsShortest path to a working sandbox, plus Markdown docs.
SessionsRun commands and transfer files.
Inspecting a finished runSeek to a point, step through events, and read files.