01Chapter 1: How a language model turns a prompt into textThis chapter assumes you can read basic Python, know what JSON is, and have used a chatbot or AI assistant. You do not need any machine learning background. Later chapters build on the working model described here.6 min read
02Chapter 2: What you can build: a map of application typesThis chapter gives you a map of the main LLM application patterns. Later chapters cover each pattern in detail. Here you learn to look at a product idea and name the pattern it needs.5 min read
03Chapter 3: What models get wrong and whyThis chapter covers the failure modes you will meet in almost every LLM feature: hallucination, nondeterminism, context limits, and a few quieter problems. It assumes you have read the chapter on how a model turns a prompt into text. You should also be comfortable with Python and JSON. The goal is a6 min read
04Chapter 4: Writing prompts that give reliable resultsThis chapter assumes you can write basic Python, read JSON, and have called a text model API at least once. It also assumes you know that a model generates text one piece at a time (the "How a language model turns a prompt into text" chapter). Here you will learn how to write prompts that behave the5 min read
05Chapter 5: Summarizing, rewriting, translating, and draftingThis chapter covers the four text-to-text tasks that most LLM products start with. It assumes you can call a model through a complete(prompt) function, as in the earlier chapters on prompting. It also assumes you know that a model has a limited context window and can produce wrong statements with 5 min read
06Chapter 6: Classifying text and extracting fieldsClassification and extraction are the most dependable things an LLM does in production. Both turn free text into a small, predictable value that code can act on. This chapter covers prompt design, validation, and the errors that show up once real data arrives.4 min read
07Chapter 7: Getting structured output you can trustA language model produces text. Your program usually needs data: a dictionary, a database row, an argument for a function. This chapter covers how to turn model text into data your code can rely on. It assumes you can write basic Python, read JSON, and have seen the classification prompt pattern fro4 min read
08Chapter 8: Building conversational assistantsA conversational assistant is an application that carries on a multi-turn dialogue with a user and answers each message in light of what came before. This chapter covers the working model, context management, and the errors that show up most often. It assumes you know basic Python, JSON, and HTTP AP5 min read
09Chapter 9: Code generation and review helpersThis chapter assumes you have read the chapters on prompting and on structured output, and that you can write basic Python and run it from a terminal. It covers coding helpers built on a language model. These are tools that write, explain, review, and modify source code.4 min read
10Chapter 10: Working with images, audio, and documentsThis chapter covers multimodal features: applications where the model reads or produces something other than plain text. It assumes you can write basic Python, call a model API, and read JSON. You should also be comfortable with the prompting and structured-output ideas from earlier chapters.6 min read
11Chapter 11: Embeddings and semantic searchThis chapter assumes you can read Python, work with lists and dictionaries, and call an HTTP API. You should also know what a prompt is and how a model turns text into text. No linear algebra beyond "a vector is a list of numbers" is needed.6 min read
12Chapter 12: Answering from your own documents with retrievalRetrieval-augmented generation (RAG) lets a model answer questions from documents it was never trained on. Your program finds the relevant passages and puts them in the prompt. The model then writes an answer based on that text.4 min read
13Chapter 13: Letting models call tools and APIsA language model only produces text. It cannot check the weather, query your database, or send an email. Tool use (also called function calling) closes that gap. The model writes a structured request, and your program carries it out. This chapter covers the working model, a runnable dispatcher, vali5 min read
14Chapter 14: Agents: loops of reasoning and actionThis chapter assumes you have read the chapters on structured output and tool use. You should be comfortable with Python, JSON, and the idea that your code, not the model, executes tools. Here you will build the loop that turns a single tool call into a multi-step workflow, and learn where that loop5 min read
15Chapter 15: Testing and evaluating LLM featuresThis chapter assumes you can write basic Python, read JSON, and have seen the earlier chapters on prompting, classification, and structured output. It covers how to tell whether an LLM feature works, how to catch regressions when you change a prompt or model, and the mistakes teams make most often w6 min read
16Chapter 16: Prompting, retrieval, or fine-tuning: choosing the fixThis chapter assumes you can read basic Python and know the earlier chapters' ideas: prompts, context windows, hallucination, embeddings, retrieval-augmented generation (RAG), and test-case evaluation. It covers how to decide which lever to pull when an LLM feature gives bad results.5 min read
17Chapter 17: Managing cost and latencyThis chapter assumes you can call a model API from Python, read JSON, and have seen the prompting, retrieval, and tool-use chapters. It covers where the money and the waiting time go in an LLM feature, and the usual ways to reduce both without hurting quality.5 min read
18Chapter 18: Safety, privacy, and prompt injectionThis chapter assumes you have read the chapters on limitations, tool use, and retrieval. You should be comfortable with Python, JSON, and the idea that a model's reply is text your code must treat with care.7 min read
19Chapter 19: Scoping your first LLM projectThis chapter assumes you have read the earlier chapters on application patterns, prompting, evaluation, and the cost and safety trade-offs. It pulls them into one decision process. You should be comfortable with Python, JSON, and calling a model API.6 min read