LLM Engineering · lesson 1 of 27
Beginner
8Intermediate
11- 8 Structured Outputs in Production
- 9 LLM APIs and Provider Abstraction
- 10 LLM Tool Use and Function Calling
- 11 RAG — Retrieval-Augmented Generation
- 12 RAG: Advanced Retrieval and Reranking
- 13 LLM Embeddings and Vector Search
- 14 RAG Failure Diagnosis
- 15 Multimodal LLMs
- 16 LLM Context Engineering
- 17 Long-Context Economics and Prompt Caching
- 18 RAG vs. Fine-Tuning vs. Prompting
Advanced
8Also part of LLM Engineering
4LLM Engineering Learning Roadmap
A structured path from how a transformer actually works to building and serving production-grade LLM applications — internals, prompting, RAG, fine-tuning, inference, and safety.
By SkillByExample · Updated
Why LLM Engineering
LLMs are transforming software. Understanding how to build reliable, cost-efficient, and safe LLM applications — not just prompt a chatbot — is a high-value skill. The gap between a working demo and a production LLM system is large; this roadmap closes that gap, from how the model itself works up through serving it at scale.
Stage 1: Foundations (Week 1)
Goal: Understand what’s actually happening inside a model call, before treating it as a black box.
Topics:
- How an LLM Actually Works — tokens, embeddings, transformer blocks, attention, next-token probabilities
- Tokenization — byte-pair encoding, why languages cost different token counts, special tokens
- Inference and Decoding — temperature, top-k, top-p, repetition penalty, why temperature 0 isn’t “more certain”
- Pretraining, Instruction Tuning, and Alignment — why a base model and a chat model behave completely differently on the exact same weights
Milestone: Given a model’s logits for a prompt, correctly predict how greedy decoding, temperature=1.5, and top-p=0.9 would each change the output — then verify against real generated text.
Stage 2: API Fundamentals (Week 1-2)
Goal: Make reliable API calls, understand the message format, and control output quality.
Topics:
- Introduction to LLM Engineering — API basics, message roles, tokens, temperature, streaming
- Prompt Engineering — system prompts, few-shot examples, chain-of-thought, XML structuring
- Structured Outputs in Production — schema validation and a retry loop for when “return JSON only” doesn’t happen
- LLM APIs and Provider Abstraction — a common interface over multiple backends, with real timeout-and-fallback routing
Milestone: Build a document classifier that correctly categorizes 90%+ of a 100-document test set using a well-crafted system prompt and few-shot examples. Measure accuracy, not just “it looks right.”
Stage 3: Tools and Retrieval (Weeks 2-3)
Goal: Give models access to external tools and knowledge bases, and know how to fix retrieval when it’s wrong.
Topics:
- Tool Use — tool definitions, parallel calls, error handling, multi-turn tool use
- RAG — Retrieval-Augmented Generation — chunking, embeddings, vector search, source attribution
- Embeddings — similarity search, clustering, semantic deduplication
- RAG: Advanced Retrieval and Reranking — hybrid search, cross-encoder reranking, multi-query retrieval
- RAG Failure Diagnosis — bad chunking, stale documents, context overload — diagnosed, not just described
- Multimodal LLMs — sending images and documents to a model, with a real cross-modal matching example
Milestone: Build a RAG chatbot over a 100-page document corpus. Achieve faithfulness >90% (answers grounded in retrieved context, not hallucinated) on a 30-question benchmark, then deliberately break it one way from RAG Failure Diagnosis and fix it.
Stage 4: Context and Scale (Week 3)
Goal: Handle large contexts efficiently and build multi-turn applications.
Topics:
- Context Engineering — context budget, conversation compression, caching, multi-turn management
- Long-Context Economics and Prompt Caching — measured latency/cost scaling, and when caching a prefix actually pays off
Milestone: Build a multi-turn assistant that handles 20+ turn conversations without degrading. Implement context compression that triggers when usage exceeds 70% of the window. Verify the assistant maintains coherence across compression events.
Stage 5: Fine-Tuning and Evaluation (Weeks 4-5)
Goal: Customize models for specific domains and measure performance rigorously.
Topics:
- RAG vs. Fine-Tuning vs. Prompting — a decision framework, and one problem solved two ways to show the failure only grounding fixes
- Fine-Tuning — when to fine-tune, data preparation, running jobs, evaluating improvements
- LoRA, QLoRA, and PEFT — the DIY/open-model alternative to a hosted fine-tuning API, training <1% of parameters
- Evaluation — reference metrics, LLM-as-judge, RAG evaluation, regression testing
Milestone: Build an evaluation suite for any LLM application: 50 test cases, LLM-as-judge scoring on 3 dimensions, automated CI runner that fails if score drops >5% from baseline.
Stage 6: Inference and Serving (Week 5-6)
Goal: Understand what a hosted API and a self-hosted model server are actually doing underneath the HTTP layer.
Topics:
- Quantization — FP32/FP16/INT8/INT4 trade-offs, GPTQ/AWQ/GGUF, and how QLoRA combines with fine-tuning
- LLM Inference and Serving — KV cache, prefill vs. decode, batching — what vLLM/TGI/Ollama automate
Milestone: Measure your own model’s tokens/sec with and without KV caching, and with batch size 1 vs. 4+, to see the two biggest levers real serving stacks pull.
Stage 7: Production and Safety (Weeks 6-7)
Goal: Deploy LLM applications reliably, cost-efficiently, and safely.
Topics:
- Production Patterns — retry/backoff, caching, cost tracking, model routing
- Safety and Guardrails — input validation, output validation, rate limiting, injection detection
- LLM Security Beyond Guardrails — indirect prompt injection, excessive agency, insecure output handling
Milestone: Take any LLM application and add: retry with exponential backoff, SQLite-backed response caching, per-model cost tracking, and input/output validation. Measure cache hit rate and cost reduction.
Stage 8: Projects
Beginner: Smart summarizer, code review bot, FAQ answer bot Intermediate: RAG documentation assistant, automated code generator with tests, semantic search engine Advanced: Multi-agent research system, fine-tuned domain expert, LLM test automation framework
See LLM Engineering Projects for full descriptions.
What Comes After LLM Engineering
- AI Agents — autonomous systems that use tools and plan multi-step
- MLOps for LLMs (LLMOps) — prompt versioning, cost dashboards, evaluation pipelines
- Vector databases at scale — Weaviate, Pinecone, Qdrant for production RAG beyond a single-machine vector store
Resources
- Anthropic documentation: docs.anthropic.com
- “Building LLM Applications” (various online courses)
- LangChain and LlamaIndex docs — for RAG patterns
- OpenAI Cookbook — transferable recipes despite different API
- Hugging Face documentation — transformers, peft, and quantization libraries used in the Foundations and Inference stages