Computers and templates
A computer is one isolated desktop on your workspace's worker host. A template says what it starts from.
Computers
A computer (an Env in the SDK, a slot in the HTTP API) is one running desktop: the OSWorld Ubuntu image's GNOME session on display :0, restored from a checkpoint, in its own namespaces and cgroup on your workspace's worker host. You create computers from the SDK or the HTTP API with an API key, or from the console under Computers > Launch computer. Both kinds appear in the console with the same id.
| Property | Value |
|---|---|
| Operating system | Linux: the OSWorld Ubuntu image (the only launch target) |
| Screen | 1920 x 1080, 24-bit, origin (0, 0) at the top left, coordinates in pixels |
| Size | 4 vCPU and 4 GiB of memory per desktop, no swap (cgroup limits); one size per host |
| User | user (uid 1000), home /home/user, not an administrator: sudo, su and pkexec refuse |
| Network | none from inside the desktop: loopback only, no DNS |
| Lifetime | every computer has one: the workspace default (3600 s unless changed) or the ttl you pass, capped at the workspace maximum (14400 s by default) |
| Idle timeout | closed after 1800 s with no request naming it (never longer than its lifetime) |
Inside a desktop, nproc and free report the host's CPUs and memory, not the desktop's: the per-desktop view of /proc is an opt-in runtime feature that is not enabled on the current host. The cgroup limits above are what apply.
States
The console shows the state the runtime reports, never an optimistic one. The SDK and HTTP API report the runtime's own record:
Runtime state | Console | Meaning |
|---|---|---|
creating | Starting | The restore is running |
ready | Ready (In use when a console run drives it) | Up; the current episode may still be pending for a few seconds |
capturing | In use | A save or fork is capturing its state |
resetting | Recovering | A reset is running |
down | Failed | A restore failed before the desktop ran, or a quarantined computer was released. reset() tries again |
quarantined | Failed | A gate failed or you quarantined it. Its state is not trusted; steps are refused |
destroying | Deleting | Being closed |
destroyed | Deleted | Closed by you, by its lifetime or idle timeout, or by a spend cap. Records are kept |
The console also shows states that exist before a desktop does (Requested, Queued) and No heartbeat when the host stopped reporting.
Episodes
Each create, reset and fork child starts a new episode (env.episode counts them). An episode is what a reward belongs to: verify() scores the current episode, and the episode's gate report says whether that reward can be used. See Tasks and verifiers.
Actions
env.step(action) (HTTP POST /v1/slots/{id}/step) runs one action inside the desktop as user:
| Action | Form | What runs |
|---|---|---|
| pyautogui | "pyautogui.click(100, 200)" or {"type": "pyautogui", "code": "..."} | Python with OSWorld's prefix (import pyautogui; import time, failsafe off). At most 16384 characters. |
| execute | {"type": "execute", "command": ["ls", "-l"]} or {"type": "execute", "command": "ls ~/Desktop", "shell": true} | A command; waits for it and returns its output and exit code |
| launch | {"type": "launch", "command": ["gedit"]} | Starts a command and returns at once |
| sleep | {"type": "sleep", "seconds": 2} | Waits on the host, at most 60 s |
import drums
with drums.connect() as client:
with client.create(ttl=600) as env:
env.step("pyautogui.moveTo(960, 540)")
r = env.step({"type": "execute", "command": ["ls", "/home/user"]})
print(r.result["returncode"], r.result["output"].split())
r = env.step({"type": "execute", "shell": True, "command": "test -d /nope"},
check=False)
print("exit code", r.result["returncode"])An action that exits non-zero raises ActionFailed unless you pass check=False. If you train a GUI agent, do not give the policy execute: it is a shell and can solve file tasks without touching the GUI. Use it from your own harness for setup and probes.
Observations
env.screenshot() returns PNG bytes (1920 x 1080, 8-bit RGB, about 1.7 MB). env.observe() returns an Observation with .png, .width, .height and .meta (episode, state, verdict, task id, instruction, steps). Resize in your code if your model wants a smaller image.
Templates
A template is a reproducible launch definition. Each published version is an immutable manifest pinned to one image digest:
| Field | Meaning |
|---|---|
base_checkpoint | The image computers restore from, e.g. osworld-ubuntu |
image_digest | sha256: of the desktop image; a version launches only on hosts whose image matches |
expected_state_hash | The file-system hash the state_hash gate checks after every restore |
provenance | Hashes of the runtime sources and image inspection the checkpoint was made with |
resource_config | {vcpus, memory_mib, swap_mib} |
setup | An optional OSWorld setup recipe replayed on each launch |
manifest_hash | sha256 of the canonical manifest; the gateway recomputes it before every launch and refuses a mismatch |
Every workspace sees the platform template OSWorld Ubuntu (base checkpoint osworld-ubuntu, 4 vCPU, 4096 MiB, no swap). Owners and admins can create workspace templates under Templates and publish a draft version; a published version cannot change. Through the API you choose a template by its base checkpoint name (image="osworld-ubuntu"); GET /v1/checkpoints and client.images() list what your workspace may launch on its host.
Console actions
| Action | Who | Notes |
|---|---|---|
| Launch | Any member | Name, template version, lifetime (presets up to the workspace maximum), labels |
| Restart | The computer's owner, admins, owners | Resets to the launch state (a new episode) |
| Snapshot | Any member | See Checkpoints, snapshots and forks |
| Fork | Any member | n copies, limited by the host and your live-computer limit |
| Terminate | The computer's owner, admins, owners | Idempotent; measured cost stops |
| Stop | Not supported: a desktop cannot be paused and resumed. Terminate ends it; a snapshot keeps its state |