LLM 101
A concept lab for engineers: how LLM applications work from prompt to reply. Offline-first Python exercises with pytest. No API key required for the core path.
What you will learn
- Tokens and the loop – context grows one token at a time; stop conditions matter.
- Fake inference – a deterministic FakeLLM with the same complete() shape as a live client.
- Tool catalogue – the model proposes calls; your app validates and executes them.
- RAG – retrieve docs, pack them into the prompt, then answer.
- Eval harness – fixed cases and checkers; pytest is the regression suite.
- Optional live API – same interface via OpenAI when OPENAI_API_KEY is set (skipped in CI otherwise).
Quick start
git clone https://github.com/iammikek/llm-101.git
cd llm-101
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
pytest
Core tests pass with no secrets. Design rule: the model never executes tools; the lab Agent does.