Skip to main content
Module 12 · Lesson 1 of 445/48 in the course~20 min
Module lessons (1/4)

Local Inference Stacks: vLLM, Ollama & llama.cpp

Lesson preview3 hands-on exercises readyAI Engineering & Production RAG · Module 12 — Local Serving, Quantization & Speculative Decoding

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

  1. 1Local Model Serving & The Enterprise Shift
  2. 2TTFT vs TPS: Prefill vs Decode Phases
  3. 3Check Your Understanding
  4. 4Practice: Serving Metrics & Streaming Aggregators in Python
Pro Lesson · Module 12 — Local Serving, Quantization & Speculative Decoding

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.