DeepSeek V3 architecture in 190 lines of pure JAX
2026-11-16 · GitHub
The project compresses DeepSeek-V3's architecture from its technical report into about 190 lines of pure JAX: params are plain dicts of arrays and every part is a function readable top to bottom, with no Flax, Equinox or PyTorch. It covers multi-head latent attention (MLA), DeepSeekMoE, aux-loss-free expert balancing and multi-token prediction (MTP).
Author Vaibhaav Tiwari pretrained it from scratch on a MacBook Air M5 (24GB) using 207 public-domain detective novels (about 83.4M characters, 21.69M tokens) with a custom 8,192-token BPE tokenizer. With balancing on and off, validation loss at step 2,000 was 3.921 vs 3.923, matching the paper's claim that the bias balances experts at no cost.
To start you need an Apple Silicon Mac, Python 3.12 and uv; a CPU path exists. A 138MB checkpoint is released but is a Python pickle that can execute code, so load only trusted sources. jax-metal 0.1.1 only works with jax 0.4.34, so versions are pinned.
Limits: the author says it is an architecture demo, not a strong language model. Star count not retrieved; traction evidence is 100+ points on Show HN on Nov 14. License: MIT.