What local AI means
Local AI means the model runs on hardware you control. That hardware can be a laptop, an RTX desktop, a workstation or a DGX Spark. Hybrid AI adds a cloud model for the hardest requests.
| Why local | What it means in practice |
|---|---|
| Privacy and data control | Documents, code and voice never leave the device. This is often the deciding factor for enterprises and creators. |
| Latency | No network round trip, so a speech or agent loop can respond in tens of milliseconds. |
| Cost | Hardware is already paid for, with no per-token bill, which matters for agents that call a model thousands of times. |
| Availability | Works offline, on planes, in factories and air-gapped labs. |
| Control | Pin a model version, fine-tune it, swap the runtime, and inspect everything. |
Your hardware sets the limit. For this reason the hardware chapters (2–5) come before the software chapters (6–11).
The four numbers that decide everything
Four hardware numbers answer almost every local AI question.
- Memory capacity (GB). Does the model fit, with its KV cache?
- Memory bandwidth (GB/s). This sets tokens per second when the model writes.
- Compute (TFLOPS). This sets time to first token.
- Interconnect (PCIe, NVLink). This sets the cost of moving data between memories.
| Device | Memory | Bandwidth | Kind | Note |
|---|---|---|---|---|
| GeForce RTX 4060 | 8 GB | 272 GB/s | discrete | previous generation |
| GeForce RTX 4090 | 24 GB | 1,008 GB/s | discrete | previous generation |
| GeForce RTX 5060 Ti 16GB | 16 GB | 448 GB/s | discrete | 128-bit GDDR7 |
| GeForce RTX 5070 | 12 GB | 672 GB/s | discrete | 192-bit GDDR7 |
| GeForce RTX 5070 Ti | 16 GB | 896 GB/s | discrete | 256-bit GDDR7 |
| GeForce RTX 5080 | 16 GB | 960 GB/s | discrete | 256-bit GDDR7 |
| GeForce RTX 5090 | 32 GB | 1,792 GB/s | discrete | 512-bit GDDR7 |
| GeForce RTX 5090 Laptop | 24 GB | 896 GB/s | discrete | 256-bit GDDR7, the top AI laptop part |
| RTX PRO 4000 Blackwell SFF | 24 GB | 432 GB/s | discrete | low-profile, 70 W, 192-bit GDDR7 ECC; the GPU in Ghost Core |
| RTX PRO 6000 Blackwell | 96 GB | 1,792 GB/s | discrete | workstation, 512-bit GDDR7 ECC |
| DGX Spark (GB10) | 128 GB | 273 GB/s | unified | Grace Blackwell desktop, LPDDR5x, 1 PFLOP sparse FP4 |
| DGX Station (GB300) | 252 GB | 7,100 GB/s | unified | 252 GB HBM3e at 7.1 TB/s + 496 GB LPDDR5X at 396 GB/s, 748 GB coherent |
| Apple M4 (base) | 32 GB | 120 GB/s | unified | the Mac this course was written on |
| Apple M4 Max | 128 GB | 546 GB/s | unified | |
| H100 SXM | 80 GB | 3,350 GB/s | datacenter | HBM3, for contrast; see Chapter 15 |
| Dual-channel DDR5-5600 | 96 GB | 90 GB/s | host | a typical desktop CPU's RAM |
How to read this table. An RTX 5090 and an RTX PRO 6000 Blackwell have the same bandwidth, so they give the same tokens/s on a model that fits both. The PRO card fits 3× more. DGX Spark holds 4× the 5090's memory but only about 1/6.5 of its bandwidth. It runs bigger models, more slowly. Chapter 4's tank rack shows this.
Check your machine
One lab shows what your machine can run. It looks for Ollama, llama.cpp and LM Studio.
Lab · runs on your own machine
uv run labs/00_check_machine.pyDownload all labs (.zip)Needs uv and, for the live parts, Ollama with a small chat model: ollama pull qwen3:0.6b.
Show the code
# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
import _local as local
import platform, shutil, subprocess
print("OS:", platform.platform())
print("Python:", platform.python_version())
for tool in ["ollama", "llama-server", "llama-cli", "lms", "nvidia-smi"]:
print(f"{tool:>13}:", shutil.which(tool) or "not found")
try:
import torch
print("PyTorch", torch.__version__, "| CUDA:", torch.cuda.is_available(), "| MPS:", torch.backends.mps.is_available())
except ImportError:
print("PyTorch not installed")
print("Installed Ollama models:", [m["name"] for m in local.models()])
Sample output on this course's Mac (Apple M4, 32 GB)
OS: macOS-26.6.2-arm64-arm-64bit
Python: 3.11.15
ollama: /opt/homebrew/bin/ollama
llama-server: /opt/homebrew/bin/llama-server
llama-cli: /opt/homebrew/bin/llama-cli
lms: /Users/mpl/.lmstudio/bin/lms
nvidia-smi: not found
PyTorch not installed
Installed Ollama models: ['qwen3:0.6b', 'nomic-embed-text:latest']The journey
Every chapter has the same parts. Each one has a figure, the math, a lab, playgrounds, an "Explain it" drill and exercises.
| Stage | Chapters | You will be able to… |
|---|---|---|
| Novice | 0–1 | explain what happens between pressing Enter and seeing tokens |
| Practitioner | 2–5 | size any model for any GPU from first principles, and choose a quantization |
| Builder | 6–9 | pick formats and runtimes, serve many users, and tune a configuration |
| Expert | 10–11 | reason about MoE, multi-GPU, unified memory, RAG and agent workloads |
| Master | 12–15 | benchmark honestly, build your own personal AI box, route between local and cloud through one socket (LiteLLM), and compare it with datacenter GPUs |
Explain it
- What is local AI? The model runs on your own hardware. You gain privacy, low latency and no per-token cost.
- What is the stack on an RTX PC? App, agent layer, runtime (Ollama, llama.cpp), model file (GGUF), kernels, CUDA, GPU with VRAM.
- Which spec matters most? VRAM capacity decides if a model runs. Bandwidth decides how fast it writes (Chapter 3).
Exercises
- Pick three devices from the table and name the largest 4-bit model for each.
- Place five local AI apps on the stack map.