LLM engineering at 2,000 ft¶
LLM application engineering is the craft of building dependable products on top of an undependable component. The model is a brilliant, probabilistic function you cannot inspect; everything in this track is about controlling what goes into it, constraining what comes out, giving it tools instead of trust, and measuring the result.
10,000 ft
The rest of this site explains how models are made: transformers learn to predict tokens, post-training turns them into assistants, and systems serve them. This track starts where the model becomes an API call. Since 2022, much of the AI that people actually use lives in this layer: support assistants, coding tools, search, analysts and agents are all ordinary software wrapped around a few model calls. The engineering problems are new in kind. The core component is stochastic, its failures are fluent and plausible, its behaviour shifts when the provider updates it, its inputs can be weaponised, and its cost is billed per token. Six ideas answer those problems: prompting (specify the task), structure (turn text into data), retrieval (supply the facts), tools and agents (let code act and compute), evals (know whether it works) and guardrails (keep it safe). They are the subject of this track, and Finny's own assistant, Jarvis, is the worked example that ties them together.
The whole track in one picture¶
Strip away the frameworks and every LLM application is the same program:
Read it as a list of the decisions you will make in every product:
| Decision | The question | Where it is taught |
|---|---|---|
| What does the model see? | Which instructions, examples, documents and state go into the context, in what order, within what budget? | Prompt engineering, RAG, context engineering |
| What shape comes out? | How do you turn free text into data a program can trust? | Structured outputs |
| Where do the facts come from? | Which knowledge is retrieved per question, and how do you find it? | Embeddings, RAG, advanced RAG |
| Who computes and who acts? | What should code do (calculate, fetch, write) rather than the model, and how does the model ask? | Tools, agents, MCP, multi-agent |
| Does it work? | How do you know a change made it better, before users find out? | Evals in practice |
| Is it safe? | What happens when inputs are hostile or outputs are wrong? | Guardrails and security |
| Can you afford to run it? | Latency, cost, model routing, caching, and a UX that survives errors | Shipping AI products |
The mental model to keep
Treat the model as a talented, fast, occasionally confabulating colleague who has never seen your company, cannot do arithmetic reliably, follows instructions literally, and will believe anything written in a document you hand them. You would brief them carefully (prompts), give them the right files (retrieval), ask for answers on a form (structure), let them use a calculator and the internal systems through approved channels (tools), check their work (evals and gates), and never let them wire money on a stranger's say-so (guardrails). Every page in this track is one of those habits made precise.
Principles that hold across the track¶
These recur on almost every page; learning them early saves rediscovering them in production.
- Code computes, the model explains. Numbers, dates, permissions and state changes belong in deterministic code; the model chooses what to compute and phrases the result. A large share of production failures come from asking a model to do arithmetic or bookkeeping it should have delegated.
- Evaluate before you optimise. A prompt or pipeline change without a fixed eval set is an anecdote. Build 50 real cases on day one; grow them from every failure.
- Context is a budget. Every token costs money and latency and competes for attention. More context is not better context.
- Structure at every boundary. Wherever model output feeds a program, constrain it to a schema and validate it in code.
- Untrusted in, untrusted out. User text, retrieved documents and tool results can all carry instructions; model output can be wrong. Authority lives in code, never in a prompt.
- Start with the simplest thing that could work. A single well-prompted call beats a chain; a fixed workflow beats an agent; one agent beats many, until an eval proves otherwise. Anthropic's Building effective agents makes the same argument from many customer deployments.
- Make failure graceful. A system that can say "I don't know", ask a clarifying question or refuse is safer and more trusted than one that always answers.
The worked example running through this track
Jarvis is the assistant in Finny's app: it answers questions about a member's own FIRE (financial independence) plan. It routes each question with one structured model call, has code fetch and compute the figures, lets a model phrase the answer from a labelled fact table, and runs a deterministic gate that checks every number before the reply leaves. Short "Finny" notes on several pages show one idea in that system; the case study puts them together, including what the team measured and what it learned the hard way.
The map of the track¶
Arrows mean "builds on". The first map is the capability path; the second is the discipline that applies to everything on the first.
How to work through this track¶
The track has three units. Each topic page takes about an hour to study properly (reading, running the code, answering the questions); plan on roughly 14–16 hours for the whole track, spread over a few weeks with something built between units.
- Unit 1: the building blocks (about 5 hours). Prompt engineering → structured outputs and function calling → embeddings and vector search → retrieval-augmented generation. After this unit you can build a grounded Q&A assistant that returns structured, cited answers.
- Unit 2: systems that act (about 5–6 hours). Advanced RAG → agents and tool use → MCP and tool protocols → multi-agent orchestration → context engineering and memory. After this unit you can build an agent that plans, calls tools and manages its own context.
- Unit 3: shipping (about 4–5 hours). Evals in practice → guardrails, prompt injection and security → shipping AI products → case study: Jarvis. After this unit you can measure, secure and run what you built.
If you are building something now, a faster route: prompt engineering, structured outputs, evals in practice, then whichever of RAG or agents your product needs, then guardrails. Evals early is the single habit that most separates teams that ship from teams that demo. Build alongside the reading with the RAG assistant and agent project.
Every page in the track¶
-
Prompts as conditioning: instructions with reasons, examples that teach the right thing, reasoning, long-context layout, caching, and the eval loop.
-
Structured outputs and function calling
Constrained decoding from the token mask up, its distortions, schema design, and the tool-calling protocol.
-
Contrastive embedders, similarity geometry, and the IVF, PQ and HNSW indexes that make search fast.
-
Retrieval-augmented generation
Ingest, chunk, retrieve, assemble, generate and evaluate; when to use RAG, long context, fine-tuning or tools.
-
Advanced RAG: hybrid search, reranking, graphs
Fusing keyword and dense retrieval, cross-encoder re-ranking, query planning and graph-based retrieval.
-
The agent loop, planning and reflection, workflows versus agents, and how to keep a loop bounded.
-
Multi-agent systems and orchestration
Orchestrator–worker patterns, hand-offs, parallel sub-agents, and when many agents beat one.
-
Context engineering and memory
Deciding what the model sees at every step: compaction, scratchpads, short- and long-term memory.
-
The Model Context Protocol: standard servers for tools, resources and prompts, and their security model.
-
Evals in practice: golden sets and LLM judges
Building eval sets from real traffic, code checks, calibrated LLM judges, and regression testing.
-
Guardrails, prompt injection and security
The threat model of LLM apps: direct and indirect injection, data exfiltration, and defences that do not rely on the model.
-
Shipping AI products: latency, cost, routing, UX
Streaming, caching, model routing, cost per task, observability, and interfaces that handle uncertainty.
-
Case study: how Jarvis is built
Finny's assistant end to end: routing, "code computes, the model explains", the number gate, evals and lessons.
LLM engineering in eight dates¶
| When | Event | Read |
|---|---|---|
| May 2020 | GPT-3 shows in-context learning: tasks specified by a prompt, no training | prompt engineering |
| May 2020 | Lewis et al. name retrieval-augmented generation | RAG |
| Oct 2022 | ReAct interleaves reasoning with tool calls, the template for agents | agents |
| Nov 2022 | ChatGPT makes the chat assistant a mass-market product | the assistant era |
| Jun 2023 | Function calling arrives in a major model API | structured outputs and tools |
| Aug 2024 | Schema-constrained structured outputs in a major API | structured outputs and tools |
| Sep 2024 | Reasoning models trained to think before answering reach developers | reasoning models |
| Nov 2024 | The Model Context Protocol is published as an open standard for tools | MCP |
Prerequisites from other tracks¶
You can start this track with little maths; it rewards more. Before or alongside unit 1:
- Large language models at 2,000 ft and tokenisation: what the model is and what a token costs.
- Decoding and sampling: temperature, top-p and why outputs vary.
- Instruction tuning: why a chat model follows a system prompt at all.
- Vectors and the geometry of meaning and embeddings: for the retrieval pages.
- Statistics for experiments and evals: for reading eval results without fooling yourself.
Helpful later: KV cache and efficient attention (prompt caching), serving LLMs (latency and cost), reasoning models and red-teaming.
The five best resources for this track¶
- AI Engineering — Chip Huyen, O'Reilly 2025. The most complete book on building applications on foundation models: evaluation, prompting, RAG, agents, fine-tuning, inference. The linked repository holds its supporting materials.
- What We've Learned From A Year of Building with LLMs — Eugene Yan, Bryan Bischof, Charles Frye, Hamel Husain, Jason Liu and Shreya Shankar, 2024. Tactical, operational and strategic lessons from six practitioners; read it twice, once now and once after unit 3.
- Building effective agents — Anthropic, December 2024. Workflows versus agents, the five common patterns, and why simplicity wins.
- Your AI Product Needs Evals — Hamel Husain. The case for, and a practical method of, evaluation-driven LLM development.
- Patterns for Building LLM-based Systems & Products — Eugene Yan, 2023. Evals, RAG, fine-tuning, caching, guardrails, defensive UX and feedback, each with its literature.
Where this leads¶
- Start the track: Prompt engineering.
- Want to build while you read? Pair unit 1 with the RAG assistant and agent project.
- Curious how the models behind the API are trained to follow prompts and call tools? See post-training at 2,000 ft.
- Thinking about risk and regulation for a real product? See governance and regulation.