Skip to main content

ML Systems Design

Design the production systems around a model rather than the model itself: the two-plane blueprint that wires data, features, training, serving, and a feedback loop; a feature store that kills training/serving skew; a real-time recommendation funnel that keeps heavy models off the hot path; and a serving/rollout layer that ships model updates safely and degrades gracefully when the model service is down.

0/4

LLM / GenAI Infrastructure

Whiteboard the systems that sit around a large language model in production: a RAG pipeline that grounds answers in private data with citations and access control, a billion-vector ANN search service, an AI gateway that controls cost and reliability across many providers, a GPU inference server tuned for throughput and time-to-first-token, an agent platform that bounds cost and defends against prompt injection, an eval-and-guardrail pipeline that gates every model change, and the decision framework for choosing prompting versus RAG versus fine-tuning.

0/7
Lesson 05

RAG (Retrieval-Augmented Generation) Architecture

RAG is ingestion (parse, chunk, embed, index with ACL metadata) plus a query path of hybrid retrieval, a mandatory reranker, ACL-filtered context assembly, grounded generation with citations, and the RAG triad for eval.

hard40 min
Lesson 06

Vector Databases & ANN Search

ANN trades recall for speed via HNSW (RAM, high recall), IVF-PQ (quantized, memory-cheap), or DiskANN (SSD-scale); tune ef_search / nprobe; handle filtered search as a pre-filter pushed into the index; and plan for rebuilds and re-embedding migrations.

hard40 min
Lesson 07

Model Gateway / LLM Router / AI Gateway

An AI gateway is a unified multi-provider API adding failover and routing, exact plus semantic caching, per-tenant quotas and cost metering, retries/timeouts/circuit breakers with streaming passthrough, and input/output safety plus audit logging, all without becoming a SPOF.

hard35 min
Lesson 08

LLM Inference Serving (GPU Economics)

LLM serving is capped by KV-cache memory, so use PagedAttention to kill fragmentation and continuous batching to keep the GPU saturated; reason in TTFT (prefill) vs inter-token (decode) vs throughput; and add quantization, parallelism, prefix caching, and speculative decoding to stretch a fixed GPU fleet.

hard40 min
Lesson 09

LLM Agents & Orchestration

An agent is a bounded loop; the controller enforces step/token/time/cost limits, tool calls are schema-validated and sandboxed, side-effecting tools are idempotent, memory can be durable and resumable, and the central safety problem is prompt injection via tool output, contained by treating output as untrusted, least-privilege scoping, and human approval gates.

hard40 min
Lesson 10

LLM Evaluation & Guardrails

Gate every change with offline golden-set eval (programmatic checks, calibrated LLM-as-judge, regression suite) plus online canary/A-B, enforce input and output guardrails at runtime (PII, injection, schema, moderation, groundedness), and close the loop by feeding production failures back into the eval sets.

hard35 min
Lesson 11

Fine-Tuning vs RAG vs Prompting

Prompting for behavior, RAG for fresh/private knowledge, fine-tuning (via LoRA adapters, rarely full) for style/format/latency; they compose; drive continuous improvement with a data flywheel; and never fine-tune for knowledge that changes when RAG keeps it fresh.

hard35 min

Real-Time Analytics & Global Data

Design the two systems that show up whenever data has to be either fast at massive volume or correct across the planet: a streaming analytics pipeline that turns a firehose of billions of events per day into sub-second trending and per-minute counts, and a globally distributed database that serves low-latency local reads worldwide without letting two regions double-spend the same balance.

0/2

IoT, Edge & Time-Series

Design the two halves of a large sensor platform: the ingestion path that pulls telemetry from millions of intermittently-connected devices and splits it into a hot alerting path and a cold analytics path, and the specialized time-series storage substrate underneath it that survives high write rates and controls the cardinality explosion that kills most metrics systems.

0/2