Foundations

AI Development — Foundations — the first course, and the place to start. Build from a raw HTTP request up through sampling, tools, sandboxing, embeddings, RAG, and agents. Work through the sections in order; each is self-contained, with a goal, runnable code, and a reference implementation under examples/.

01 Hello World Goal: write, by hand, your first two programs that talk to a language model — one using raw HTTP, one using the official SDK — and build the right … 02 Anatomy of a Response Goal: before turning any knobs, get comfortable with what the server returns. You’ll write a small script that prints a whole response and pulls it … 03 Chat Templates & Harmony Goal: make the chat template concrete — the per-model step that turns your clean messages list into the single string of tokens the model actually … 04 Tokens & the Context Window Goal: make the word “token” concrete by measuring it yourself — through the server, no local tokenizer — then turn it into the most important … 05 Sampling Parameters (Seeing the Effect) Goal: understand the knobs that control how the model chooses each word — and watch them work by writing the experiments yourself. By the end you’ll … 06 Reasoning / "Thinking" Models Goal: open up the thing gpt-oss-120b has been doing since Section 1 — thinking before it answers. You’ll write scripts that reveal the model’s private … 07 Handling & Validating Responses (Structured Output) Goal: stop treating model output as text you eyeball and start treating it as data your code can rely on. You’ll write scripts that go from “the model … 08 Blocking vs Streaming Goal: learn the two ways to receive a response — blocking (wait for the whole thing) and streaming (receive it token by token) — by building streaming … 09 Robustness: Errors, Retries, Rate Limits, Timeouts Goal: turn a script that works on a good day into one that survives a bad one. You’ll write the error-handling ladder and a retry-with-backoff helper, … 10 Observability & Logging Goal: make your LLM calls visible. You’ll write a small wrapper that emits one structured log record per call, capturing the telemetry the API already … 11 Cost, Pricing & Prompt Caching Goal: turn the token counts you’ve been logging into money, then write a demonstration of prompt caching — the single biggest lever for making … 12 Prompt Engineering Fundamentals Goal: learn the handful of prompt techniques that reliably move output quality — zero/one/few-shot examples, clear instructions, delimiters, and … 13 Conversation State & Memory Goal: understand that the API is stateless — it remembers nothing between calls — and build a multi-turn conversation yourself by keeping the history. … 14 Tool / Function Calling Goal: let the model call your code. You’ll define a tool, watch the model ask to use it (tool_calls), run the matching Python function, feed the … 15 The Tool-Use Loop Goal: turn the single tool round trip from Section 14 into a loop — call the model, run whatever tools it asks for, feed the results back, and repeat … 16 Sandboxing I: Why Isolate, and Portable Limits Goal: make executing untrusted actions safe. In Sections 14–15 the model chose which tools to run; for a calculator we stayed safe by parsing the … 17 Sandboxing II: Containers, Postgres & Production Isolation Goal: climb the isolation ladder from Section 16. Process limits cap CPU and memory but leave the filesystem and network open. A container closes that … 18 Model Context Protocol (MCP) Goal: understand MCP as the standard way to expose and consume tools — so a set of tools (and data sources) can live behind a server and be reused … 19 Embeddings Goal: turn text into vectors that capture meaning, and compare them by hand with cosine similarity. You’ll build a tiny semantic search — matching by … 20 Retrieval-Augmented Generation (RAG) Goal: make the model answer from your documents instead of its training data (or its imagination). You’ll build a small RAG pipeline end to end — … 21 Security & Guardrails Goal: understand the security problem that appears the moment your prompts contain text you didn’t write — prompt injection — and build practical … 22 Skills / Skill Injection Goal: understand skills — packaged units of instructions (and often code and resources) that are disclosed into the model’s context on demand — and … 23 Agents Goal: assemble the pieces you’ve built into an agent — the tool loop (Section 15) given a goal, a system prompt that makes it plan, and several tools … 24 Evaluation & Testing Goal: answer the question “is it actually any good — and did my change help or hurt?” You’ll build two complementary evaluators: golden tests for … 25 Capstone Goal: build one small, real application that ties the whole course together — a company support assistant that retrieves facts, uses tools, runs an …

When you finish, continue with Agent Memory , the follow-on course on cross-session memory.

Last modified June 17, 2026