Boxlite Runtime
worker-boxlite uses the boxlite runtime as its execution backend. Each execution runs inside an independent Linux kernel, providing stronger isolation than Docker containers at the cost of slower cold starts.
When to use
- You need stronger isolation than shared-kernel containers
- Your workload requires a dedicated kernel per execution
- Security boundary is more important than cold-start latency
How it works
- The worker connects to the control node over gRPC.
- Execution requests are forwarded to the local boxlite runtime.
- boxlite manages the sandbox lifecycle and streams output back.
Prerequisites
- KVM available on the host
- Network access to the control node gRPC endpoint
Starting the worker
Download the matching version of the worker-boxlite binary from the GitHub releases page, then run:
WORKER_CONSOLE_GRPC_TARGET=<console_grpc_target> \
WORKER_ID=<worker_id> \
WORKER_SECRET=<worker_secret> \
./onlyboxes-worker-boxliteConfiguration file
The Worker Startup Tool in the dashboard can generate and download a ready-to-use config.toml. Set WORKER_CONFIG_FILE to use a specific file. If it is not set, the worker looks for config.toml next to the worker binary and then in the current working directory.
Environment variables take precedence over config.toml, which takes precedence over built-in defaults. TOML keys use the environment variable name without the WORKER_ prefix and in lowercase; for example, WORKER_TERMINAL_EXEC_BOXLITE_IMAGE becomes terminal_exec_boxlite_image. Use a [labels] table for worker labels.
id = "wk_..."
secret = "..."
console_grpc_target = "console.internal:50051"
terminal_exec_boxlite_image = "coolfan1024/onlyboxes-runtime:default"
terminal_max_active_sessions = 0
[labels]
region = "us"See the annotated configuration template for all available keys.
Environment variables
Connection
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_CONSOLE_GRPC_TARGET | No | 127.0.0.1:50051 | Control node gRPC address |
WORKER_CONSOLE_INSECURE | No | false | Set true to allow insecure connections (non-TLS) |
WORKER_ID | Yes | Worker ID from the dashboard | |
WORKER_SECRET | Yes | One-time secret from worker creation |
Identity
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_NODE_NAME | No | Human-readable node name | |
WORKER_VERSION | No | build version | Version reported to console |
WORKER_LABELS | No | CSV labels, e.g. region=us,owner=team-a |
Boxlite
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_BOXLITE_HOME | No | Boxlite home directory | |
WORKER_PYTHON_EXEC_BOXLITE_IMAGE | No | ghcr.io/astral-sh/uv:python3.12-bookworm-slim | Image for Python execution |
WORKER_PYTHON_EXEC_MEMORY_MIB | No | 256 | Python VM memory (MiB) |
WORKER_PYTHON_EXEC_CPUS | No | 1 | Python VM CPU count |
WORKER_PYTHON_EXEC_MAX_PROCESSES | No | 128 | Python max processes |
WORKER_TERMINAL_EXEC_BOXLITE_IMAGE | No | coolfan1024/onlyboxes-runtime:default | Image for terminal execution |
WORKER_TERMINAL_EXEC_MEMORY_MIB | No | 256 | Terminal VM memory (MiB) |
WORKER_TERMINAL_EXEC_CPUS | No | 1 | Terminal VM CPU count |
WORKER_TERMINAL_EXEC_MAX_PROCESSES | No | 128 | Terminal max processes |
The default terminal image is a general execution image with Python 3, Node.js 24, npm, Corepack, common shell/file utilities, lightweight document helpers, and agent-browser with Lightpanda. Use coolfan1024/onlyboxes-runtime:lobehub for LobeHub-specific sandbox tooling.
Concurrency
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_ECHO_MAX_INFLIGHT | No | 4 | Max concurrent echo commands |
WORKER_PYTHON_EXEC_MAX_INFLIGHT | No | 4 | Max concurrent pythonExec commands |
WORKER_TERMINAL_EXEC_MAX_INFLIGHT | No | 4 | Max concurrent terminalExec commands |
WORKER_TERMINAL_RESOURCE_MAX_INFLIGHT | No | 4 | Max concurrent terminalResource commands |
WORKER_TERMINAL_SESSION_MAX_INFLIGHT | No | 1 | Max concurrent operations in one terminal session; shared by terminalExec and terminalResource |
WORKER_TERMINAL_MAX_ACTIVE_SESSIONS | No | 0 (unlimited) | Maximum terminal sessions managed by this worker process |
WORKER_TERMINAL_EXEC_MAX_INFLIGHT and WORKER_TERMINAL_RESOURCE_MAX_INFLIGHT independently limit their respective capabilities across the worker; there is no additional aggregate worker-wide limit. WORKER_TERMINAL_SESSION_MAX_INFLIGHT applies to one session_id and counts terminalExec and terminalResource together. A request must satisfy both its capability limit and the session limit.
WORKER_TERMINAL_MAX_ACTIVE_SESSIONS is a separate session-count limit. 0 leaves the count unlimited; a positive value counts sessions that are being created, ready, being destroyed, or undergoing Box cleanup. Existing sessions remain usable when the limit is full, while a new session returns 429 session_capacity_exceeded. Negative or invalid values fall back to 0.
For example, with both capability limits set to 10 and the per-session limit set to 2, the worker can process up to 10 terminalExec and 10 terminalResource operations at once, while any one session can run at most two operations in total. Exceeding the per-session limit returns 409 session_busy; exhausting a capability's worker-wide concurrency returns 429 no_capacity; exhausting the session-count limit while creating a session returns 429 session_capacity_exceeded.
Terminal lease
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_TERMINAL_LEASE_MIN_SEC | No | 60 | Minimum lease duration (seconds) |
WORKER_TERMINAL_LEASE_MAX_SEC | No | 1800 | Maximum lease duration (seconds) |
WORKER_TERMINAL_LEASE_DEFAULT_SEC | No | 60 | Default lease duration (seconds) |
WORKER_TERMINAL_OUTPUT_LIMIT_BYTES | No | 1048576 | Output limit per stream (bytes) |
WORKER_TERMINAL_EXPORT_MAX_BYTES | No | 0 (unlimited) | Maximum file size in bytes for export action; 0 disables the limit |
The Worker advertises terminalLeaseRenew as an internal Console-only capability. It accepts {"session_id":"required","lease_ttl_sec":300}, extends an existing lease monotonically, and returns the confirmed absolute expiry without executing a command. Its independent max_inflight declaration uses the configured WORKER_TERMINAL_EXEC_MAX_INFLIGHT value.
Heartbeat
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_HEARTBEAT_INTERVAL_SEC | No | 5 | Heartbeat interval (seconds) |
WORKER_HEARTBEAT_JITTER_PCT | No | 20 | Jitter percentage (0–100) |
WORKER_CALL_TIMEOUT_SEC | No | ceil(2.5 * interval) | gRPC call timeout (seconds) |
Logging
| Variable | Required | Default | Description |
|---|---|---|---|
WORKER_LOG_LEVEL | No | info | debug / info / warn / error |
WORKER_LOG_FORMAT | No | json | json / text |
WORKER_LOG_ADD_SOURCE | No | false | Include source file and line |