Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Generative AI Application Integration Patterns
Generative AI Application Integration Patterns

Generative AI Application Integration Patterns: Integrate large language models into your applications

Arrow left icon
Profile Icon Juan Pablo Bustos Profile Icon Luis Lopez Soria
Arrow right icon
€20.98 €29.99
eBook Sep 2024 218 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€25.99 €37.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Juan Pablo Bustos Profile Icon Luis Lopez Soria
Arrow right icon
€20.98 €29.99
eBook Sep 2024 218 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€25.99 €37.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€25.99 €37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Generative AI Application Integration Patterns

Identifying Generative AI Use Cases

In the previous chapter, we discussed how the use case exploration and proof of concept development process has shifted with the emergence of large language models (LLMs). Specifically, the ability for rapid experimentation with LLMs has led teams to favor an experimental approach over more traditional requirements analysis and design processes.

With LLMs, use cases can quickly be tested by creating prompts that demonstrate potential capabilities. This allows for greater flexibility and speed than meticulously mapping detailed requirements upfront. Of course, once promising use cases are identified, more rigorous analysis is highly recommended. Additionally, security, monitoring, and governance of production systems remain critical components.

In this chapter, we will discuss an approach to identify promising use cases to explore with LLMs. We categorize use cases based on how an application interacts with the LLM. This provides a framework...

When to consider generative AI

As we have been exploring, one of the powers of GenAI is the ability to automatically generate responses without being explicitly trained on it. Rather than just executing predefined tasks, LLMs can infer responses by drawing on their contextual understanding and knowledge. This aspect of emergent reasoning unlocks unique opportunities for rapid experimentation and iterative refinement of novel use cases.

When considering potential applications for GenAI, the first evaluation criterion centers on comprehension-based tasks. Sentiment analysis, content classification, intent classification, relationship extraction, summarization, and more all leverage innate language understanding. Developers can formulate prompts aligning to use cases that interpret, organize, or infer meaning. To unlock the full potential of LLMs, developers will iterate on these given prompts through thoughtful “prompt engineering.” Prompt engineering attempts to optimize...

Realizing business value

When assessing opportunities to solve business problems with GenAI, it’s critical that we analyze potential value in business terms – how does this technology shift affect structures, efficiency, competitive positioning, or revenue opportunities in an organization? Merely showcasing sophisticated technical capabilities alone is not enough to show value, as it lacks strategic rigor. Proposed projects should directly address tangible problems or sources of organizational leverage.

As thought leaders seeking executive buy-in, we need to develop skills and methodologies that translate potential productivity gains into compelling business cases, clarifying the return on investment. Specifically, constructing cost avoidance models resonates with executives focused on operational efficiencies and margins.

Quantifying assumptions in terms that the business can understand and measure is an essential step to a successful integration of GenAI into...

Identifying Generative AI use cases

As we evaluate potential applications for GenAI, two overarching categories emerge – comprehension applications and generative applications. By distinguishing use cases along this spectrum of understanding existing data vs synthesizing new artifacts, we can better match capabilities to appropriate business challenges:

  • Comprehension applications cover processing tasks applied to analyze and structure knowledge from existing content. This includes sentiment analysis, relationship extraction, intent classification, summarization, and more. The key focus areas center around interpreting, organizing, and tagging data to be used by subsequent systems.

Sources like chat history, customer tickets, and product catalogs yield richer insights when machine learning models classify topics, normalize entities, and summarize concepts at scale.

  • Generative applications move beyond pure comprehension applications to creatively...

Potential business-focused use cases

When exploring opportunities to apply GenAI, continuously evaluate any potential business value first rather than just the technical art of the possible. To spark ideas, the following list summarizes promising use cases organized by key value drivers. Consider cases where replicating human-quality comprehension or creation at a machine scale has a positive impact on workflows.

Cost and efficiency gains:

  • Automate high-volume/repetitive tasks. Here, your business key performance indicator (KPI) can be an automation rate, measured as a percentage of automated tasks.
  • Accelerate content development, enabling hybrid human/AI collaboration. Here, your business KPI can be an increase in the number of hours saved compared to the current amount of time taken to create content.
  • Content evaluation to reduce errors and rework. Here, your business KPI can be the delta in the number of tickets filed to update incorrect content.
  • ...

Generative AI deployment and hosting options

As we consider which types of use cases we are looking to pursue to provide business value, we must consider the infrastructure on which we will deploy and host our systems. With the new normal of leveraging cloud resources, we tend to assume that capacity is not a concern anymore, but is this right? Let’s dissect this thought – is the biggest model the right solution for all use cases? Realistically speaking, LLMs are nice and easy to test and get initial results, but when considering scale and productionalization, they are not as appealing as you would think. Some of the limitations are GPU availability, cost, and latency. This realization is steering the market into more specialized smaller models that solve a specific use case.

