# lauf > lauf runs builds, tests and shells on spot VMs (2–64 cores) in the user's own Google Cloud project: Linux (x86_64 by default, arm64 on Arm sizes), Windows (.NET) and NVIDIA GPU (L4, T4) machines; macOS builds run on the project's GitHub-hosted runners. The `lauf` CLI uploads the current folder's working tree (uncommitted files included, .gitignore respected), runs a command in a container on the VM with a shared compile cache, streams the log back and exits with the command's exit code. VMs start on demand and are deleted when idle. Full documentation without signing in: https://lauf.dev/docs.md (Markdown) or https://lauf.dev/docs (web page). Invite only: the user's Google account must be allowed by the lauf admin. Never print, log or commit lauf API keys. ## Install - macOS / Linux: `curl -fsSL https://lauf.dev/install.sh | sh` - Windows (PowerShell): `irm https://lauf.dev/install.ps1 | iex` - Sign in: `lauf login` opens a Google sign-in in the browser. The user signs in themselves; wait for it. Without a local browser (SSH, Cloud Shell) the browser shows a code the user types into the terminal. - VM sizes: `lauf -machine 32 -- cargo build --release` (or `machine = "32"` in .lauf.toml) runs on a 32-core VM; sizes are cores (2, 4, 8, 16, 32, 48, 64) or full machine types such as `c4a-highcpu-16` (Arm) or `n4-highcpu-32`. Without it, builds use the account's default machine type (Account page or `lauf settings machine=…`). VMs only take builds of their own size; all sizes share the "VMs in parallel" limit and the C4D quota. `lauf ps` shows each build's machine. - Fresh VM: `lauf -fresh -- ./bench.sh` (or `fresh = true` in .lauf.toml) runs on a new VM no job ran on before, reserved for this one build and deleted afterwards (also on failure, even with more builds queued); use it for cold-start benchmarks or when a build needs a clean machine. Without it a free VM takes the next build and keeps its caches. The build's page records whether its VM was fresh or reused. - Provisioning: builds run on Spot VMs by default. `lauf -provisioning standard -- cargo bench` (or `provisioning = "standard"` in .lauf.toml) runs on a standard on-demand VM of the same machine type instead: never preempted, but billed at the full rate (several times Spot). Use it for benchmarks or runs that must not be interrupted. A build only runs on a VM of the model it asked for – no silent fallback either way; Google Cloud and Azure. - Windows: `lauf -os windows -- dotnet test` (or `os = "windows"` in .lauf.toml): Windows Server VM with the .NET SDK and Git, command runs in cmd.exe, no container; boot ~3 min; Windows license billed on top. - GPU: `lauf -gpu l4 -- python train.py` (or `gpu = "l4"` in .lauf.toml; `t4` also available): spot GPU VM (L4 24 GB on g2-standard-8, or T4 16 GB on n1-standard-8), container gets the GPU, default image `pytorch/pytorch:2.14.1-cuda12.6-cudnn9-runtime` (PyTorch + CUDA; override with `-image`), `/root/.cache` kept on the VM; boot ~3–5 min. New Google Cloud projects have GPU quota 0: if a GPU build fails with a quota message, tell the user to request `GPUS_ALL_REGIONS` ≥ 1 and `PREEMPTIBLE_NVIDIA_L4_GPUS` (or `PREEMPTIBLE_NVIDIA_T4_GPUS`) ≥ 1 in their region at https://console.cloud.google.com/iam-admin/quotas – do not retry in a loop. Spot GPUs can be preempted (lauf retries once) and VMs live at most 12 h (`max-age`): checkpoint long runs to `/persist` (`-persist`). - CI: `lauf ci github|gitlab [-a FILE] [-- cmd]` in the repository creates a key, stores it as the secret `LAUF_KEY` (via gh/glab) and writes the workflow. Elsewhere set `LAUF_KEY` (from `lauf key create -ci NAME`: builds only) instead of `lauf login`. GitLab template: `include: [{remote: https://lauf.dev/ci/gitlab.yml}]` + `extends: .lauf`. - Where GitHub CI builds run: `LAUF_RUNNER` in `.github/workflows/lauf.yml` (`env:`), overridden by the repository variable `LAUF_RUNNER` (`gh variable set LAUF_RUNNER --body github`) or the `runner` input of a manual run. `auto` (default): lauf VMs, but the GitHub runner itself (the repository's included Actions minutes) when lauf can't take the build – no `LAUF_KEY` (fork pull requests), no lauf machines, monthly limit reached, no VM can start (quota/capacity), too many builds queued, lauf unreachable. `lauf`: always lauf (fails without `LAUF_KEY`). `github`: always the runner (4 cores, no lauf costs). The job summary states where a build ran and why. `lauf ci route` makes the decision; `lauf ci local` builds on the runner in the project's image (.lauf.toml `image`/`cmd`/`cache`, artifacts to lauf-out/, cache in ~/.cache/lauf-ci). Windows builds can use the runner only with `LAUF_RUNNER=github` (the job then runs on windows-latest). Change `-runner` when writing the workflow: `lauf ci github -runner github`. - Update: `lauf update` installs the newest client; lauf prints a hint once a day when one is available. - Uninstall: `lauf uninstall` signs out and removes the binary and config (`-gcp` also runs `lauf setup gcp --remove`). ## Set up the machines (once per user) Needs the Google Cloud CLI (`gcloud auth login` done by the user). Without a local gcloud: run the setup once in Google Cloud Shell (https://shell.cloud.google.com, gcloud preinstalled and signed in): `curl -fsSL https://lauf.dev/install.sh | sh && ~/.local/bin/lauf login && ~/.local/bin/lauf setup gcp`. - `lauf setup gcp`: offers to create a project, links billing, creates network, service account and cache bucket, and grants the gateway rights in that project only. Asks for a monthly limit (default 10 in the billing account's currency). - `lauf setup gcp --project ID`: use an existing project. - `lauf settings`: show machine, idle timeout, max VMs, monthly limit. Change with `idle=MIN` (0 or 1–120; 0 deletes a VM as soon as its build ends), `max-vms=N` (1–4), `machine=TYPE`, `max-age=HOURS` (1–12, default 3; a VM is deleted after this even mid-build), `budget=AMOUNT|off`, `currency=CODE` (e.g. CHF; the limit, costs and prices use it; default and `currency=auto`: the billing account's), `windows-image=NAME|previous|default` (Google Cloud: the image Windows VMs boot, e.g. one built with packer/windows-gcp; `previous` rolls back). ## Run things - `lauf` = `cargo build --release` in the current folder - `lauf -- COMMAND ...`: any command, e.g. `lauf -- cargo nextest run --workspace` - `lauf -a target/release/NAME -- cargo build --release`: download an artifact to `lauf-out/` - `lauf shell`: interactive shell in a fresh job container; `lauf shell -attach ID` joins a running build - `lauf forward BUILD PORT[:LOCALPORT]...`: a running build's or shell's container ports on localhost (HTTP and WebSockets; Linux builds; until Ctrl-C or the build ends); `lauf shell -p PORT` and `lauf -p PORT -- CMD` do the same for their own job. `-share [-ttl 1h]` also prints a public HTTPS link anyone with it can open (not enabled on lauf.dev yet: the server needs FORWARD_DOMAIN); `lauf forward -l` lists links, `lauf forward -revoke ID|URL` ends one - `lauf -snapshot NAME -- ...` saves the workspace incl. target/; `lauf -from NAME -- ...` forks from it with local changes (fast incremental builds) - `lauf -persist -- ...`: `/persist` survives between jobs - `lauf ps [-a] [-w]`: running builds and VMs (`-w` live view); `lauf stop BUILD...`; `lauf stop -vms [-all]` - A cold VM takes about 80–110 s; while it stays warm, builds start in seconds. Run long builds in the background and read the streamed log; a non-zero exit code means the command failed. ## Per project - `.lauf.toml` in the project root (optional): `image = "node:22-bookworm"`, `cmd = "pnpm build"`, `cache = ["/root/.local/share/pnpm"]`, `persist = true`, `machine = "32"` (VM size for this project), `gpu = "l4"` (GPU VM), `fresh = true` (each build on a new VM of its own), `provisioning = "standard"` (on-demand VMs instead of Spot), `backend = "client-a"` (a named backend), `git_credentials = true` (the job gets the linked git tokens) - Upload: in a git repo, tracked and new files as they are now; everything git ignores (`.gitignore`, `.git/info/exclude`, global excludes) is never uploaded, so keep secrets git-ignored. `.laufignore` (gitignore syntax) also skips tracked files the build doesn't need. An unchanged tree reuses the upload of the user's latest build in the same cloud (kept 24 h after it ends) instead of uploading again, so retries and comparisons across `-machine` sizes start faster. Outside git: the whole folder except `.git`, `target`, `node_modules`, `lauf-out`. - Builds on GitHub's runners with the repository's included Actions minutes: `lauf -runner github -- cargo test` (or `runner = "github"` in .lauf.toml). Needs GitHub connected (`lauf link --github`, with the workflow permission) and write access to the project's GitHub origin. The first time, lauf adds `.github/workflows/lauf-runner.yml` to the default branch (a pull request when the branch is protected: merge it, then build again) and dispatches it; its runner builds the uploaded working tree in the same container image and streams the log; artifacts come back as usual. Only the project's own repository is used. 4 cores, no shared compile cache, no snapshots or /persist, Linux only, no lauf VM cost; at most 4 at a time per repository; boot ~30–60 s plus GitHub's queue. - GitHub Actions runners on lauf VMs: `lauf runners add OWNER/REPO` (or Account → GitHub Actions runners; needs GitHub connected with repository access and admin rights on the repo). Then any job with `runs-on: lauf` (the account's default machine) or `runs-on: lauf-32` (2, 4, 8, 16, 32, 48, 64 cores) runs on a fresh lauf VM within ~15 s of being queued: the full GitHub runner (Docker, passwordless sudo, git), deleted after the one job, without access to the lauf cache bucket. Pull requests from forks never run. The job shows up in lauf's Builds with its log; cost is lauf VM time. `lauf runners` lists repositories and errors. `lauf runners backend OWNER/REPO NAME|default` (or the repository's row on the Account page) picks the backend its jobs run on and are billed to. - Several projects or subscriptions (each on its own billing account): `lauf setup gcp --project ID --name client-a` (or `lauf setup azure … --name client-b`), then `lauf -backend client-a -- …`; `lauf settings -backend client-a …` changes its own sizes and limit, `lauf settings default=client-a` makes it the default, `lauf settings` lists all backends. The dashboard has a tab per backend. - Sign-in: `lauf login` (Google) or `lauf login --github` (GitHub accounts, e.g. github: users). Both open the browser. - Private GitHub/GitLab dependencies: `lauf link --github` (one click in the browser) or `lauf link --gitlab HOST [--token]` (or "Connect GitHub" on the dashboard's Account tab), plus `git_credentials = true` in the project's .lauf.toml (or `lauf -git-credentials`): only then does the job get the tokens. Never for builds started with a CI key or on GitHub's runners. ## Links - [Dashboard](https://lauf.dev/dashboard): builds, VMs, costs, live log, limits, connected accounts - [Docs](https://lauf.dev/docs): the full guide, public - [Docs as Markdown](https://lauf.dev/docs.md): the same for agents (also at /llms-full.txt) - [Changelog](https://lauf.dev/changelog.md): what changed in each release (`lauf changelog` prints it too)