Skip to content

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 price

Module 1How LLMs Work

4 lessons

Tokens, embeddings, attention and next-token prediction — the mechanics that explain almost every LLM behaviour.

  1. 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.

    Free · read nowRead the lesson Simulation inside
  2. Next-Token Prediction and Sampling

    16 min

    Temperature, top-p, and why the same question gets different answers.

    Included with the track Simulation inside
  3. Context Windows and Token Costs

    14 min

    Counting tokens, estimating cost, and what happens when the context fills up.

    Included with the track
  4. Choosing a Model

    14 min

    Quality, latency, price and context limits — how to weigh them for a real product.

    Included with the track

Clear instructions, examples, step-by-step reasoning and structured output — proven techniques, no incantations.

  1. Clear Instructions and Roles

    14 min

    Writing a prompt like a brief for a brilliant new colleague with no context.

    Included with the track
  2. Few-Shot Examples

    14 min

    Choosing examples that teach the pattern rather than get copied verbatim.

    Included with the track Simulation inside
  3. Reasoning and Chain-of-Thought

    14 min

    When asking the model to think step by step helps, and when it only adds tokens.

    Included with the track
  4. Structured Output

    16 min

    JSON, schemas and validation so model output can be consumed by code.

    Included with the track

Module 3Context Engineering

4 lessons

What goes into the context window, where it comes from and in what order — the core skill of building LLM applications.

  1. What Goes in the Context

    14 min

    Instructions, data, examples, history and tools — assembling context as a design.

    Included with the track
  2. Retrieval-Augmented Generation (RAG)

    22 min

    Chunking, embedding, search and reranking — and how to tell whether retrieval works.

    Included with the track Simulation inside
  3. Long-Context Pitfalls

    14 min

    Lost in the middle, distraction, and when summarising beats including everything.

    Included with the track Simulation inside
  4. Memory and Conversation State

    14 min

    Trimmed history, running summaries, and long-term memory you can audit.

    Included with the track

Module 4Building with LLM APIs

4 lessons

Calling APIs, streaming, tool calling, caching, and keeping cost and latency under control in production.

  1. Your First API Call

    16 min

    One 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 inside
  2. Tool Calling

    20 min

    The 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 inside
  3. Cost, Latency and Caching

    16 min

    An 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 inside
  4. Retries and Rate Limits

    14 min

    The 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

Eval sets, LLM-as-judge and regression tests for prompts — replacing "looks good to me" with a number.

  1. Building an Eval Set

    16 min

    An 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 inside
  2. LLM as a Judge

    15 min

    A 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 track
  3. Regression-Testing Prompts

    13 min

    A 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

Hallucination, prompt injection and guardrails — the risks to understand before an LLM app meets users.

  1. Hallucinations and Grounding

    15 min

    A 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 inside
  2. Prompt Injection

    16 min

    The 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 inside
  3. Guardrails and Monitoring

    14 min

    A 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