Building LLM Applications
Tokens, context windows, prompting, structured outputs and function calling
Understand LLMs from the inside out: tokenisation, context windows, prompting, structured outputs, function calling, streaming and multimodal inputs. The foundation for everything generative.
Who this series is for
This series is for engineers who can build a normal web service and now need to put a language model inside one. It assumes comfort with Python and HTTP APIs and no prior machine-learning background. The goal is a working mental model of what an LLM actually does with your input, because nearly every production problem (cost overruns, truncated answers, invalid JSON, inconsistent behaviour) traces back to a gap in that model.
What each chapter covers
- LLM Fundamentals explains tokens, context windows, sampling parameters and pricing in terms you can act on, such as estimating the cost of a request before you send it.
- Prompt Engineering treats prompts as code: versioned, tested, and structured with clear instructions, examples and output contracts rather than tweaked by feel.
- Streaming & Structured Outputs covers server-sent events for responsive interfaces, and schema-constrained outputs so downstream code can trust what the model returns.
- Local & Open-Source Models covers when running a model yourself makes sense, what hardware it takes, and the quality and latency trade-offs against hosted APIs.
- Fine-Tuning Fundamentals explains what fine-tuning is good for (format, tone, narrow tasks) and what it is not (adding knowledge, which is usually a retrieval problem).
How to approach it
Read the chapters in order, since each builds on the vocabulary of the last. Keep an API key and a small script open while you read. Changing a parameter and watching the output change teaches more than any explanation. Budget about eight hours in total.
Skills you'll gain
Prerequisites
Chapters
Tokens, context windows, model APIs, pricing and the mental model every AI engineer needs.
Structure, few-shot, structured outputs and function calling. Prompts are code — version them.
SSE streaming, incremental JSON parsing, and reliable structured output at production scale.
Ollama, LM Studio, Hugging Face, Llama, Mistral, Gemma, Qwen — when and how to self-host models.
LoRA, QLoRA, full fine-tuning, when to fine-tune vs RAG, and the economics of customisation.