Capstones
Build your own

Projects, from small to large

Every topic with code has a Build your own X project: you recreate a real piece of the inference stack in stages, with a test for each stage. Every phase ends with three capstones. The small one is required to finish the phase; the large one is a portfolio piece you would demo in an interview.

Build-your-own projects
58
408 h
Small capstones
6
52 h · required
Medium capstones
6
120 h · optional
Large capstones
6
270 h · portfolio
Shipped:0/6 small0/6 medium0/6 large0/356 build stages passed

Phase 01 · LLM Fundamentals

Small

Build your own GPT-2 inference engine (no HuggingFace)

CPU · your Mac~8 h
one evening to a weekend · required for phase completion

Load the real GPT-2 small weights into a decoder you wrote yourself (embeddings, RoPE-free learned positions, attention, MLP, layer norm, tied unembedding), add a KV cache and greedy/top-k sampling, and prove it matches the Hugging Face output. This is the whole of Phase 1 in one file you understand completely.

Full brief →
Medium

Build your own inference profiler for transformers

CPU · your Mac~16 h
a weekend or two · composes several builds

Instrument your Phase-1 engine (or HF GPT-2) to produce a per-layer, per-operator breakdown of time, FLOPs and bytes moved for prefill and decode, then use it to predict and verify where time goes as prompt length, batch size and model size change. The output is a tool, a report and a set of predictions you tested.

Full brief →
Large

Build your own llama.cpp (CPU-only Llama inference in C++ or Rust)

CPU · your Mac~50 h
1-3 weeks · portfolio piece

Reimplement inference for TinyLlama-1.1B on CPU without PyTorch, in C++ or Rust: GGUF or safetensors loading, bf16-to-fp32 or int8 weight handling, RoPE, grouped-query attention, SwiGLU, RMSNorm, a KV cache, a BPE tokenizer and a streaming CLI. This is a portfolio project in the mould of llama.cpp and llama2.c and exercises every Phase-1 idea at the level a systems team expects.

Full brief →
Build-your-own projects in this phase (7)

Phase 02 · GPU Architecture and CUDA

Small

Build your own fused attention kernel in CUDA

Colab T4 · free~8 h
one evening to a weekend · required for phase completion

Write one CUDA kernel that computes causal scaled dot-product attention for GPT-2 shapes (12 heads, head_dim 64, sequences up to 1024) without ever materialising the S x S score matrix. Tile over keys, keep a running max and sum in registers (online softmax), accumulate the output in fp32, bind it with load_inline, and prove it matches torch F.scaled_dot_product_attention while timing it. It proves the phase because thread mapping, shared-memory tiling, warp reductions, coalesced loads and roofline reasoning all have to be right in a single kernel you can explain line by line.

Full brief →
Medium

Build your own CUDA kernel library for a transformer block

Colab T4 · free~16 h
a weekend or two · composes several builds

Assemble the kernels from this phase's builds (SGEMM, softmax, layernorm, GELU, fused attention) plus the glue they need (bias add, residual add, head reshapes) into one PyTorch C++ extension, then write a MyGPT2Block module that runs a complete GPT-2 small layer, attention and MLP, using only your kernels, and verify it against the Hugging Face GPT2Block with the same weights. It proves the phase because every kernel must agree with PyTorch at the layer level and be fast enough that the whole layer is not embarrassingly slower than eager mode.

Full brief →
Large

Build your own GPU inference engine for GPT-2

Colab T4 · free~40 h
1-3 weeks · portfolio piece

Turn the kernel library into an engine. Load GPT-2 small weights onto the device once, run the full 12-layer forward (embeddings, blocks, final layernorm, tied unembedding) with your kernels, keep a preallocated on-device KV cache, write a decode-step attention kernel that reads it, and generate text greedily from a Python driver that does nothing but launch kernels. Compare tokens per second and bytes per token against PyTorch eager HF generate on the same T4. It is portfolio-grade because it shows you can take a model from weights to streaming tokens on a GPU with code you wrote and can account for every microsecond of a decode step.

Full brief →
Build-your-own projects in this phase (7)

Phase 03 · Inference Engines

Small

Build your own continuous-batching inference server

CPU · your Mac~8 h
one evening to a weekend · required for phase completion

Put the GPT-2 engine you wrote in Phase 1 behind an OpenAI-compatible API with a real scheduler: iteration-level batching, a paged KV cache with a block budget, admission control and preemption, all on CPU. It proves the phase because every component you simulated or read about in vLLM now exists as code you can step through, and the throughput gain over one-request-at-a-time serving is a number you measured.

Full brief →
Medium

Build your own benchmark suite and compare vLLM vs SGLang on a T4

Colab T4 · free~20 h
a weekend or two · composes several builds

Turn your load generator into a reproducible benchmark suite and use it to produce a defensible head-to-head of vLLM and SGLang serving Qwen2.5-0.5B-Instruct on a free Colab T4: throughput-latency curves, TTFT and ITL percentiles at matched load, and a prefix-cache experiment that isolates RadixAttention against vLLM's prefix caching. It proves the phase because the result is a report a team could act on, with methodology that survives review.

Full brief →
Large

Build your own mini-vLLM

Colab T4 · free~40 h
1-3 weeks · portfolio piece

Write a GPU inference engine from scratch over a Hugging Face model: an OpenAI-compatible API, an asynchronous engine loop, a continuous-batching scheduler with chunked prefill, a paged KV cache with block tables, prefix caching via a radix tree, and a paged attention path in PyTorch. The target is Qwen2.5-0.5B-Instruct on a Colab T4 within 2-3x of vLLM's throughput on the same workload. This is the portfolio project for the phase, the kind of repository that gets you a systems interview.

