Skip to content

Setup

Three tools, then a checkpoint. If you already have any of them, skip ahead.

uv manages Python versions, project environments, and packages — one tool instead of three.

Terminal window
brew install uv

(Linux: curl -LsSf https://astral.sh/uv/install.sh | sh)

Verify it:

Terminal window
uv --version

Any version number is a pass. Get in the habit: install, then verify. It turns silent failures into obvious ones.

Terminal window
mkdir -p ~/agent-course && cd ~/agent-course
uv init --python 3.12
uv add ollama

uv init creates a project with its own isolated environment — your system Python is never touched. uv add ollama installs the one package this course needs: the client library for talking to a local model server.

You’ll run every file in this course with uv run <file> — no virtual-environment activation, no pip, nothing to remember.

Ollama runs open-source language models on your own machine. No account, no API key, no per-call cost.

Terminal window
brew install ollama
brew services start ollama
ollama pull qwen2.5:3b

The pull downloads about 2GB — a few minutes. qwen2.5:3b is a small model by today’s standards, and that’s deliberate: it’s free, it runs on a laptop, and its mistakes are visible, which is exactly what you want while learning how the machinery works.

Terminal window
ollama run qwen2.5:3b "Explain what a while loop does in one sentence."

If a sentence streams back, everything works. That text was generated on your machine — nothing left it, nothing was billed.

One thing worth noticing before you move on: the answer arrives word by word. That’s not a UI effect. The model genuinely produces one token at a time, each conditioned on everything before it. A language model is a machine that predicts what text comes next — everything in this course is built on top of that single primitive.

Step 1 — prove the model can’t know your data →