Appendix A: Repository Atlas
local graph
Appendix A: Repository Atlas
Section titled “Appendix A: Repository Atlas”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 |
| Project | Role | Chapter |
|---|---|---|
| HuggingFace TRL | SFT, DPO, PPO, and GRPO trainers | 22-25 |
| Axolotl | configuration-driven fine-tuning | 22 |
| PEFT | LoRA and other adapter methods | 22 |
| vLLM | high-throughput serving, paged attention | 28 |
| SGLang | serving with automatic prefix caching | 28 |
| llama.cpp | quantized CPU/GPU local inference | 26, 33 |
| Ollama | one-command local model runner | 33 |
| transformers | reference implementations of most models | throughout |
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.