32,39 €
The rapid transformation and enterprise adoption of GenAI has created an urgent demand for developers to quickly build and deploy AI applications that deliver real value. Written by three distinguished Google AI engineers and LangChain contributors who have shaped Google Cloud’s integration with LangChain and implemented AI solutions for Fortune 500 companies, this book bridges the gap between concept and implementation, exploring LangChain and Google Cloud’s enterprise-ready tools for scalable AI solutions.
You'll start by exploring the fundamentals of large language models (LLMs) and how LangChain simplifies the development of AI workflows by connecting LLMs with external data and services. This book guides you through using essential tools like the Gemini and PaLM 2 APIs, Vertex AI, and Vertex AI Search to create sophisticated, production-ready GenAI applications. You'll also overcome the context limitations of LLMs by mastering advanced techniques like Retrieval-Augmented Generation (RAG) and external memory layers.
Through practical patterns and real-world examples, you’ll gain everything you need to harness Google Cloud’s AI ecosystem, reducing the time to market while ensuring enterprise scalability. You’ll have the expertise to build robust GenAI applications that can be tailored to solve real-world business challenges.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 367
Veröffentlichungsjahr: 2024
Generative AI on Google Cloud with LangChain
Design scalable generative AI solutions with Python, LangChain, and Vertex AI on Google Cloud
Leonid Kuligin | Jorge Zaldívar | Maximilian Tschochohei
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Niranjan Naikwadi
Publishing Product Manager: Nitin Nainani
Book Project Manager: Aparna Nair
Lead Editor: Sushma Reddy
Technical Editor: Rahul Limbachiya
Copy Editor: Safis Editing
Proofreader: Sushma Reddy
Indexer: Tejal Soni
Production Designer: Ponraj Dhandapani
DevRel Marketing Coordinator: Nivedita Singh
First published: Dec 2024
Production reference: 1221124
Published by Packt Publishing Ltd.
Grosvenor House 11 St Paul’s SquareBirmingham B3 1RB, UK
ISBN 978-1-83588-932-9
www.packtpub.com
To my wife, Ksenia, whose unwavering love and optimism have been my constant support over all these years; to my mother-in-law, Tatyana, whose belief in me, even in my most crazy endeavors, has been an incredible source of strength; and to my kids, Matvey and Milena, I hope you’ll read it one day.
– Leonid Kuligin
To my wife, Lucia, and son, Jaime, thank you for your endless support and patience during the journey of writing this book. You are my inspiration and my joy.
– Jorge Zaldivar
For Jacqueline, my partner and my rock. This book wouldn’t exist without your love and support.
– Maximilian Tschochohei
I started LangChain as a side project, an open source Python package, in late October of 2022. This was after Stable Diffusion but before the launch of ChatGPT. I was going to a bunch of meetups and hackathons, saw people building with early LLMs, and saw some common abstractions. Those abstractions became LangChain.
That was over two years ago, and the space has evolved rapidly since then. LangChain has both grown and evolved. The amount of people building applications on top of LLMs has exploded, and LangChain has served as an entry point for a lot of them. The functionality inside LangChain has had to evolve as the underlying technology did so as well.
LangChain aims to empower developers, engineers, and architects to leverage the potential of generative AI in their projects. The rapid evolution of this technology has opened up unprecedented opportunities for innovation and creativity, allowing us to transform industries in ways we never imagined. In recent years, we have witnessed a remarkable shift in how we interact with technology. Generative AI stands at the forefront of this revolution, enabling machines to create content, assist in decision-making, and enhance user experiences in ways we could only dream of a decade ago. However, navigating this landscape can be daunting, especially for those who are new to the field or transitioning from traditional development practices. This book serves as a comprehensive guide for those looking to harness the power of generative AI using LangChain.
This book is tailored for a diverse audience, from generative AI enthusiasts to seasoned engineers exploring the intricacies of this technology. It assumes a foundational knowledge of Python and basic machine learning principles, making it accessible yet rich in content for both novices and experienced professionals. The practical examples and hands-on approach will empower readers to design and implement enterprise-ready architectures on Google Cloud, leveraging the full potential of LangChain and its integrations.
In this book, you will learn not only about the foundational models available on Google Cloud, such as PaLM 2 and Gemini, but also how to build robust applications that address real-world challenges. The structured journey through the book will guide you from understanding the core concepts of generative AI to deploying your solutions effectively in a cloud environment.
Moreover, the insights provided on common architectures, grounding responses, and advanced techniques will equip you with the knowledge to tackle the complexities of generative AI applications. You will gain the confidence to experiment, innovate, and ultimately contribute to the ever-evolving landscape of AI-driven solutions.
I encourage you to embrace this learning journey with an open mind and a spirit of curiosity. Above all else, I believe that it is still incredibly early on in this technological revolution. The possibilities are limitless, and with the right tools and knowledge, you can become a pioneer in this exciting field. Thank you for choosing this book as your guide, and I look forward to seeing the incredible applications you create with LangChain and Google Cloud.
Harrison Chase, CEO, LangChain
Leonid Kuligin is a staff AI engineer at Google Cloud, working on generative AI and classical machine learning solutions (such as demand forecasting or optimization problems). Leonid is one of the key maintainers of Google Cloud integrations on LangChain, and a visiting lecturer at CDTM (TUM and LMU). Prior to Google, Leonid gained more than 20 years of experience in building B2C and B2B applications based on complex machine learning and data processing solutions such as search, maps, and investment management in German, Russian, and US technological, financial, and retail companies.
I want to thank all my colleagues who helped me not only with this book but also with making Google integrations a first-class citizen on LangChain. I want to express my gratitude to all LangChain folks and the community, who helped to build such an incredible framework we all love working with. I’d like to say a special thank you to Pavel Gulin, who inspired me to write this book with his optimism and enthusiasm, and Slava Rubaev, my first manager and my lifetime mentor, who taught me the basics of entrepreneurship, technology, and critical thinking.
Jorge Zaldívar is an AI engineer at Google and a contributor to LangChain’s integrations with Google. He has a decade of experience building complex machine learning applications and products applied to the energy and financial industries.
Maximilian Tschochohei leads AI engineering at Google Cloud Consulting EMEA. He implements LangChain applications together with Google Cloud customers. Before Google, he worked in strategy and technology consulting with Boston Consulting Group.
I want to thank my partner, my family, and my friends: thank you for your endless patience and unwavering support. I also want to thank my colleagues and my team: thank you for letting me learn from you. And special thanks to Leonid for coming up with the idea for this book, and for letting me be a part of it.
Nuno Campos is a founding software engineer at LangChain, Inc. Nuno has more than 9 years of experience as a Python and JavaScript software engineer, architect, and open-source maintainer. Nuno has been a maintainer of various popular open-source projects, including LangGraph, LangChain.js, and Enzyme. Previously, he worked for various tech start-ups in software engineering and data science roles. He holds an MSc in finance.
Georgii Danshchin is the head of data science at HeadHunter Group, where he played a key role in shaping and leading the development of crucial components such as recommendations and search ranking based on machine learning. With a background in software development starting in 2012, he studied data science at the Higher School of Economics and Yandex School of Data Analysis. He has applied machine learning to real-world business tasks for nearly a decade. Georgii has also successfully participated in machine learning competitions, holds the Kaggle Master title, and has earned several gold medals. He is passionate about the opportunities that large language models (LLMs) offer to engineers and product managers.
Lucio Floretta leads a team of AI experts within Google Cloud’s Professional Services organization, where he empowers enterprise customers to harness the transformative power of artificial intelligence. While his recent focus has been on generative AI, Lucio has been guiding customers across EMEA in building robust MLOps systems and ML solutions on Google Cloud since 2017.
In this part, we will provide an overview of LangChain as a framework and the main generative AI capabilities available on Google Cloud Platform. We’ll also look into the key interfaces of LangChain, making you ready to read LangChain code with ease and start developing applications with this framework. If you’re new to generative AI, we also encourage you to take a look at Appendix 1, where we provide a quick intro to the topic and give you a list of papers to dive into.
This part has the following chapters:
Chapter 1, Using LangChain with Google CloudChapter 2, Foundational Models on Google Cloud