FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Books & courses

Read Building LLMs for Production out of order

Six parts are enough before you go onsite, and the new chapter on data preparation should come well before any talk of fine-tuning.

ShareLinkedInFacebookX

In brief

  • The book suits readers who know Python and needs no AI or NLP background; the second edition is renamed Building AI for Production.
  • FDEs should prioritize RAG, the index and retriever chapter, Advanced RAG and Deployment; Agents and Fine-Tuning can wait.
  • Most of the value comes from building and measuring a pipeline yourself, rather than from finishing the book.
Horizontal bar splitting 50 questions in a hypothetical example: the retriever finds the correct passage for 30 questions, while the other 20 have no correct source. A marker at 30 shows that, whichever model is used, at most 60% of questions can be answered from the right documents.
When the retriever finds the correct passage for only 30 of 50 questions, the other 20 have no correct source to answer from, so the fix lies on the data side, not in the model. Source: hypothetical example in the article, not real measurements.

The big addition in the October 2024 update to a roughly 470-page book on LLMs was about data: an entirely new chapter on indexes, retrievers and data preparation.

That detail suggests how to read Building LLMs for Production, published by Towards AI and co-authored by Louis-François Bouchard. If you are an FDE, look closely at the customer’s documents before discussing which model to use, because RAG answers correctly only when it finds the right passage.

The useful question, then, is what to read before going into the field. Six parts will do, taken in a different order from the table of contents.

Buy the right edition first

The book goes by two names. The first edition is Building LLMs for Production, with a subtitle that lists prompting, fine-tuning and RAG. The second, on the Towards AI site, is renamed Building AI for Production; it has 12 chapters, and its subtitle keeps only fine-tuning and RAG.

If you own the old version, there is no need to buy again just for Agents or Fine-Tuning. Towards AI’s comparison table says those two chapters were mainly restructured, while Deployment goes deeper. That is the reason to upgrade, along with the new data chapter if your copy lacks it.

The entry bar is low. Towards AI wrote the book for people who know nothing about AI or NLP, and Bouchard asks only for a little Python. If you have a few years of backend work behind you, skim the LLM and NLP foundations and slow down when you meet an unfamiliar term.

Jerry Liu, co-founder and CEO of LlamaIndex, called it the most comprehensive textbook on LLM applications at the time of his comment. That breadth is also why you should not read it front to back.

A reading order tied to the deployment

Chapter numbers below follow the second edition. The order and the right-hand column are advice for FDEs and do not come from the book.

The index and retriever chapter has no number because its title comes from the October 2024 update and could not be matched to a chapter number in the second edition. Look for the topic in the table of contents of your own copy.

Order What to read Work at the customer
1 Chapter V: RAG Before you arrive: understand each link in the chain, build a trial version on public documents
2 Indexes, retrievers, data preparation First session: ask for 50 real questions, deal with messy documents, measure search
3 Chapter IX: Advanced RAG Fix the specific failures you measured
4 Chapter XII: Deployment Settle where the model runs, latency and cost
5 Chapter X: Agents Expand once search is reliable
6 Chapter XI: Fine-Tuning Consider it when the steps above fall short

Putting Fine-Tuning last is an opinion, and the book sets no such rule. Fine-tuning consumes labeled data and maintenance effort, while failures early in a RAG project can often be fixed more cheaply on the data side. Agents come before it because many customers will ask about agents early, but an agent built on a poor retriever only gets things wrong faster.

Build the RAG pipeline by hand once before using a framework

The update includes a step-by-step guide to building a basic RAG pipeline from scratch, and the book comes with ready-to-run Colab notebooks and code projects. Do more than skim this part. When your demo gives a wrong answer in front of the customer, you need to know which step failed, and someone who has assembled each link by hand will find it much faster.

One practical caution: the ebook on the Towards AI site is interactive and is not a downloadable PDF. Don’t count on saving a file to read on the way to the customer.

Measure the retriever before blaming the model

This is why the index and retriever chapter comes second. Take a hypothetical insurance company that hands you a store of PDF contracts and wants a chatbot to answer its staff. You write 50 real questions with the employees, each paired with the passage that contains the answer, then run the retriever on its own.

Say the retriever finds the right passage for only 30 of them. The other 20 have no correct basis for an answer, so whichever model you switch to, at most 30/50 questions, or 60%, will be answered from the right document.

With that number in hand, the meeting stops circling around whether the model seems smart enough. People start discussing how to rechunk and reindex the documents.

So choosing a model should not be your first task at the customer. Ask for 50 real questions, and for the people who can answer them, before you write the first line of RAG code on their data. Only when you know why those 20 failed does the Advanced RAG chapter become a list of remedies matched to the illness.

Calculate latency before you promise it

The expanded deployment section covers distillation, a technique for reducing inference cost and latency, with a case study on Google’s Gemma 2. The book also discusses deploying LLMs on Together AI, Groq, Fireworks AI and Replicate. Any list of platforms dates quickly, so learn how to compare them rather than memorizing the names.

The calculation to make is simple. Say the customer needs an answer in 1.5 seconds, the retriever takes 300 milliseconds and the model takes 2 seconds. The total is 2.3 seconds, 800 milliseconds slower than required.

At that point you can change where the model runs, use a smaller model, or consider distillation if traffic is heavy enough to justify the work. Don’t commit to a response time until you have measured these numbers on real infrastructure.

Turn the book into evidence for a job application

Finishing a book proves nothing to a recruiter. If an FDE job description mentions RAG on customer data, review Chapters V and IX. If it mentions production deployment or latency optimization, review Chapter XII.

On a CV, a small project with measurements is stronger than a line saying you read the book: which messy documents you used, how many questions out of how many the retriever got right before and after the fix, and what latency you measured.

In the interview, be ready to explain why you have not fine-tuned yet. That answer shows you know when a technique is not yet worth the effort.

The book runs to about 470 pages, but the first session at a customer may begin with nothing more than a folder of PDFs and 50 questions. Those who prepare for that session will read the rest with much clearer questions.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
4 sources
Read next on the roadmap · Stage 2: Broad engineeringThe test suite that lets a client change your code after you leaveBrian Okken's Python Testing with pytest is most useful to FDEs for one skill: writing tests the next engineer can read and trust.