LLM Primitives
The raw building blocks: models, prompts, structured outputs, tool calls, retrieval, context windows, and routing.
- Learn the pieces before agents: prompts, structured outputs, tool calls, retrieval, routing.
- A context window is capacity, not knowledge.
- Structured output is the handle that lets software safely grab model work.
- Strong models reduce orchestration needs but never eliminate them.
Module 2: LLM Primitives
The on-ramp covered the plain versions of these. This chapter makes them precise and adds the rest.
Learn the pieces before the agent talk starts. Model capability versus cost versus latency. Prompt structure. Structured outputs. Function and tool calling. Retrieval. Context windows. Token budgets. Knowledge sources versus selected context versus retained memory. Summarization and compaction. Model routing. Multimodal inputs. Computer and browser use.
Build a one page model routing table covering:
- a cheap model
- a strong reasoning model
- a coding model
- a vision model
- a browser or computer use model
Write a structured output prompt that returns validated JSON. Then keep a failure log. Did the model misunderstand the task? Did it invent context? Did it choose the wrong tool?
Why Capacity Is Not Knowledge
A context window includes everything sent to the model in a single call. The system prompt counts. Every message counts. Every tool result counts. Every attached document counts. The model's own output counts too including any extended thinking. All of it draws against the same budget.
A larger window does not fix poor context selection. A model given a huge pile of loosely relevant material will often underperform a model given a small window with exactly the right few paragraphs. Every added token still has to be read and weighed. Irrelevant content carries a real cost even when it technically fits.
An agent with a bigger context window still needs a real retrieval step. Bigger capacity does not replace good selection.
Why Structured Output Matters
An unconstrained response to "is this ticket urgent" might read like this: "Yes this looks fairly urgent to me." That still needs parsing before software can act on it. Parsing free text reliably is hard.
A schema constrained response returns {"urgent": true} instead. The output can be validated and consumed directly. No regex. No guessing. That is the real value of structured output. It turns a judgment call into a value a program can rely on.
Strong models reduce orchestration needs. They do not eliminate them. A context window is capacity. It is not knowledge. Useful context still has to be selected. It has to be grounded. It has to be kept current. Structured output is not boring. It is the handle that lets software safely grab model work.