Module lessons (1/4)
Local Inference Stacks: vLLM, Ollama & llama.cpp
Architecture of modern inference engines, compute-bound prefill vs memory-bound decode, and continuous batching.
What you'll learn in this lesson
- Understand modern local and private model serving architectures: vLLM, Ollama, and llama.cpp.
- Differentiate between prefill phase (Time to First Token — TTFT) and decode phase (Tokens Per Second — TPS).
- Stream and aggregate Server-Sent Events (SSE) from OpenAI-compatible local endpoints.
- Explore speculative speedups and memory virtualization in the Speculative Decoding Lab.
Overview
While cloud APIs (OpenAI, Anthropic, Google) are convenient for prototyping, enterprise architectures increasingly deploy self-hosted inference engines (vLLM, Ollama, llama.cpp, TensorRT-LLM) for three critical reasons:
Language model inference consists of two mathematically distinct stages with opposite computational bottlenecks:
Sections covered in this lesson
- 1Local Model Serving & The Enterprise Shift
- 2TTFT vs TPS: Prefill vs Decode Phases
- 3Check Your Understanding
- 4Practice: Serving Metrics & Streaming Aggregators in Python
Unlock "Local Inference Stacks: vLLM, Ollama & llama.cpp" and the full AI Engineering & Production RAG curriculum
Architecture of modern inference engines, compute-bound prefill vs memory-bound decode, and continuous batching.
Unlock all 3 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in AI Engineering & Production RAG plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.