Lab — Build Your Inference Engineering Setup
This is the course's first lab. A lab is a mission with proof: a sequence of stages, each ending in a gate, a check whose output you record. Passing every gate leaves you with an artifact that meets the standard introduced in levels of inference engineering: a pinned environment and a repeated result.
Your mission: connect your laptop to a remote GPU, verify the setup, and document how to reconnect. You'll use this same setup to run your first LLM, starting by downloading a model.
The deliverable
One file, setup.md, kept next to your requirements.txt. The stages below fill it in; the finished record looks like this (values representative):
Six lines is the whole artifact, every one copied from a command's output.
Stage 1: the local workspace
On your laptop, build the environment from Python & PyTorch for inference: a fresh venv, torch installed, versions frozen.
Gate. python -c "import torch; print(torch.__version__)" prints a version, and requirements.txt exists. Record the version.
Stage 2: the box
Follow the remote GPU setup guide to rent a machine with enough disk for tens of gigabytes of weights and hourly billing. Choose one modest GPU with compute capability 8.0 or newer using the GPU compatibility guide. Wire up the key and the ~/.ssh/config alias.
Gate. From your laptop, one command reaches the GPU through the alias:
The header prints. Record the driver version, the GPU name, and the memory figure in MiB. If nvidia-smi is missing, the image has no driver, and the fastest fix at learning scale is switching to an image that ships one.
Stage 3: sessions and transfer
On the box, start the tmux session everything will live in, and prove a file can travel.
Gate. Disconnect entirely, reconnect, and tmux attach -t lab restores your session with lab/requirements.txt present. The disconnect is part of the gate: the session must outlive the connection that started it.
Stage 4: GPU-visible PyTorch
Inside the tmux session, repeat stage 1 on the box, choosing the wheel using the GPU compatibility guide, then run the check:
Gate. True, a runtime version that is not None, the card's name, and a capability of (8, 0) or higher for BF16 support. Record all four. This is the stage where the CPU-wheel trap surfaces; on a CPU-only wheel the last line errors out, and the False above it is the answer. If it does, use the decision tree in the GPU compatibility guide linked above. The gate does not pass until the box itself printed True.
Stage 5: the forwarded port
Start anything that listens on the box; Python ships a one-liner:
Gate. The curl returns a directory listing from the box. Your laptop just talked to a service on the GPU machine through the tunnel. When you run your first LLM, you'll use this tunnel to reach the model server.
The repeat
The last gate is the one that makes it engineering. Close every terminal. From setup.md, your key, and the ssh config it names, reconnect, reattach the lab session, and re-run stage 4's check; it must print the same four values you recorded. That is the repeated result your setup record needs to demonstrate. Then stop the instance; keep the record for your next session.
Your setup is ready: every prerequisite is now a recorded fact about a machine you can reconnect to.