Pidoku

AI System Design

Designing AI systems — the building blocks, AI infrastructure from an empty rack to a platform, agentic systems, and full worked designs with the real tools named.

Start with Module 1
  • 6 modules
  • 25 lessons
  • ~20h 35m

Modules

Read them in order. Each module builds on the one before.

  1. Module 1 How AI Systems Differ A model in the request path changes what "slow", "expensive", "correct" and "trusted" mean. This module establishes those changes, gives you one method for designing around them, and maps … 3 lessons · ~2h
  2. Module 2 Building Blocks Six components appear in almost every AI system, whatever its shape. Learn each one once — what it does, what it stores, how it fails — and a full design becomes a matter of arranging them. 6 lessons · ~4h 45m
  3. Module 3 AI Infrastructure From Scratch This module builds an AI platform from the bottom up: what you need, in what order, starting from an application that calls someone else's API and ending with your own GPU cluster serving … 6 lessons · ~4h 50m
  4. Module 4 Designing Agentic Systems An agent is a model that chooses its own next step, in a loop, until the job is done. That one change — the model decides the control flow — turns a request into a long-running, stateful, … 5 lessons · ~4h 5m
  5. Module 5 Security by Design Security is the sixth step of the design method, and it is a design step: the controls that matter most in an AI system are architectural — which component can see what, and which can do … 2 lessons · ~1h 35m
  6. Module 6 Worked Designs Everything so far, assembled. Each lesson is one complete design worked through the six-step method — requirements, numbers, architecture, failure, cost, security — with every box named and … 3 lessons · ~3h 20m

Reference

About

Learn to design systems that have a model in the middle: what to draw on the whiteboard, which numbers to compute before you draw it, which tools fill each box in 2026, and how the design changes when the model stops answering questions and starts taking actions.

Classic system design teaches load balancers, queues, caches and databases. All of that still applies. An AI system adds a component that is slow, expensive, probabilistic, priced by the token and easily talked into things — and the design has to be built around those five facts.

This learning material starts at “what is different when there is a model in the request path?” and ends with complete designs: the infrastructure for an agentic AI platform, drawn box by box with the real projects named, sized with arithmetic you can rerun, and reviewed for failure and attack.

It assumes you can program in Go and have seen an ordinary web backend. It does not assume you have run a GPU, built a RAG pipeline or written an agent.

What a finished design looks like#

flowchart LR
  U[":i-users: <b>Users and apps</b>"] --> GW[":envoyproxy: <b>AI gateway</b><br/><small>auth, token limits, routing</small>"]
  GW --> AG[":i-bot: <b>Agent runtime</b><br/><small>loop, state, checkpoints</small>"]
  AG --> GW2[":envoyproxy: <b>Model route</b>"]
  GW2 --> API[":anthropic: <b>Hosted models</b><br/><small>frontier APIs</small>"]
  GW2 --> SELF[":vllm: <b>Self-hosted models</b><br/><small>vLLM on GPUs</small>"]
  AG --> MCP[":modelcontextprotocol: <b>Tools over MCP</b><br/><small>search, code, tickets</small>"]
  AG --> SB[":i-box: <b>Sandboxes</b><br/><small>gVisor, microVMs</small>"]
  AG --> MEM[(":postgresql: <b>State and memory</b>")]
  SELF --> K8S[":kubernetes: <b>GPU cluster</b>"]
  AG -.-> OBS[":opentelemetry: <b>Telemetry and evals</b>"]
  class U neutral
  class GW,GW2 queue
  class AG,SELF compute
  class API,MCP io
  class SB warn
  class MEM,K8S memory
  class OBS neutral

Every box in that picture is a lesson. By the end you can defend each arrow.

How this learning material works#

Every lesson follows the same shape:

  1. The idea in one minute — the whole lesson in a few sentences.
  2. A picture — the mechanism, with the real tools drawn in. Press Expand on any diagram to open it full size.
  3. How it really works — the precise version, with names and numbers.
  4. Code — where arithmetic or a mechanism is worth running, a small Go program that uses only the standard library.
  5. Remember this, Try it and Check yourself.

Designs are always worked in the same order: requirements → numbers → architecture → failure → cost → security. Tools are chosen last. A tool named in a diagram is an example of what fills the box, not an endorsement; the tables say what else fits.

The topics#

flowchart LR
  A["How AI systems differ"] --> B["Building blocks"]
  B --> C["AI infrastructure<br/>from scratch"]
  C --> D["Agentic systems"]
  D --> E["Security by design"]
  E --> F["Worked designs"]
  class A neutral
  class B,C compute
  class D queue
  class E warn
  class F memory
ModuleYou will be able to
Module 1 · How AI Systems DifferSay what a model changes in a design, run the design method, and place any 2026 tool on one map
Module 2 · Building BlocksDesign the gateway, the context pipeline, state and caches, tool access, evaluation and reliability
Module 3 · AI Infrastructure From ScratchGo from “we call an API” to a GPU cluster: compute, cluster, serving, data and platform layers
Module 4 · Designing Agentic SystemsDesign the loop, durable execution, context and memory, multi-agent structure and sandboxes
Module 5 · Security by DesignDraw trust boundaries on an AI design and place the controls before the build
Module 6 · Worked DesignsProduce and review a complete design: an agentic AI platform, an enterprise RAG assistant

How it connects to the other learning materials#

This learning material stays at the level of boxes, arrows and arithmetic. When a box deserves a whole learning material, it has one:

What you need#

  • Go 1.22 or newer and a terminal. Every program runs offline.
  • No GPU, no cloud account and no API key.

A promise about names and versions#

Protocol versions, project statuses and release dates in this learning material were checked on 4 October 2026, and the lessons that depend on them list their sources. The field moves monthly. The method — requirements, numbers, architecture, failure, cost, security — does not, and each lesson separates the two so you know which half to re-check.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in