Designing product architecture for LLMs requires careful consideration of several factors. Cost optimization strategies like Mixture-of-Depths can be employed to dynamically allocate resources...

Summary

This chapter explored the intricacies of evaluating potential use cases for GenAI, equipping you with the tools to discern optimal applications for this transformative technology. By examining different viewpoints and criteria, we’ve established a framework to determine whether a given use case aligns with GenAI’s strengths and limitations.

The key takeaways are as follows:

  • At the heart of every successful GenAI implementation lies clear and demonstrable business value. Ask yourself how GenAI will directly enhance your current operations, unlock new revenue streams, or improve customer experience. Without a tangible benefit, the technology itself holds little merit.
  • We identified two broad categories of use cases where GenAI shines: comprehension and generation. Comprehension focuses on analyzing and extracting meaning from data, while generation leverages that understanding to produce entirely new content. Consider which category your use...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Get familiar with the most important tools and concepts used in real scenarios to design GenAI apps
  • Interact with GenAI models to tailor model behavior to minimize hallucinations
  • Get acquainted with a variety of strategies and an easy to follow 4 step frameworks for integrating GenAI into applications

Description

Explore the transformative potential of GenAI in the application development lifecycle. Through concrete examples, you will go through the process of ideation and integration, understanding the tradeoffs and the decision points when integrating GenAI. With recent advances in models like Google Gemini, Anthropic Claude, DALL-E and GPT-4o, this timely resource will help you harness these technologies through proven design patterns. We then delve into the practical applications of GenAI, identifying common use cases and applying design patterns to address real-world challenges. From summarization and metadata extraction to intent classification and question answering, each chapter offers practical examples and blueprints for leveraging GenAI across diverse domains and tasks. You will learn how to fine-tune models for specific applications, progressing from basic prompting to sophisticated strategies such as retrieval augmented generation (RAG) and chain of thought. Additionally, we provide end-to-end guidance on operationalizing models, including data prep, training, deployment, and monitoring. We also focus on responsible and ethical development techniques for transparency, auditing, and governance as crucial design patterns.

Who is this book for?

This book is not an introduction to AI/ML or Python. It offers practical guides for designing, building, and deploying GenAI applications in production. While all readers are welcome, those who benefit most include: Developer engineers with foundational tech knowledge Software architects seeking best practices and design patterns Professionals using ML for data science, research, etc., who want a deeper understanding of Generative AI Technical product managers with a software development background This concise focus ensures practical, actionable insights for experienced professionals

What you will learn

  • Concepts of GenAI: pre-training, fine-tuning, prompt engineering, and RAG
  • Framework for integrating AI: entry points, prompt pre-processing, inference, post-processing, and presentation
  • Patterns for batch and real-time integration
  • Code samples for metadata extraction, summarization, intent classification, question-answering with RAG, and more
  • Ethical use: bias mitigation, data privacy, and monitoring
  • Deployment and hosting options for GenAI models

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 05, 2024
Length: 218 pages
Edition : 1st
Language : English
ISBN-13 : 9781835887615
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Sep 05, 2024
Length: 218 pages
Edition : 1st
Language : English
ISBN-13 : 9781835887615
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 73.97 107.97 34.00 saved
Generative AI Application Integration Patterns
€25.99 €37.99
Python Natural Language Processing Cookbook
€22.99 €33.99
AI-Assisted Programming for Web and Machine Learning
€24.99 €35.99
Total 73.97 107.97 34.00 saved Stars icon

Table of Contents

12 Chapters
Introduction to Generative AI Patterns Chevron down icon Chevron up icon
Identifying Generative AI Use Cases Chevron down icon Chevron up icon
Designing Patterns for Interacting with Generative AI Chevron down icon Chevron up icon
Generative AI Batch and Real-Time Integration Patterns Chevron down icon Chevron up icon
Integration Pattern: Batch Metadata Extraction Chevron down icon Chevron up icon
Integration Pattern: Batch Summarization Chevron down icon Chevron up icon
Integration Pattern: Real-Time Intent Classification Chevron down icon Chevron up icon
Integration Pattern: Real-Time Retrieval Augmented Generation Chevron down icon Chevron up icon
Operationalizing Generative AI Integration Patterns Chevron down icon Chevron up icon
Embedding Responsible AI into Your GenAI Applications Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

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
How can I make a purchase on your website? Chevron down icon Chevron up icon

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)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • 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
What eBook formats do Packt support? Chevron down icon Chevron up icon

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.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • 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
What is an eBook? Chevron down icon Chevron up icon

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.