These five small labs isolate one moving part each. They are not replicas of the larger projects that inspired them; they are local, from-scratch teaching models with a deliberately narrow surface area. Each source is credited on its lab page.
A leader is a temporary job #
Select a server, start an election, and partition nodes. The model makes terms, leadership, and reachability visible without pretending to implement the full Raft protocol. It is inspired by Diego Ongaro’s RaftScope and the Raft paper.
Watch what happens when the leader becomes unreachable. The title “leader” does not survive a network boundary; another term and a reachable quorum are required.
An index is a shape, not a sorted list #
Insert and delete numeric keys. The visualization groups sorted leaves beneath separator keys, showing why a database index stays shallow as it grows. It is a compact conceptual companion to Sam Rose and PlanetScale’s interactive explanation of B-trees.
The lab omits disk pages, sibling redistribution, and the many details a production engine needs. Its job is to make search fan-out visible before those details arrive.
Cosine measures direction #
Open the vector similarity playground →
Rotate two vectors and change their magnitude. Cosine similarity follows the angle and ignores length, which is why embedding systems commonly normalize vectors before nearest-neighbor search. The interaction takes inspiration from TensorFlow’s Embedding Projector while reducing the scene to two dimensions.
Some datasets need a bend #
Open the decision boundary trainer →
Train a logistic classifier on two clusters, then switch to XOR. A straight decision boundary can separate the first dataset and cannot solve the second. No amount of additional training gives a linear model a curve; it needs nonlinear features or a hidden layer. This focused exercise is inspired by TensorFlow Playground.
Sampling knobs reshape a distribution #
Open the token sampling desk →
Temperature changes how peaked the probability distribution is. Top-k retains a fixed number of candidates. Top-p keeps the smallest prefix whose cumulative probability reaches a threshold. Tune all three, then sample repeatedly to see the difference between changing the distribution and merely choosing its most likely token.
These controls follow the generation concepts documented by Hugging Face. The vocabulary and logits are intentionally tiny, so the behavior is visible without loading a model.