Welcome to Book 9
From APIs to AI — LLMs, tokens, and context length.
In this book
- Explain how large language models generate text
- Budget with tokens and understand context windows
- Write system prompts and scope AI features safely
- Choose cloud LLM API vs self-hosted on Canadian infrastructure
Prerequisite: Book 8
LLM products are HTTP APIs that accept JSON message arrays and return generated text. You already know methods, headers, and server-side keys from Book 8. This book covers what goes inside those requests: tokens, context, prompts.
Workshop Co.
- Book 8 delivered
- Contact form → Rocket.Chat + Sheets via APIs
- Book 9 goal
- Public FAQ assistant — no hallucinated class dates
- Constraints
- ~$30/mo, Canadian privacy awareness, no PII in prompts
Core idea
AI is not magic — it is API + statistics + GPU time. Tokens are the meter; context is the workspace; the system prompt is the job description.
Before Chapter 2
In one sentence: what is the difference between training and inference?
Answer
Training builds the model once (vendor-scale). Inference is each chat request you pay for — what Workshop Co. runs.