How zerobootdev/zeroboot works
Zeroboot provides isolated code execution by forking copy-on-write KVM VMs restored from Firecracker snapshots. The main workflow is client SDK → HTTP execution API → template selection and VM fork → serial command execution in the guest → captured result; the API also offers batch execution, authentication/rate limiting, health and metrics endpoints. A separate template workflow boots and snapshots a VM. The graph reflects sampled calls and README-documented capabilities; unsampled handler details and TypeScript transport are not inferred.
Main entry points: handlers.rs Execution handlers · main.rs HTTP API server · kvm.rs KVM CoW fork · firecracker.rs Firecracker boot and snapshot
Components 17
Client SDKs
- Python SDK
sdk/python/zeroboot/client.py - TypeScript SDK
sdk/node/src/index.ts
Execution API
- HTTP API server
src/main.rs - Execution handlers
src/api/handlers.rs - Auth and limits
src/api/handlers.rs - Batch execution
src/api/handlers.rs - Metrics and logs
src/api/handlers.rs
Template lifecycle
- Template creation
src/main.rs - Firecracker boot and snapshot
src/vmm/firecracker.rs - Snapshot files
VM runtime
- VM state parser
src/vmm/vmstate.rs - KVM CoW fork
src/vmm/kvm.rs - UART emulation
src/vmm/serial.rs
Guest execution
- Guest command agent
guest/init.c
Other components
- Agent or caller
- Firecracker process
- Linux KVM
Connections 21
- Agent or caller → Python SDK: calls
README.md - Agent or caller → TypeScript SDK: calls
README.md - Python SDK → HTTP API server: posts execution
sdk/python/zeroboot/client.py - TypeScript SDK → HTTP API server: uses API
README.md - HTTP API server → Execution handlers: routes requests
src/main.rs - HTTP API server → Batch execution: routes batch
src/main.rs - HTTP API server → Metrics and logs: routes metrics
src/main.rs - Execution handlers → Auth and limits: checks access
src/api/handlers.rs - Execution handlers → KVM CoW fork: forks template
src/api/handlers.rs - Execution handlers → Metrics and logs: records metrics
src/api/handlers.rs - Batch execution → Execution handlers: executes items
src/api/handlers.rs - Template creation → Firecracker boot and snapshot: creates snapshot
src/main.rs - Firecracker boot and snapshot → Firecracker process: configures and boots
src/vmm/firecracker.rs - Firecracker boot and snapshot → Snapshot files: writes snapshot
src/vmm/firecracker.rs - Template creation → VM state parser: loads state
src/main.rs - VM state parser → KVM CoW fork: provides VM state
- KVM CoW fork → Snapshot files: maps memory
README.md - KVM CoW fork → Linux KVM: creates VM
src/vmm/kvm.rs - KVM CoW fork → UART emulation: handles UART I/O
src/vmm/kvm.rs - UART emulation → Guest command agent: carries serial I/O
README.md - Execution handlers → UART emulation: sends commands