# Building a version control system on rented CPUs
How LVCS used Shadeform CPU instances and the `shade` CLI as its build farm, test network and canary.
LVCS is a local-first, serverless version control system where people and AI agents edit one live main together. It is written in Rust, tested end to end in Docker, and developed inside itself: the project's own runners build and test every version of main.
That workload is all CPU. A cold workspace build, three Docker end-to-end shards, a unit suite that wants 12 GB to link, soak tests and a canary do not need a GPU. They need cores, memory, fast disks and a public address. Shadeform is known for GPUs, but the same API and CLI rent CPU-only machines from the same providers, and through the 0.3.0 cycle those machines carried much of the project's building and testing.
## What the CPU instances did
Each role below comes from the project's runner configuration files, which record what every host ran.
| Role | What ran there | Shape |
| --- | --- | --- |
| Check and unit-test runner | Cargo check, clippy and the workspace unit suite: two suite runs at 12 GB each beside the runner's own daemon. | Latitude `cpu_32`, Dallas: 32 cores, 125 GB |
| End-to-end runner | Docker Compose stacks of scripted LVCS peers. One shard peaks near 23 GB. | The same `cpu_32` host, a second runner container |
| Fleet runners and bootstrap node | Two more runners plus the project's relay and bootstrap peer, the public address other nodes dial first. | Verda `cpu_16` |
| Agent build host | AI coding agents ran red-test-first builds here instead of on the maintainer's laptop. | A 28-core, 78 GB instance |
| Internet proof | LVCS daemons that can reach each other only over the public internet: sync, partitions, convergence. | Small instances, created for the run and deleted after |
| Canary | A long-running node on real project state, watched for memory growth. | One runner-class instance |
Two things made CPU instances a good fit and not only a cheap one.
**They are real, separate machines on the public internet.** LVCS is peer-to-peer over libp2p. NAT traversal, relays, partitions and reconnects cannot be proven on one laptop. A handful of instances at different providers and in different regions is the test environment.
**They are disposable.** A runner host is defined by a config file and one idempotent provisioning script: Docker with buildx and compose, inotify limits for the e2e stacks, an AppArmor profile for the action sandbox, a prune cron. When one host's network started flapping, the project retired it and brought up a replacement at another provider the same day, with the same script and the same flags.
## What it costs
CPU-only types available on demand on 16 November 2026, cheapest first, as `shade instances list-types` returned them. Prices drift.
| Provider | Type | vCPUs | Memory | Disk | Per hour |
| --- | --- | ---: | ---: | ---: | ---: |
| Massed Compute | `cpu_mini` | 8 | 32 GB | 400 GB | $0.12 |
| Verda | `cpu_4` | 4 | 16 GB | 250 GB | $0.12 |
| Latitude | `cpu_4` | 4 | 16 GB | 160 GB | $0.19 |
| Massed Compute | `cpu_small` | 14 | 40 GB | 800 GB | $0.22 |
| Verda | `cpu_8` | 8 | 32 GB | 500 GB | $0.24 |
| Latitude | `cpu_8` | 8 | 32 GB | 320 GB | $0.35 |
| Latitude | `cpu_16` | 16 | 64 GB | 640 GB | $0.65 |
| Latitude | `cpu_32` | 32 | 128 GB | 1,024 GB | $1.02 |
| Verda | `cpu_180` | 180 | 720 GB | 8,000 GB | $4.36 |
The 32-core shape that carried both the unit suite and an e2e runner lists at about a dollar an hour. The same type name means different shapes at different providers: `cpu_small` is 14 vCPUs and 40 GB at one and 4 vCPUs and 4 GB at another. Compare the configuration, not the name.
## The shade CLI, end to end
Everything below is the official `shade` CLI. Pass `-o json --no-interactive` when a script or an agent is driving it.
### Find a CPU shape
CPU types report zero GPUs, so filter on that. `-a` keeps what is available now, and `-q` is a built-in jq filter, so no extra tooling is needed.
```bash
shade instances list-types -a --sort price -o json --no-interactive \
-q '[.instance_types[] | select(.configuration.num_gpus==0)
| {cloud, type: .shade_instance_type,
vcpus: .configuration.vcpus, gb: .configuration.memory_in_gb,
usd_per_hour: (.hourly_price/100)}]'
```
### Register a key once
```bash
shade ssh-keys add --name lvcs-lab --public-key "$(cat ~/.ssh/lvcs-lab.pub)"
```
### Create the instance
Cloud, region, type and name are required. `--auto-delete` and `--alert` take a date or a spend threshold, and `--tags` makes the fleet searchable later.
```bash
shade instances create --cloud latitude --region <region> \
--shade-instance-type cpu_32 --shade-cloud=true \
--name lvcs-dev-3 --ssh-key-id <key id> --tags lvcs --tags runner \
-o json --no-interactive
```
Creation is asynchronous. The response says `creating`, and `shade instances get <id>` reports when the instance is `active` and what its address is. `shade instances create --schema` prints the exact request body for anyone who would rather send JSON.
### Provision and join
From here it is plain SSH. LVCS runs one script against the new host and starts the runner container, and the runner joins the project through the bootstrap node.
```bash
scripts/lvcs/lab-host-provision.sh lvcs-dev-3
```
### See what is running, and stop paying for it
```bash
shade instances list -o json --no-interactive
shade instances delete <id>
```
`shade templates save` stores a launch configuration, the natural next step once a runner shape settles.
## Agents as operators
LVCS is developed by a team of AI coding agents working in parallel lanes, with a human owner making scope decisions. That changes what a cloud CLI needs to be.
- **Non-interactive by default.** Structured output and a built-in jq filter let an agent pick a shape, create it and read back its address without scraping text.
- **Pushed events instead of polling.** The Shadeform plugin for Claude Code pushes instance lifecycle changes, node health such as a filling disk or an OOM kill, and spend events into the session. An agent is told when a host is ready or in trouble and does not loop on `get`.
- **A spend guard.** A hook asks the human before any command that creates, restarts or deletes an instance, and budgets raise events at 50, 80 and 100 percent. Agents propose; a person approves the money.
## What we learned
1. **Set auto-delete and a budget at creation.** Every instance should carry its own end date from its first minute.
2. **Treat addresses as reusable by strangers.** When an instance goes away, its IP is handed to someone else. Remove the address from every config the moment a host is retired, pin host keys, and never accept a changed one. LVCS's config for a retired host drops the address entirely, so nothing can dial it by mistake.
3. **Never copy a working tree to a rented host.** Send a clean export that cannot contain `.env` files or keys. The host is disposable, and whatever goes onto it should be too.
4. **Keep provisioning in one idempotent script.** That is what made a same-day move between providers possible.
5. **Size for the worst leg.** The unit suite's link step and an e2e shard's peak memory decide the shape. A 32 GB host cannot hold two e2e shards; a 128 GB one runs the unit suite and a shard side by side.
6. **Capacity is schedule.** With several runners, the gate's legs run in parallel. Through a single e2e slot the same gate takes most of a night.
## What we would like next
The idea we want to try is elastic runner capacity. When a release candidate is named, the gate asks for a `cpu_32`, the CLI creates it from a saved template with an auto-delete a few hours out, the provisioning script and the runner join take a few minutes, and the instance deletes itself when the gate is done. None of this is built yet.