Full brief →
Build-your-own projects in this phase (10)

Phase 04 · Inference Optimization

Small

Build your own INT8/INT4 quantizer for GPT-2 with a correctness gate

CPU · your Mac~8 h
one evening to a weekend · required for phase completion

Quantize GPT-2 small and medium to INT8 (per-channel) and INT4 (group-wise, round-to-nearest and GPTQ-lite), load the quantized weights into your Phase-1 engine or transformers, and put every configuration through a numerics gate you also build: KL and top-k agreement against fp32 goldens plus perplexity on a fixed text slice. It proves the phase because you can show, with your own numbers, exactly how much accuracy each byte saved costs and the gate that would stop a bad quantization from shipping.

Full brief →
Medium

Build your own optimized decode path

Colab T4 · free~20 h
a weekend or two · composes several builds

Take the decode step of a small model (GPT-2 small, or Qwen2.5-0.5B in fp16) on a Colab T4 and rebuild it as fused Triton kernels reading an fp8 KV cache, captured into CUDA Graphs per batch bucket, with nsys traces before and after and a numerics gate that proves the output did not drift. It proves the phase because every kernel-level trick is applied to one real model with a measured inter-token latency gain and a correctness number next to it.

Full brief →
Large

Build your own speculative decoding system

Colab T4 · free~40 h
1-3 weeks · portfolio piece

Turn speculative decoding into a production feature of the continuous-batching server you built in Phase 3: pluggable drafters (a small same-family model, n-gram prompt lookup and a tree-structured draft), a verifier that is exact for greedy and provably lossless for sampling, KV rollback for draft and target, per-request adaptive gamma, metrics, and an end-to-end benchmark on a T4 with Qwen2.5-0.5B drafting for Qwen2.5-1.5B. It is portfolio-grade because it combines an algorithm, systems integration and honest measurement of where the speedup disappears as batch size grows.

Full brief →
Build-your-own projects in this phase (12)

Phase 05 · Distributed Inference

Small

Build your own tensor-parallel GPT-2 on CPU ranks

CPU · your Mac~10 h
one evening to a weekend · required for phase completion

Take the Phase 1 GPT-2 engine and shard it across 2 and 4 torch.distributed gloo processes with column- and row-parallel linears and head-parallel attention, so every rank holds only its slice of the weights and KV cache and the fleet produces logits identical to the single-process model. You then measure exactly how many bytes cross between ranks per token and show that the count matches the formula. This proves you understand how real engines split a model, not just that you can set tensor_parallel_size.

Full brief →
Medium

Build your own fleet simulator

CPU · your Mac~24 h
a weekend or two · composes several builds

Compose the pipeline, disaggregation, routing and autoscaling simulators from this phase into one discrete-event model of an inference fleet, calibrated with the prefill and decode step times you measured in Phases 3 and 4, and use it to answer capacity questions with SLO goodput curves. The output is a tool that a capacity planner could run before buying GPUs, plus a report of experiments where you predicted and then checked results.

Full brief →
Large

Build your own multi-GPU serving stack

Rented multi-GPU~40 h
1-3 weeks · portfolio piece

Stand up vLLM with tensor_parallel_size 2 on a two-GPU cloud instance inside a kind cluster with the NVIDIA device plugin, put your own router and autoscaler in front of it, wire Prometheus, Grafana and alert rules from your metrics pipeline, then run your chaos drill kit against it and write the postmortem. This is the whole phase as one deployable, observable, tested system, the kind of thing a platform team would ask you to walk through in an interview.

Full brief →
Build-your-own projects in this phase (12)

Phase 06 · Production Engineering and Specialization

Small

Build your own Triton attention kernel and ship it as a torch custom op

Colab T4 · free~10 h
one evening to a weekend · required for phase completion

Write a fused attention forward kernel in Triton (online softmax, causal mask, fp16 inputs with fp32 accumulation), register it as a torch.library custom operator with a fake implementation, prove it runs under torch.compile with no graph breaks, and benchmark it against F.scaled_dot_product_attention on a T4. This is the Phase-6 kernel loop in miniature, from blank file to installable package with numbers.

Full brief →
Medium

Build your own Rust inference gateway

CPU · your Mac~24 h
a weekend or two · composes several builds

Extend the Rust router build into a production-shaped gateway: OpenAI-compatible routing across several engine backends with prefix-aware and least-loaded policies, SSE streaming, request coalescing, retries with budgets and circuit breakers, admission control, Prometheus metrics and tracing, a config reload path, and a load test that proves the latency overhead and failure behaviour. The backends are the Phase 5 stub engine and, optionally, a real vLLM on Colab exposed through a tunnel.

Full brief →
Large

Build your own end-to-end inference platform

Colab T4 · free~60 h
1-3 weeks · portfolio piece

Assemble the whole course into one system you can demo: your Phase-3 mini-vLLM engine with the Phase-4 optimizations (Triton or CUDA paged attention, fp8 or int8 weights, CUDA Graphs or torch.compile for decode, speculative decoding optional), two engine replicas behind your Rust gateway, Prometheus and Grafana observability with SLO dashboards, a load test and chaos drill, and a public write-up with a recorded demo. It is the portfolio piece a hiring team can read in ten minutes and verify in an hour.

Full brief →
Build-your-own projects in this phase (10)