25 side-by-side comparisons of the concepts interviewers ask about most. Understand the tradeoffs, know when to use what, and never confuse the two again.
API providers give you the best models with zero ops. Self-hosting gives you data control, custom fine-tunes, and predictable cost past a break-even volume, usually 10 to 50 million tokens per day.
Distillation shrinks the architecture (fewer parameters); quantization shrinks each parameter's bit count. They attack different axes of size and stack cleanly. QLoRA is quantization plus adapter fine-tuning.
Hallucination is a correctness problem and context window a capacity one; in RAG you tune retrieval to solve both at once, ground the answer without overflowing the prompt.
KV cache reuses attention within a single generation; prompt caching reuses that cache across separate requests that share a prefix. Both attack the same waste from different angles.