Modal
The modal Provider connects offrig directly to Modal Sandboxes over gRPC (https://api.modal.com:443) and Modal’s per-task Task Command Router—zero user-deployed cloud services, zero SSH setup, and full 3-layer Snapshot support on both x86_64 and aarch64.
Authentication
Section titled “Authentication”offrig resolves Modal credentials locally as a strict (token_id, token_secret) pair in three tiers:
- Explicit
[rigs.<name>].token_idand[rigs.<name>].token_secret(env,file, orcmdSecretResolver sources) MODAL_TOKEN_IDandMODAL_TOKEN_SECRETenvironment variables- Existing
~/.modal.tomlprofiles created bymodal setup($MODAL_CONFIG_PATH,[rigs.<name>].profile,MODAL_PROFILE, or the active profile)
Add a Modal Rig
Section titled “Add a Modal Rig”# Uses existing ~/.modal.toml or MODAL_TOKEN_ID / MODAL_TOKEN_SECREToffrig rig add modal --provider modal --default
# GPU Rig with ordered fallback (user-local only)offrig rig add ml --provider modal \ --app offrig-ml \ --gpu H100 \ --gpu A100-80GB \ --idle-minutes 5
# KVM microVM Rig with Docker-in-Docker (`run.docker = "dind"`)offrig rig add modal-dind --provider modal \ --runtime vm \ --idle-minutes 10Equivalent ~/.config/offrig/config.toml
Section titled “Equivalent ~/.config/offrig/config.toml”[rigs.modal]provider = "modal"app = "offrig" # <= 51 chars; catalog Volume is `offrig-state-<app>`modal_environment = "main" # optional Modal workspace environment# profile = "work" # optional ~/.modal.toml profileruntime = "gvisor" # gvisor (default) | vm (enables dind; forbids gpu)# gpu = ["H100", "A100-80GB"] # optional single string or ordered fallback list# regions = ["us-east"] # optional Modal scheduler region hintsarch = "x86_64" # x86_64 | aarch64# snapshot_ttl_days = 0 # 0 / omitted = no expiryidle_minutes = 5 # default 5 min; max 1440 (24h); 0 disables idle stop
# Optional explicit credential pair (defaults to MODAL_TOKEN_* -> ~/.modal.toml)# [rigs.modal.token_id]# env = "MODAL_TOKEN_ID"# [rigs.modal.token_secret]# env = "MODAL_TOKEN_SECRET"Sizing, Runtimes, and Idle Stop
Section titled “Sizing, Runtimes, and Idle Stop”- Elastic or pinned compute: Leaving
[resources].cpuand[resources].memory_mibunset lets Modal burst elastically from its minimum floor. Setting explicitcpu(1..=64) ormemory_mib(64..=344064) pins both reservation and ceiling (cpumaps 1:1 tonproc). Explicitdisk_mibis rejected because Modal fixes Sandbox rootfs at 512 GiB. - Runtimes & nested Docker:
runtime = "gvisor"(default) supports GPUs and setssupports_dind = false.runtime = "vm"boots a Modal KVM microVM supporting stockdockerd(run.docker = "dind") and forbidsgpu.run.docker = "host"is unsupported. - Safe client-orchestrated idle stop: Defaults to
idle_minutes = 5. While your laptop is awake, the Local daemon runsoffrigd secret-scan, captures a Layer-2 filesystem snapshot, re-checks for concurrent activity, and terminates the Modal Sandbox to stop billing. On a secret leak during automated idle stop, the snapshot is skipped, a stickydev.offrig.last_stop_warningis recorded, and the Sandbox is still terminated; explicitoffrig sandbox stopandoffrig sandbox resizeabort fail-closed and leave the Sandbox running. - Cross-laptop inventory: Base, Deps, and Saved Snapshots (names
1..=51chars) are published as Modal Named Images; persistent Sandbox state lives in an unmounted Modal Volume v2 (offrig-state-<app>, never mounted inside any Sandbox). - Custom images & Dockerfiles: Supports curated Ubuntu 24.04,
[env].image, and self-contained or multi-stage[env].dockerfile(COPY --from=). Local build-contextCOPY/ADDis not yet supported on Modal.
Verify
Section titled “Verify”offrig rig doctor modal