Phase 8: LLMOps Infrastructure
๐ง Beginner Mental Model (Explain Like Iโm 5)
Running Large Language Models (LLMs) in production is very different from running stateless web servers:
- Vector Databases (Milvus): Long-term memory for AIโstores meanings as mathematical coordinates (embeddings) in RAM (
HNSWgraphs) so the AI can look up relevant company facts in 5 milliseconds (RAG). - AI Gateway (LiteLLM): A central tollbooth that tracks token spend per team, blocks PII leaks, caches repeated questions in Redis, and fails over from OpenAI to Bedrock/Anthropic automatically.
- GPU Slicing (MIG) & vLLM: Splits a $30,000 NVIDIA H100 GPU into 7 isolated hardware slices and uses
PagedAttentionso GPU memory is never wasted.
๐งญ Step-by-Step Execution Playbook for Phase 8
- Step 1 (Vector DB & AI Gateway): Size Milvus HNSW memory and deploy LiteLLM Gateway in Lesson 1.
- Step 2 (Automated Prompt CI Gates): Build LLM-as-a-Judge quality gates with MLflow in Lesson 2.
- Step 3 (GPU Orchestration & vLLM): Configure NVIDIA MIG slicing, vLLM PagedAttention, and NeMo Guardrails in Lesson 3 and Phase 8 Labs.
๐ Deep-Dive Index
1. Vector Databases (Milvus Architecture)
- Concepts: Embeddings, High-dimensional vector space, HNSW index parameters (M, efConstruction).
- RAM Sizing Formula: In-memory capacity planning using the enterprise formula M = N ร D ร 4 ร 1.5 bytes (accounting for vector dimensions, float32 precision, and graph indexing overhead).
- Milvus Topology on K8s: Distributed architecture decoupling Compute (QueryNodes, DataNodes, IndexNodes) from Storage (MinIO S3, etcd, Apache Pulsar).
2. AI Gateways & Governance (LiteLLM)
- The Problem: Hardcoding LLM vendor API keys in microservices leads to unbounded cloud bills, lack of auditability, and vendor lock-in.
- Enterprise Solution (AI Gateway): LiteLLM Proxy architecture. Centralized credential pooling, virtual key budgets, per-team rate limits, and OpenTelemetry/Prometheus token tracking.
- High-Availability Resilience: Multi-model fallback routing (OpenAI โ Azure OpenAI โ Anthropic Claude) with Redis semantic caching for 90% latency reduction and zero repeated token cost.
3. GPU Orchestration & vLLM Serving
- Karpenter GPU NodePools: Just-in-time provisioning of AWS G5 / P4d GPU instances with automated interruption handling.
- NVIDIA GPU Operator: Driver lifecycle, container toolkit, and DCGM exporter daemonsets.
- vLLM Inference: PagedAttention memory virtualization, continuous dynamic batching, and LlamaGuard safety guardrails.
๐ ๏ธ Job-Essential Exercises
- RAG Backend Deployment & Sizing:
- Size memory requirements for a 10M-vector (1536-dim) collection using the formula and write a Helm chart to deploy distributed Milvus on Kubernetes.
- The AI Gateway Control & Failover:
- Deploy LiteLLM Proxy with Redis caching. Configure master credentials, provision virtual keys with monthly spend budgets, and simulate an upstream OpenAI outage to observe automated failover to Azure OpenAI.
- vLLM High-Throughput Inference:
- Deploy a Karpenter GPU NodePool provisioning NVIDIA A10G instances. Deploy vLLM with PagedAttention to serve an open-source model with continuous batching.