Keentune

Building with LLMs, oriented

10 chapters
·
about 17 min read
·
free
This skill is about building software on top of a large language model (LLM) — a model trained on text that generates a response one piece at a time. Almost everything you control lives in one place: what you put in front of the model, and what you do with what comes back. The recurring surprise is that the model is a stateless, probabilistic component in an otherwise ordinary system, and most bugs come from treating it as either a database or a person.
Each chapter opens with the short version. Tap one to read the detail.
Prediction, not recall — and why that produces hallucination
~2 min
The model predicts a likely continuation, one token at a time. Nothing in that process distinguishes a remembered fact from a fluent guess, which is why hallucination is a property of the mechanism rather than a bug in a particular answer.
Tokens, and the context window as a shared budget
~2 min
The model reads and writes tokens, not characters, and the context window is a working budget that everything shares — system prompt, history, tool definitions, documents, and the response itself. More context is not automatically better.
The Messages API surface, and why identical requests differ
~2 min
A request is a list of alternating user and assistant turns plus a separate system parameter. The API is stateless: the conversation exists only because you resend it every time. Output is sampled, so identical requests do not return identical text — and on current models the knobs that used to shape that sampling are gone.
Prompt caching, and the byte-for-byte prefix it needs
~2 min
Prompt caching stores a prefix of your request so repeated calls skip reprocessing it. It only pays off when the cached part is genuinely identical, byte for byte, across requests.
Measure before you reword, and what an eval actually is
~3 min
Prompt engineering is optimization, and optimization without measurement is guessing. Define what success means and build a way to test it before you start rewriting wording — an evaluation is that test, made repeatable, and volume with automated grading beats a handful of hand-read examples.
Tool use, function calling, and what MCP standardizes
~3 min
Tool use does not let the model run code. The model emits a structured request naming a tool and its arguments; your application executes it and sends the result back. Everything downstream follows from that split — including the Model Context Protocol, which standardizes the wiring rather than adding a capability.
The agent loop, and the parts that are not the model
~2 min
An agent is the tool loop run to completion: the model plans, calls tools, reads results, and decides when it is done. The hard parts are not the model — they are the loop's stopping conditions, permissions, and context growth.
Retrieval-augmented generation, and the embeddings behind the search
~3 min
Retrieval-augmented generation means fetching relevant material at request time and putting it in the context window. The model does not reach out and retrieve anything — your code does, before it asks. Embeddings are how that search finds meaning rather than keywords, and they come from a separate vendor.
Two threats: the adversarial user, and the poisoned document
~2 min
There are two distinct threats. In one the user is the adversary; in the other the user is fine and the danger arrives inside content the model reads on their behalf. The second is the one that surprises people building agents.
Rate limits, retries, and the wait time the error hands you
~2 min
Limits are enforced per minute on requests, input tokens, and output tokens. Exceeding one returns an error carrying a wait time — and honouring that number is most of what production reliability requires.
Sign in to track your reading progress
See the full AI & LLMs curriculum
Written by Keentune. We are not affiliated with or endorsed by the organizations whose documentation informs this guide, and any linked sources belong to their respective owners.
Also on your phone
All exam, test, and product names and trademarks are the property of their respective owners and are used here for identification and reference only. Keentune is independent study practice — not affiliated with, authorized, or endorsed by any of these organizations.
© 2026 SportaApp LLC