Skip to content
ImagineWorld

Appendix A: Repository Atlas

node_idnode-book_building-frontier-llm-from-scratch_appendix-a-repository-atlas
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_titleAppendix A: Repository Atlas
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Appendix A — Repository Atlas

This appendix collects the open-source repositories cited throughout the book in one place, grouped by role. Together they form a near-complete, openly available toolkit for building, training, and serving a frontier-class model. URLs are omitted as they change; each is easily found by name. DeepSeek’s release of its training and inference stack is unusually complete, and those repositories are the closest public analogue to a frontier lab’s internal infrastructure.

Repository Role Chapter
huggingface/datatrove data filtering, dedup, tokenization at scale 6
huggingface/transformers, tokenizers models and fast tokenizers 5
huggingface/trl SFT, reward, PPO, DPO, GRPO trainers 22–25
huggingface/peft LoRA and other parameter-efficient methods 22
bitsandbytes 8-bit/4-bit quantization (QLoRA) 22, 26
NVIDIA/Megatron-LM tensor and pipeline parallelism 19
NVIDIA/TransformerEngine FP8 training 18
Dao-AILab/flash-attention IO-aware exact attention kernels 14
vllm-project/vllm paged attention, continuous batching serving 27, 28
sgl-project/sglang fast structured generation and serving 28
NVIDIA/TensorRT-LLM optimized inference engine 28
ggerganov/llama.cpp GGUF quantized CPU/edge inference 26, 27

Table A.3 — Training, data, and serving frameworks

A practitioner with the model code of Parts III–IV, the DeepSeek stack of Table A.1, and the frameworks of Table A.3 has, in principle, everything needed to train and serve a model — the barrier, as Chapter 20 noted, is compute and data, not code.

Training and Serving Frameworks

Beyond the DeepSeek stack, a handful of open frameworks do the heavy lifting in most real projects. You rarely write a training loop or a serving engine from scratch; you configure one of these. Grouped by where they sit in the pipeline:

Project Role Chapter
Megatron-LM 3D-parallel pretraining at scale 19
DeepSpeed ZeRO sharding and training optimizations 19
PyTorch FSDP native sharded data parallelism 19
ProjectRoleChapter
HuggingFace TRLSFT, DPO, PPO, and GRPO trainers22-25
Axolotlconfiguration-driven fine-tuning22
PEFTLoRA and other adapter methods22
vLLMhigh-throughput serving, paged attention28
SGLangserving with automatic prefix caching28
llama.cppquantized CPU/GPU local inference26, 33
Ollamaone-command local model runner33
transformersreference implementations of most modelsthroughout

Table A.3 — Frameworks for training, tuning, and serving

Read top to bottom, these compose into the full lifecycle of this book. A team might pretrain with Megatron-LM or DeepSpeed on a cluster, align the result with TRL’s SFT and GRPO trainers (using PEFT’s LoRA to keep it affordable), serve the production model through vLLM or SGLang, and ship a quantized build through llama.cpp or Ollama for local use. None of these existed a few years ago; together they are why a small team can now traverse the entire path from raw tokens to a served, aligned model — the path this book lays out — without reinventing the infrastructure at any stage.