<packt>
LLM Engineer's Handbook

LLM Engineer's Handbook: Master the art of engineering large language models from concept to production

4.8 (25 Ratings)

eBook Oct 2024 522 pages 1st Edition

As a subscriber you have FREE access to this publication within our online reader

Key benefits

  • Build and refine LLMs step by step, covering data preparation, RAG, and fine-tuning
  • Learn essential skills for deploying and monitoring LLMs, ensuring optimal performance in production
  • Utilize preference alignment, evaluation, and inference optimization to enhance performance and adaptability of your LLM applications

Description

Artificial intelligence has undergone rapid advancements, and Large Language Models (LLMs) are at the forefront of this revolution. This LLM book offers insights into designing, training, and deploying LLMs in real-world scenarios by leveraging MLOps best practices. The guide walks you through building an LLM-powered twin that's cost-effective, scalable, and modular. It moves beyond isolated Jupyter notebooks, focusing on how to build production-grade end-to-end LLM systems. Throughout this book, you will learn data engineering, supervised fine-tuning, and deployment. The hands-on approach to building the LLM Twin use case will help you implement MLOps components in your own projects. You will also explore cutting-edge advancements in the field, including inference optimization, preference alignment, and real-time data processing, making this a vital resource for those looking to apply LLMs in their projects. By the end of this book, you will be proficient in deploying LLMs that solve practical problems while maintaining low-latency and high-availability inference capabilities. Whether you are new to artificial intelligence or an experienced practitioner, this book delivers guidance and practical techniques that will deepen your understanding of LLMs and sharpen your ability to implement them effectively. *Email sign-up and proof of purchase required

Who is this book for?

This book is for AI engineers, NLP professionals, and LLM engineers looking to deepen their understanding of LLMs. Basic knowledge of LLMs and the Gen AI landscape, Python and AWS is recommended. Whether you are new to AI or looking to enhance your skills, this book provides comprehensive guidance on implementing LLMs in real-world scenarios

What you will learn

  • Implement robust data pipelines and manage LLM training cycles
  • Create your own LLM and refine it with the help of hands-on examples
  • Get started with LLMOps by diving into core MLOps principles such as orchestrators and prompt monitoring
  • Perform supervised fine-tuning and LLM evaluation
  • Deploy end-to-end LLM solutions using AWS and other tools
  • Design scalable and modular LLM systems
  • Learn about RAG applications by building a feature and inference pipeline

A book to keep every month + unlimited access

Download this title for $29.99 with a premium membership

Learn More

Table of Contents

14 Chapters
  • Understanding the LLM Twin Concept and Architecture
  • Understanding the LLM Twin concept
  • Planning the MVP of the LLM Twin product
  • Building ML systems with feature/training/inference pipelines
  • Designing the system architecture of the LLM Twin
  • Summary
  • References
  • Tooling and Installation
  • Python ecosystem and project installation
  • MLOps and LLMOps tooling
  • Databases for storing unstructured and vector data
  • Preparing for AWS
  • Summary
  • References
  • Join our book’s Discord space
  • Data Engineering
  • Designing the LLM Twin’s data collection pipeline
  • Gathering raw data into the data warehouse
  • Summary
  • References
  • RAG Feature Pipeline
  • Understanding RAG
  • An overview of advanced RAG
  • Exploring the LLM Twin’s RAG feature pipeline architecture
  • Implementing the LLM Twin’s RAG feature pipeline
  • Summary
  • References
  • Join our book’s Discord space
  • Supervised Fine-Tuning
  • Creating an instruction dataset
  • Creating our own instruction dataset
  • Exploring SFT and its techniques
  • Fine-tuning in practice
  • Summary
  • References
  • Fine-Tuning with Preference Alignment
  • Understanding preference datasets
  • Creating our own preference dataset
  • Preference alignment
  • Implementing DPO
  • Summary
  • References
  • Join our book’s Discord space
  • Evaluating LLMs
  • Model evaluation
  • RAG evaluation
  • Evaluating TwinLlama-3.1-8B
  • Summary
  • References
  • Inference Optimization
  • Model optimization strategies
  • Model parallelism
  • Model quantization
  • Summary
  • References
  • Join our book’s Discord space
  • RAG Inference Pipeline
  • Understanding the LLM Twin’s RAG inference pipeline
  • Exploring the LLM Twin’s advanced RAG techniques
  • Implementing the LLM Twin’s RAG inference pipeline
  • Summary
  • References
  • Inference Pipeline Deployment
  • Criteria for choosing deployment types
  • Understanding inference deployment types
  • Monolithic versus microservices architecture in model serving
  • Exploring the LLM Twin’s inference pipeline deployment strategy
  • Deploying the LLM Twin service
  • Autoscaling capabilities to handle spikes in usage
  • Summary
  • References
  • Join our book’s Discord space
  • MLOps and LLMOps
  • The path to LLMOps: Understanding its roots in DevOps and MLOps
  • Deploying the LLM Twin’s pipelines to the cloud
  • Adding LLMOps to the LLM Twin
  • Summary
  • References
  • MLOps Principles
  • 1. Automation or operationalization
  • 2. Versioning
  • 3. Experiment tracking
  • 4. Testing
  • 5. Monitoring
  • 6. Reproducibility
  • Other Books You May Enjoy
  • Index

