Understanding and Coding the KV Cache in LLMs from Scratch
sebastianraschka.com