AI Intermediate: Infrastructure & Agentic SystemsDay 1 of 30 · Week 1: Bare-Metal Infrastructure & Advanced Containerization
Course outline▾

Week 1 · Bare-Metal Infrastructure & Advanced Containerization

  1. Day 1The AI Infrastructure Shift — Why the Model is Only 10% of the Production System
  2. Day 2Advanced Docker for AI: Multi-Stage Builds for Heavy Python Runtimes
  3. Day 3Hardware Acceleration in Docker: Configuring Resource Passthrough for Constrained Hardware
  4. Day 4Optimizing Model Weights: Quantization Basics (GGUF, AWQ) for Efficient Inference
  5. Day 5Local AI Runtimes: Deploying Ollama and vLLM for Bare-Metal Execution
  6. Day 6Containerizing AI Microservices: Building and Packaging APIs with FastAPI
  7. Day 7Docker Compose: Architecting a Multi-Container Database and Inference Stack Locally

Week 2 · Kubernetes Foundation for MLOps

  1. Day 8K3d & Lightweight Kubernetes: Running Multi-Node Clusters on 16GB of RAM
  2. Day 9Kubernetes Core for Machine Learning: Pods, Deployments, and Headless Services
  3. Day 10Persistent Volumes (PV/PVC): Managing Heavy Model Weights and Vector Stores
  4. Day 11StatefulSets for Vector Databases: Deploying Milvus or Qdrant in Kubernetes
  5. Day 12Auto-Scaling AI Inference: Using Horizontal Pod Autoscalers (HPA) for Spiky API Traffic
  6. Day 13Helm Charts: Packaging, Versioning, and Updating AI Deployments
  7. Day 14Week 2 Capstone: Deploying a Highly Available Local AI Application on K3d

Week 3 · High-Performance Networking & Security Mesh

  1. Day 15AI Network Bottlenecks: Transitioning from iptables to eBPF
  2. Day 16Cilium & eBPF: Sub-Millisecond Routing for Heavy AI Microservices
  3. Day 17Service Mesh 101: Installing Istio over Your Local Cluster
  4. Day 18Envoy Proxy as an AI Gateway: Load Balancing and Terminating LLM Prompts
  5. Day 19Zero-Trust mTLS: Encrypting Traffic Between Autonomous Agents
  6. Day 20API Rate Limiting & Egress Control: Preventing Agents from Exfiltrating Data
  7. Day 21Distributed Tracing: Debugging Agent Workflows with Jaeger and OpenTelemetry

Week 4 · Enterprise Agents & CI/CD Workflows

  1. Day 22Introduction to MLOps: Bridging AI Development with Continuous Integration
  2. Day 23GitOps with ArgoCD: Automated, Self-Healing AI Deployments
  3. Day 24Building Ephemeral AI Sandboxes: Secure Execution Environments for Agent Code
  4. Day 25Multi-Agent Orchestration Frameworks: Exploring Mastra, LangGraph, and CrewAI
  5. Day 26Tool-Calling in Production: Connecting Agents Securely to Internal Databases
  6. Day 27MLOps Guardrails: Evaluating Agents and Preventing Hallucinations in Real-Time
  7. Day 28Continuous Training Pipelines: Connecting Data Ingestion to Automated Model Retraining
  8. Day 29Managing Technical Debt and Infrastructure Drift in Enterprise AI
  9. Day 30The AI-Native Platform: Scaling from a Sandbox Environment to Global Cloud Architecture
Open the course page →

Day 1: The AI Infrastructure Shift — Why the Model is Only 10% of the Production System

2026-11-07 · 14 min read

In enterprise AI, a common belief is that business value comes mainly from the choice of foundation model. Teams spend weeks benchmarking a 7-billion-parameter model against a 70-billion one, debating fine-tuning curves and polishing system prompts. Then, once a model is chosen, they hit a wall trying to move from a prototype on a laptop to a real production environment.

