Learning LLM inference by building it from scratch

Plan
- Build a small transformer and train it
- Look into optimizations
- KV cache
- Speculative decoding
- Batching
- Quantization
- Look into serving
Structure
notebooks/: Notebooks I use to learn and test stuffdata/: The dataset, not committedout/: Saved model weights, not committedassets/: Images for the readme
Setup
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
mkdir -p data && curl -o data/input.txt https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt
Resources
Stuff I used to learn along the way