اشتراک یکساله با 45 درصد تخفیف به مدت محدود فعال شد. 3 فصل اول تمامی کتاب ها رایگانه!

Designing LLM-powered systems

Chapters
16 Flashcards
9 Gallery cards
41 Audio
16 Prompts
16 Glossary

The landscape of AI development is shifting dramatically, and understanding how to build robust systems powered by Large Language Models (LLMs) is no longer optional—it's essential. This chapter dives into the exciting world of LLM-powered systems, bridging the gap between traditional machine learning operations (MLOps) and the unique demands of LLMs. The core challenge we tackle is adapting our existing MLOps practices to the distinct characteristics of LLMs. While foundational principles like reliable infrastructure and systematic deployment remain critical, LLMs introduce new complexities in areas such as data handling, model evaluation, and continuous integration. Without a clear strategy, building and maintaining LLM applications can quickly become chaotic, leading to unpredictable behavior and difficulty in iteration. We begin by exploring LLMOps: New challenges, familiar principles. This section clarifies what makes LLM applications fundamentally different from traditional ML models, such as their reliance on natural language understanding and generation, and how we can extend our existing ML platforms to accommodate these new workloads. We'll cover the essential tools for LLM applications, which are crucial for managing the lifecycle of these models effectively. A key insight here is that while the tools might be new, the underlying principles of good MLOps—like versioning, testing, and monitoring—remain the same. Next, we dive into a practical case study: Building DataKrypt’s DakkaBot: A simple RAG architecture. This hands-on example demonstrates what you’ll build, a system capable of answering questions based on a knowledge base. We'll move beyond single API calls, focusing on designing for composability to create more sophisticated and flexible systems. You'll learn about Google’s Gemini LLM and embeddings, understanding how these models process information and how embeddings represent text numerically. The architecture is broken down into its core components: the retrieval component, which finds relevant information; the augmentation component, which prepares that information for the LLM; and the generation component, which synthesizes the final answer. This layered approach is vital for building scalable and maintainable LLM applications. To make DakkaBot accessible, we'll cover Giving DakkaBot a UI, transforming a complex backend system into a user-friendly interface. Crucially, we then address Observability for LLM applications. This is where we learn to monitor the intricate workings of LLM pipelines, going beyond traditional metrics to understand the reasoning process itself. We'll walk through setting up Langfuse via Docker, integrating Langfuse with DakkaBot, and achieving enhanced observability in DakkaBotCore, providing deep insights into model performance and potential failure points. The primary trade-off we navigate is between the simplicity of direct LLM API calls and the power of composable, multi-component architectures. While a single API call is easy to implement, it limits flexibility and control. Conversely, building composable systems offers greater power and adaptability but requires more complex engineering and careful management of inter-component dependencies. By the end of this chapter, you will be equipped to: [ ] Identify the unique challenges and opportunities presented by LLM-powered systems compared to traditional ML models. [ ] Extend existing MLOps practices and platforms to effectively manage LLM lifecycles. [ ] Design and implement a Retrieval-Augmented Generation (RAG) architecture, understanding its core components. [ ] Utilize tools like Google's Gemini and embedding models for information processing. [ ] Integrate LLM components for enhanced system composability and flexibility. [ ] Set up and leverage observability tools like Langfuse to monitor and debug complex LLM applications. [ ] Build a user interface for an LLM-powered application. [ ] Analyze LLM application performance using advanced observability techniques beyond traditional metrics.

Chapter

1

Cover of Machine Learning Platform Engineering
Manning Publications

Chapter 12 of Machine Learning Platform Engineering: Designing LLM-powered systems

Book release

Published

Sections

Part 4: Extending MLOps for Large Language Models

Chapter 12 progress
Book progress

Reading time

00:45

Gallery

Yes

Audio status

Preview

Analysis

AI