In real-world deployments the model is roughly 10% of the total engineering effort. The other 90% is the platform infrastructure needed to serve, scale, observe and secure that intelligence. This series is about that 90%.

In plain terms: A model is the engine. Nobody ships an engine to customers. They ship a car: fuel system, brakes, dashboard, locks, service schedule. This series builds the car.

ENTERPRISE AI SYSTEMDATA INGESTION& pipelinesINGRESS & MESHEnvoy, Cilium eBPFOBSERVABILITYOTel, Jaeger tracingPERSISTENT STORAGEPV/PVC, NVMeAI MODEL10%inference runtimeZERO-TRUST SANDBOXES& egress controlVECTOR DATABASESQdrant, MilvusCI/CD & GITOPSArgoCD, registryRESOURCE SCHEDULINGK8s HPA, cgroups
FIG 1 · The model is one block in the grid. The other eight blocks are the platform that serves, scales, observes and secures it.

Walk through the grid and you see the real job. Data has to flow in (ingestion and pipelines). Traffic has to be routed safely (ingress and a service mesh). State has to survive restarts (persistent storage and vector databases). Every change must ship safely (CI/CD and GitOps), every resource must be scheduled and capped, every request must be traceable (observability), and untrusted model-generated code must be contained (sandboxes and egress control). The model is one block of nine.

WHERE THE ENGINEERING EFFORT GOES10%90% serve · scale · observe · securethe modelthe platform around itRule of thumb for this series, not a measured statistic.
FIG 2 · Teams spend weeks choosing a model, then discover that most of the work is the platform around it.

The hidden technical debt in machine learning

In 2015, Google researchers published a now-classic paper, Hidden Technical Debt in Machine Learning Systems. It showed that the machine-learning code in a real system is a small box surrounded by a much larger maze of infrastructure plumbing. With today's large language models (LLMs), that maze has grown:

  • Infrastructure plumbing: API rate limits, load balancing for high-concurrency prompts, context-window exhaustion, and database connections.
  • Resource allocation: inference is compute-bound and memory-bound. Unlike a stateless Node.js or Go service that sips memory, an LLM needs continuous GPU memory (VRAM), careful KV-cache management and hardware acceleration passed through to the container.
  • State and synchronization: real-time systems must keep vector databases, caches such as Redis, and model weights in step with low latency.

The memory problem, in numbers

The KV-cache is the model's working memory for the conversation. Every token a request holds in its context adds to it, for every layer of the network. That is why a model that fits comfortably for one user can run out of memory at ten.

GPU MEMORY AS CONCURRENT LONG REQUESTS GROW GPU limit: 24 GiB12345678910concurrent requests, each with an 8,000-token promptweights ≈ 15 GiB (8B model, FP16)orange: KV-cache, ≈ 1 GiB per requestAt 10 requests: out of memory
FIG 4 · Weights are a fixed cost. The KV-cache grows with every long request, so a model that fits one user can run out of memory at ten. Approximate, before runtime overhead.

Here is the arithmetic as a few lines of Python. The architecture numbers match a typical 8-billion-parameter model (32 layers, 8 key-value heads, a head size of 128). It is a rough budget that ignores runtime overhead, and I have run it:

# Rough GPU memory budget for serving one 8-billion-parameter model.
GIB = 2**30

def weights_gib(params: float, bytes_per_param: float) -> float:
    return params * bytes_per_param / GIB

def kv_cache_gib(tokens: int, layers=32, kv_heads=8, head_dim=128, bytes_per_value=2) -> float:
    # Keys and values (x2), for every layer, for every token held in context.
    return 2 * layers * kv_heads * head_dim * bytes_per_value * tokens / GIB

