Skip to main content

Quickstart by task

Pick the job you have; each path is a handful of commands, with a link to the full page. Every command works with the current CLI and SDK (pip install lium.io, 0.16.1). Authenticate once with lium signup (new account) or lium init (existing key), or set LIUM_API_KEY. Billing is per second with no minimum, so a short run costs only the seconds it uses.

Give my AI agent a GPU​

An agent with a shell can sign up, rent, run and release a GPU on its own.

Run a quick experiment​

lium up --gpu RTX4090 --name exp --ttl 1h -y --json # rent, wait, remove itself after 1 hour
lium exec exp "nvidia-smi" # exits with the remote command's exit code
lium scp exp ./experiment.py # upload to ~/experiment.py
lium exec exp "python experiment.py"
lium rm exp -y # done early? release it now

More: CLI quickstart · lium up · lium exec

Train a model​

Keep data on a volume (mounted at /mnt, survives the pod), back up checkpoints on a schedule, and run the job detached so your shell is free.

lium up --gpu H100 --name train --volume new:name=train-data --ttl 2d -y --json
lium bk set train --path /root/checkpoints --every 1h --keep 7d -y
lium exec train -d --log /root/train.log "python train.py --data /mnt --out /root/checkpoints"
lium exec train "tail -n 50 /root/train.log" # check progress any time
lium scp train /root/checkpoints/final.pt ./ -d # pull the result back

More: Volumes · Backups · SDK training workflow

Serve an LLM with vLLM​

Tested on lium.io (15 Oct 2026, one RTX 4090): Qwen2.5-7B-Instruct served in about 4 minutes from lium up, at about 61 tokens/s for one stream. vLLM goes into its own uv venv because the default template pins its own torch.

lium up --gpu RTX4090 --name vllm --ttl 2h -y --no-ssh
lium exec vllm 'uv venv -q /root/vllm-env && uv pip install -q --python /root/vllm-env vllm'
export VLLM_API_KEY=$(openssl rand -hex 16)
lium exec vllm -d --log /root/vllm.log -e VLLM_API_KEY=$VLLM_API_KEY \
'/root/vllm-env/bin/vllm serve Qwen/Qwen2.5-7B-Instruct --host 127.0.0.1 --port 8000 --max-model-len 8192'
lium exec vllm 'tail -n 5 /root/vllm.log' # wait for "Application startup complete"
$(lium describe vllm --json | python3 -c 'import json,sys; print(json.load(sys.stdin)["access"]["ssh_cmd"])') \
-N -L 8000:127.0.0.1:8000 & # tunnel: laptop 127.0.0.1:8000 -> the pod
curl http://127.0.0.1:8000/v1/models -H "Authorization: Bearer $VLLM_API_KEY"

More: vLLM server (SDK) · Templates

Rent the cheapest GPU that fits a spec under a price ceiling​

One API call picks the cheapest node that meets every constraint and rents it; dry_run: true returns the pick and price without renting.

curl -X POST https://lium.io/api/executors/rent-by-spec \
-H "X-API-Key: $LIUM_API_KEY" -H "Content-Type: application/json" \
-d '{"gpu_type": "H100", "gpu_count": 1, "min_vram_gb": 79, "max_price_per_gpu_hour": 2.5,
"termination_hours": 4, "pod_name": "spec-pod", "dry_run": true,
"user_public_key": "'"$(cat ~/.ssh/id_ed25519.pub)"'"}'

The same from Python: Lium().rent(gpu_type="H100", max_price_per_gpu_hour=2.5, dry_run=True). From the shell, lium ls --gpu H100 --max-price 2.50 shows what fits and lium up --gpu H100 rents the cheapest match.

More: Rent by spec · Error codes

Multi-node training​

Rent whole nodes on one InfiniBand or RoCE fabric as a single all-or-nothing cluster, with launcher config printed for you.

lium clusters # fabrics with free nodes
lium clusters up 1 --nodes 2 --name job --ttl 12h -y
lium clusters show job --hostfile # mpirun / DeepSpeed hostfile
lium clusters show job --torchrun 0 # torchrun rendezvous flags for rank 0
lium clusters rm job -y # remove every member

More: Multi-node clusters · lium clusters

Control spend​

lium up --gpu H100 --ttl 6h --budget 25 -y # removed after 6 h or at $25, whichever comes first
lium spend # hourly burn, spend per pod, runway
lium schedules list # every pod with a scheduled removal

Give each agent or job its own API key with server-enforced USD budgets (daily, monthly, lifetime); a rent past a budget is refused with 402 API_KEY_BUDGET_EXCEEDED:

curl -X POST https://lium.io/api/keys -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{"name": "agent-1", "scopes": ["read", "rent"], "daily_budget_usd": 20, "monthly_budget_usd": 300}'

More: API keys · Billing · Scheduled termination