Recommendations for you

1 of 10

Customer reviews

Amirhossein | Oct 30, 2024

5

This book is an exceptional resource for anyone diving into the world of LLMs. I came in with a solid foundation in LLMs and the underlying transformer-based architecture, but I was eager to learn how to deploy my models effectively. This book deepens your understanding of LLMs and covers essential MLOps and LLMops practices, making it invaluable for engineers looking to bridge theory and practical deployment. Highly recommended for those wanting to take their LLM knowledge to the next level.

Subscriber reviewpackt

Norman | Nov 12, 2025

5

Very detailed exploration of LLM engineering. Highly recommended!

Subscriber reviewpackt

Rajesh K. | Oct 22, 2024

5

I have been reading books from a long time and have had a special interest for AI what helps me understand LLMs more than anything has been books around it, I have almost read every article out there and even every published paper, what makes this book unique is the blend of experience and touch of professional hands-on experience, what interested me the most is the sections around Aws which I have been really intrigued about and I believe this is something everyone around AWS needs to work around and I as an avid reader would suggest this is probably the best resource out there.5/5 for how well this book reads

Amazon Verified reviewamazon

Robert I | Oct 27, 2024

5

Before I read this book, I knew little about LLMs other than what the letters stood for. This book taught me a lot, and I know enough to start creating my own. The chapters are laid out well, and each chapter builds upon another. I can't recommend this book enough!

Amazon Verified reviewamazon

Pauline I | Nov 03, 2024

5

Great resource for those starting with large language models. It offers clear explanations of complex concepts, practical examples, and a wide range of topics, from data preparation to model deployment. Whether you're a technical expert or a curious learner, this book provides a solid foundation for understanding and working with LLMs.

Amazon Verified reviewamazon

About the authors

1 of 2

Paul Iusztin

Paul Iusztin is a senior ML and MLOps engineer at Metaphysic, a leading GenAI platform, serving as one of their core engineers in taking their deep learning products to production. Along with Metaphysic, with over seven years of experience, he built GenAI, Computer Vision and MLOps solutions for CoreAI, Everseen, and Continental. Paul's determined passion and mission are to build data-intensive AI/ML products that serve the world and educate others about the process. As the Founder of Decoding ML, a channel for battle-tested content on learning how to design, code, and deploy production-grade ML, Paul has significantly enriched the engineering and MLOps community. His weekly content on ML engineering and his open-source courses focusing on end-to-end ML life cycles, such as Hands-on LLM...

Read moreSee other products by Paul Iusztin

Maxime Labonne

Maxime Labonne is Head of Post-Training at Liquid AI. He holds a Ph.D. in Machine Learning from the Polytechnic Institute of Paris and is a Google Developer Expert in AI/ML. He has made significant contributions to the open-source community, including the LLM Course, tutorials on fine-tuning, tools such as LLM AutoEval, and best-in-class models like NeuralDaredevil. He is the author of the best-selling books “LLM Engineer's Handbook” and “Hands-On Graph Neural Networks Using Python.

See other products by Maxime Labonne

FAQs

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing — When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title.
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.