
Build a Transformer from Scratch in Python
Build a working transformer block in PyTorch from scratch — attention, feed-forward, residuals, and layer norm — and see how the pieces of an LLM fit together.

Build a working transformer block in PyTorch from scratch — attention, feed-forward, residuals, and layer norm — and see how the pieces of an LLM fit together.

Understand self-attention — the core of every transformer — by building it in NumPy. Queries, keys, values, scaling, and softmax, explained with runnable code.

Practical prompt engineering in Python — few-shot prompting, chain-of-thought, structured output, and role prompting, each with runnable code and when to use it.

Build a working LLM agent in Python without a framework — a tool-calling loop, a tool registry, and reasoning steps. Understand what LangChain and LangGraph do under the hood.

Master Python tuples — immutability, packing and unpacking, named tuples, and the count() and index() methods, with runnable examples and when to use tuples over lists.

Master Python sets — creation, uniqueness, set algebra, and every built-in method (union, intersection, difference, symmetric_difference, and more) with runnable examples and the mutating-vs-return...

Master Python lists — creation, indexing, slicing, comprehensions, and every built-in method (append, extend, insert, sort, and more) with runnable examples and gotchas.

Master Python dictionaries — creation, access, iteration, and every built-in method (get, items, keys, pop, setdefault, update, and more) with runnable examples and gotchas.
.webp)
Every Python built-in function explained with runnable examples, gotchas, and when to use each — abs, zip, map, enumerate, sorted, and 50+ more.

Build a reasoning LLM from scratch in Python — a BPE tokenizer, RoPE attention, SwiGLU transformer blocks, and chain-of-thought dual-loss training. No APIs, no wrappers, just pure PyTorch.