Building LLMs for Production
Enhancing LLM Abilities and Reliability with Prompting, Fine-Tuning, and RAG
Synopsis
Written by Louis-François Bouchard and Louie Peters with more than ten contributors from the Towards AI team, this self-published guide sets out to take developers from understanding large language models to shipping applications built on them. Early chapters explain how large language models work, survey model architectures and the vendor landscape, and discuss what changes when models meet real use, before turning to prompting techniques. The core of the book treats retrieval-augmented generation in depth: building indexes, chunking and preparing data, choosing retrievers, and applying advanced RAG methods, with hands-on projects in LangChain and LlamaIndex.
Later chapters address agents, fine-tuning, and deployment and optimization. The October 2024 update added a framework-free RAG tutorial, a case study in model distillation using Google's Gemma 2, and guidance on serving open models through Together AI, Groq, Fireworks AI and Replicate. The authors aim the book at readers with intermediate Python, while noting that the conceptual explanations require no coding. Readers gain a working map of the 2024 LLM engineering stack, runnable code for each major technique, and a basis for deciding when to prompt, retrieve or fine-tune. The framework-specific code will need updating as the libraries evolve.
Scorecard
Editorial score
How it scored
Editorial score: 65.3 / 1005 weighted criteria
- 18.0/30
Influence30%
- 16.3/25
Authority25%
- 15.0/20
Practical value20%
- 9.0/15
Currency15%
- 7.0/10
Readability10%
- 65.3/100
Editorial score
How the rank was computed
Rank No. 344 of 500 comes from a composite of 51.8: observable signals 22.3 of 55 points plus editorial review 29.5 of 45 points.
All 11 inputs
| Input | Points |
|---|---|
| Observable signals | 22.3/55 |
| Reach (Amazon ratings volume) | 8.6/16.5 |
| Consensus across best-of lists | 2.8/13.8 |
| Awards and bestseller evidence | 3.3/8.3 |
| Reader rating, sample-adjusted | 5.4/8.3 |
| Amazon sales rank | 0.5/5.5 |
| Recency | 1.7/2.8 |
| Editorial review | 29.5/45 |
| Author authority | 7.3/11.3 |
| Influence | 8.1/13.5 |
| Practical value | 6.8/9.0 |
| Readability | 3.2/4.5 |
| Currency | 4.1/6.8 |
Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.
Verdict
A broad, code-heavy practitioner guide to prompting, RAG and fine-tuning, useful for developers moving LLM prototypes toward production.
Strengths
- Wide coverage of the LLM application stack
- Runnable code projects for each major topic
- Explains concepts before moving into code
Keep in mind
Framework-specific code for LangChain and LlamaIndex ages quickly, and the 2024 text predates newer agent tooling such as the Model Context Protocol.
Key takeaways
- Prompting, retrieval-augmented generation and fine-tuning are complementary tools, and choosing among them depends on cost, accuracy and data requirements.
- RAG quality depends heavily on data preparation: how documents are chunked, indexed and retrieved shapes what the model can answer.
- Frameworks such as LangChain and LlamaIndex speed development, but building a basic RAG pipeline from scratch clarifies what those frameworks hide.
- Distillation and hosted inference platforms can cut latency and cost when moving open-source models into production.
Notable facts
- The authors' site reports more than 10,000 copies sold. Source (opens in a new tab)
- LlamaIndex co-founder and CEO Jerry Liu called it "the most comprehensive textbook to date on building LLM applications." Source (opens in a new tab)
- An October 2024 update added a framework-free RAG tutorial, a Gemma 2 distillation case study and guidance on deploying open models via Together AI, Groq, Fireworks AI and Replicate. Source (opens in a new tab)
About the author
Questions
What is Building LLMs for Production about?
Is Building LLMs for Production worth reading in 2026?
Do I need to know how to code to read Building LLMs for Production?
Related books
- An Illustrated Guide to AI Agents Maarten Grootendorst and Jay Alammar
- HBR Guide to Generative AI for Managers Elisa Farri and Gabriele Rosani
- Designing Multi-Agent Systems Victor Dibia
- Prompt Engineering for Generative AI James Phoenix and Mike Taylor
- Generative AI on AWS Chris Fregly, Antje Barth and Shelbee Eigenbrode
- Generative AI System Design Interview Ali Aminian and Hao Sheng
Sources
As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.






