Lessons
LLMs, Prompt Engineering & Context Engineering: all lessons
How LLMs work, how to instruct them, and how to fill their context.
6 modules · 22 lessons · 1 free to read now
About this track: outcomes, tools and priceModule 1How LLMs Work
4 lessonsTokens, embeddings, attention and next-token prediction — the mechanics that explain almost every LLM behaviour.
Your prompt is cut into tokens, turned into vectors, and then every token decides which other tokens matter. Those three steps explain why good prompts work.
Next-Token Prediction and Sampling
16 minTemperature, top-p, and why the same question gets different answers.
Included with the track Simulation insideContext Windows and Token Costs
14 minCounting tokens, estimating cost, and what happens when the context fills up.
Included with the trackChoosing a Model
14 minQuality, latency, price and context limits — how to weigh them for a real product.
Included with the track
Module 2Prompt Engineering Fundamentals
4 lessonsClear instructions, examples, step-by-step reasoning and structured output — proven techniques, no incantations.
Clear Instructions and Roles
14 minWriting a prompt like a brief for a brilliant new colleague with no context.
Included with the trackFew-Shot Examples
14 minChoosing examples that teach the pattern rather than get copied verbatim.
Included with the track Simulation insideReasoning and Chain-of-Thought
14 minWhen asking the model to think step by step helps, and when it only adds tokens.
Included with the trackStructured Output
16 minJSON, schemas and validation so model output can be consumed by code.
Included with the track
Module 3Context Engineering
4 lessonsWhat goes into the context window, where it comes from and in what order — the core skill of building LLM applications.
What Goes in the Context
14 minInstructions, data, examples, history and tools — assembling context as a design.
Included with the trackRetrieval-Augmented Generation (RAG)
22 minChunking, embedding, search and reranking — and how to tell whether retrieval works.
Included with the track Simulation insideLong-Context Pitfalls
14 minLost in the middle, distraction, and when summarising beats including everything.
Included with the track Simulation insideMemory and Conversation State
14 minTrimmed history, running summaries, and long-term memory you can audit.
Included with the track
Module 4Building with LLM APIs
4 lessonsCalling APIs, streaming, tool calling, caching, and keeping cost and latency under control in production.
Your First API Call
16 minOne endpoint, one request shape: messages, roles and parameters — then streaming so the user is not staring at a blank screen.
Included with the track Simulation insideTool Calling
20 minThe model runs nothing: it asks, your code executes, and the result goes back. Understanding that division of labour is the whole of tool-calling safety.
Included with the track Simulation insideCost, Latency and Caching
16 minAn LLM bill is dominated by input tokens sent over and over. Prompt caching, a trimmed context, batching, and a model that is good enough — in that order.
Included with the track Simulation insideRetries and Rate Limits
14 minThe API will slow down and occasionally fail. An app that survives knows which errors to retry, waits with backoff and jitter, limits concurrency, and has a fallback.
Included with the track Simulation inside
Module 5Evaluating LLM Applications
3 lessonsEval sets, LLM-as-judge and regression tests for prompts — replacing "looks good to me" with a number.
Building an Eval Set
16 minAn eval set is your own traffic, chosen deliberately, with criteria code can check — not the three questions you tried before shipping.
Included with the track Simulation insideLLM as a Judge
15 minA model can grade another model's answers — provided the rubric is narrow, the biases are known, and its agreement with humans has been measured with kappa, not a bare percentage.
Included with the trackRegression-Testing Prompts
13 minA prompt is code without a compiler. Put it in the repository, run the eval set on every change, and block the release when cases that used to pass now fail.
Included with the track
Module 6LLM Safety and Reliability
3 lessonsHallucination, prompt injection and guardrails — the risks to understand before an LLM app meets users.
Hallucinations and Grounding
15 minA model picks the most plausible token, not the truest one. The cure is not asking it to "not make things up" but putting the source in context, requesting checkable quotes, and allowing "not found".
Included with the track Simulation insidePrompt Injection
16 minThe model reads your instructions and a product review through the same channel: tokens. When data contains commands, no prompt can separate them — what can is an architecture that limits the damage.
Included with the track Simulation insideGuardrails and Monitoring
14 minA guardrail is code that checks inputs and outputs without trusting the model. Monitoring is what tells you quality has dropped — before users do.
Included with the track Simulation inside