timothygao8710/minLlama
minLlama
Yet Another Llama 3.2 implementation (in pure numpy)
5stars
timothygao8710/minLlama
minLlama
Minimal Llama 3.2 Instruct inference in ~100 lines of pure NumPy, with PyTorch and Jax versions in ~140 lines. Supports KV cache, RoPE, GQA, RMSNorm, SwiGLU MLP.
Visit project- First shared
- Jun 23, 2026
- HN activity
- 20
Show HN@timothygaoJun 23, 2026
Show HN: MinLlama – Llama 3.2 inference in ~100 lines of NumPy
I built minLlama because I wanted a Llama implementation that was easy to understand and hack for KV cache compression research. There is also a PyTorch and Jax version in ~140 lines. Would be interested in feedback from people who have written transformer implementations before, are there any implementation "tricks" that I'm missing (e.g, cleaner KV cache for PyTorch/Jax or rope tricks)?
Community