A hands-on system that exposes what most LLM APIs deliberately hide.
Most LLM APIs hide the mechanics: you set a temperature slider and get text back. But understanding what's happening in the logit space (how temperature reshapes the probability distribution, why top-K and nucleus sampling behave differently in edge cases) is essential for anyone building serious LLM applications. This playground was built as an educational tool to expose these mechanics explicitly: no HuggingFace generate() defaults, manual implementations of each sampling strategy, and live tracking of time-to-first-token (TTFT) and throughput.
After the forward pass, raw logits are processed manually: temperature scaling, top-K filtering, and nucleus (top-p) sampling are implemented from scratch, not using library defaults.
The autoregressive generation loop tracks TTFT (latency to first token) and throughput (tokens per second) at each step, surfacing where bottlenecks occur.
A FastAPI server exposes endpoints for model loading, parameter configuration, and generation, allowing the React frontend to issue real-time inference requests.
The React frontend provides interactive sliders for temperature, top-K, and top-p parameters. Generated text and performance metrics update in real time, enabling side-by-side comparison of sampling strategies.
Educational tool used to demonstrate LLM decoding mechanics in classroom settings
Manual sampling implementations reveal subtle behavioral differences vs library defaults
TTFT tracking enables fine-grained latency analysis across model sizes
React UI makes sampling strategies intuitively comparable through live parameter tuning