gpu_gib = 24
for name, bytes_per_param in [("FP16", 2), ("INT8", 1), ("INT4", 0.5)]:
    w = weights_gib(8e9, bytes_per_param)
    per_request = kv_cache_gib(8192)
    fits = int((gpu_gib - w) // per_request)
    print(f"{name}: weights {w:5.1f} GiB, one 8k-token request {per_request:.1f} GiB, "
          f"about {fits} concurrent requests fit in {gpu_gib} GiB")

Notice what changes the answer: quantization shrinks the weights, which leaves room for more concurrent requests. We cover that in Day 4.

The fragility of unmanaged inference

The fastest way to get a model online is to load it in a Python script and wrap it in Flask or a basic FastAPI app. It works in a demo. In production it fails in three predictable ways:

  • Memory leaks and out-of-memory panics: concurrent long prompts exhaust memory, and the Linux kernel's OOM-killer terminates the process with no warning.
  • No fault isolation: if the model runtime crashes, the whole application gateway goes with it, dropping live connections and losing in-flight work.
  • Security gaps: unsandboxed execution lets a prompt-injection attack reach the host filesystem, internal network sockets or environment variables, which often hold secrets.
A UNMANAGED: ONE PROCESSB PLATFORM: ISOLATED PODSCLIENTFlask + model, one processOOM-killedgateway down, requests lostmemory climbs, the kernel kills the process, everything goes with itCLIENTGATEWAYkeeps runningPOD APOD BA killedA restartedB keeps servingone pod fails, the others carry on, and the platform replaces it
FIG 3 · A raw script takes the whole gateway down when it runs out of memory. Isolated pods contain the failure, and the platform replaces the failed one.

The platform engineering mandate

Reliable AI systems come from platform engineering habits. Stop treating AI as an isolated data-science experiment, and treat the inference runtime as a mission-critical infrastructure tier:

  • Containerization: package the runtime as a deterministic, immutable, multi-stage Docker image (Days 2 and 3).
  • Resource throttling: enforce memory and CPU quotas with Linux kernel cgroups, so one runaway request cannot take down a node (Day 3).
  • Network isolation: use a zero-trust service mesh and eBPF-based networking to restrict what a model or agent can reach (Week 3).
TREAT THE INFERENCE RUNTIME AS AN INFRASTRUCTURE TIER CONTAINERIZEimmutable imagesTHROTTLEcgroup quotasISOLATEzero-trust egressbase imagepython venvapp codesealed layers, same everywherememory 10gcpus 4.0the kernel enforces the capagent poddatabaseinternet: blockeddefault-deny egress
FIG 5 · Containerize for repeatability, throttle with kernel quotas, and isolate the network, so one misbehaving model cannot hurt anything else.

A quick readiness check

Before you call a model "production-ready", ask:

  1. What happens when the process runs out of memory, and who restarts it?
  2. How many concurrent long requests fit before it fails, and has that been measured?
  3. Can the image be rebuilt identically next month, on any machine?
  4. What can the model, or an agent running its code, reach on the network?
  5. If an answer is wrong at 3 a.m., can you trace which step caused it?
  6. How does a new version reach production, and how do you roll it back?

If you cannot answer most of these, the model is not the problem. The platform is.

What the next 30 days build

Each week wraps another ring around the model, until you have something you could actually run in production, on a laptop with 16 GB of RAM.

MODELW1Containersadvanced Docker, GPUs, quantization, runtimes,FastAPI, ComposeW2KubernetesK3d, pods, volumes, StatefulSets, autoscaling,HelmW3Network and securityeBPF, Cilium, Istio, Envoy, mTLS, tracingW4Agents and CI/CDGitOps, sandboxes, multi-agent frameworks,guardrails
FIG 6 · Each week adds a ring around the model: containers, Kubernetes, network and security, then agents and CI/CD.

Reliable enterprise AI begins at the operating system and networking layer, not in the prompt window.

Coming Up Next

Day 2: Advanced Docker for AI: multi-stage builds for heavy Python runtimes.

#AIInfrastructure #MLOps #PlatformEngineering #CloudNative #DevOps #EnterpriseAI #SystemDesign #TechLeadership