Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

book

Building AI for Production

Resources & Links

This page is a comprehensive compilation of all the links and resources in the book “Building AI for Production: Enhancing LLM Abilities and Reliability with Fine-Tuning and RAG”. Here, you’ll find a collection of code notebooks, checkpoints, GitHub repositories, learning resources, and all other materials shared throughout the book. It is organized chapter-wise and presented in chronological order for easy access.

If you see discrepancies between the code in the book and the code in colab, or want to improve the colabs with new updates, please feel free to create a pull request inΒ the GitHub.

Key Updates from Edition 1 to Edition 2

Chapter Update Description
Chapter 1Expanded to include the latest benchmarks, such as LMSYS, and a run-through of recent models like GPT-4 and Gemini 1.5 and technniques like Infinite Attention.
Chapter 2Extended industry applications of LLMs in sectors like media, education, finance, and medicine, with a deeper dive into pecific use cases in each industry, such as autocompletion, code prediction, and debugging in technology and software.
Chapter 3Minor restructuring to improve logical flow and progressive understanding of LLM challenges and solutions.
Chapter 4A new section on prompt injection introduces this emerging security challenge, detailing its types, impact on reliability, with solutions such as guardrails and safeguards to protect LLM integrity.
Chapter 5: RAG (Previously, Introduction to LangChain and LlamaIndex)Includes a step-by-step guide to building a basic Retrieval-Augmented Generation (RAG) pipeline from scratch, covering essentials like embeddings, cosine similarity, and vector stores. This foundation equips you to apply modern frameworks like LlamaIndex and LangChain more efficiently or go on your own with custom implementations and prepares you for their evolution better.
Chapter 6: Introduction to LangChain & LlamaIndex (Previously Prompting with LangChain)Introduces foundational elements of LangChain as part of a complete system, providing a comprehensive understanding of how each component functions within a broader context. This structured overview acts as a roadmap, enabling a clearer grasp of RAG pipelines in the upcoming chapters.
Chapter 7: Prompting with LangChain (Previously RAG)Includes LangChain Chains, previously part of the RAG chapter, for clarity.
Chapter 8: Indexes, Retrievers, and Data preparation (New Chapter)Indexes, Retrievers, and Data Preparation are essential components of a RAG pipeline. While these concepts were introduced in the first edition, this updated edition includes a dedicated chapter that focuses on their foundational principles. This approach ensures that readers can effectively scale LLM applications, optimize performance, and enhance response quality. Additionally, by emphasizing the fundamentals, this edition allows readers to understand and implement RAG concepts independently, without relying exclusively on frameworks like LangChain.
Chapter 9: Advanced RAGOnly structural updates
Chapter 10: AgentsOnly structural updates
Chapter 11: Fine-tuningOnly structural updates
Chapter 12: Deployment and OptimizationThe updated version takes a deeper dive into essential techniques for LLM deployment and optimization, making it more practical and relevant for current AI development needs. For example, the book explores model distillation, a powerful technique to reduce inference costs and improve latency, with a detailed case study on Google’s Gemma 2, demonstrating its real-world impact. With open-source LLMs growing in popularity, this edition also covers the deployment of LLMs on various cloud platforms, including Together AI, Groq, Fireworks AI, and Replicate. This broader approach helps readers find cost-effective and scalable solutions for real-world applications.

A Note on Library and Model Versioning

LLMs are advancing rapidly, but the core skills and tools covered in this bookβ€”like fine-tuning, prompt engineering, and retrieval-augmented generationβ€” will remain essential for adapting next-generation models to specific data, workflows, and industries. These principles will stay relevant across models, even as some specific libraries evolve.

For seamless code execution, we’ve included a requirements file for library versions. If you’re running notebooks on Google Colab, be aware that libraries like “pytorch” and “Transformers” are pre-installed. Should compatibility issues arise, try uninstalling these libraries in Colab and reinstalling the specified versions from the requirements file.

Switching to newer LLMs is straightforward. For instance, with OpenAI models, you can update the model simply by changing its name in the code. We recommend using GPT-4o-mini over “GPT-3.5 Turbo” in the book examples. Regularly checking documentation for Langchain, LlamaIndex, and OpenAI is also encouraged to stay aligned with updates and best practices.

This approach ensures your skills remain applicable in the dynamic LLM field.

Table of Contents

Introduction

No Notebooks.

Book Library Requirements

Resources

Chapter I: Introduction to LLMs

No Notebooks.

Research Papers

Chapter II: LLM Architectures & Landscape

Chapter III: LLM Landscape

No Notebooks.

Research Papers: Evaluating LLM Performance (Benchmarks)

Chapter V: Retrieval-Augmented Generation

Notebook

Resources

Chapter VII: Prompting with LangChain

Notebook

Resources

Chapter VIII: Indexes, Retrievers, and Data Preparation

Notebook

Book File

Tokens and APIs & Packages

Resources

Chapter IX: Advanced RAG

Notebook

Resources

Chapter X: Agents

Notebook

Dataset

Resources

Chapter XI: Fine-Tuning

Notebook

Book Model Checkpoints, Requirements, Datasets, W&B Reports

Resources

Note: This webpage has been updated to follow the order and structure of the second edition. All resources from the first edition are still available but may have been rearranged to match the new sequence. Additionally, you’ll find new links and resources exclusive to the second editionβ€”an added benefit for readers with the first edition.