Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
LLMs in Enterprise
LLMs in Enterprise

LLMs in Enterprise: Design strategies for large language model development, design patterns and best practices

Arrow left icon
Profile Icon Ahmed Menshawy Profile Icon Mahmoud Fahmy
Arrow right icon
Early Access Early Access Publishing in Aug 2025
€29.99
Paperback Aug 2025 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Ahmed Menshawy Profile Icon Mahmoud Fahmy
Arrow right icon
Early Access Early Access Publishing in Aug 2025
€29.99
Paperback Aug 2025 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

LLMs in Enterprise

1 Introduction to Large Language Models (LLMs)

Join our book community on Discord

https://packt.link/EarlyAccess/

Artificial Intelligence (AI) refers to computer systems designed to augment human intelligence, providing tools that enhance productivity by automating complex tasks, analyzing vast amounts of data, and assisting with decision-making processes. Large Language Models (LLMs) are advanced AI applications capable of understanding and generating human-like text. These models function based on the principles of machine learning, where they process and transform vast datasets to learn the nuances of human language. A key feature of LLMs is their ability to generate coherent, natural-sounding outputs, making them an essential tool for building applications ranging from automated customer support to content generation and beyond.

LLMs are a subset of models in the field of natural language processing (NLP), which is itself a critical area of AI. The field of NLP is all about bridging...

Historical Context and Evolution of Language Models (LMs)

There are several misconceptions surrounding LMs, notably the belief that they were invented by OpenAI. However, the idea of LMs is not just a few years old, it actually spans several decades. As illustrated in figure 1.2, the concept behind some LMs is quite intuitive: given an input sequence, the task of the model is to predict the next token:

Figure 1.2: LMs and prediction of next token given the previous words (context)

To truly appreciate the sophistication of modern LMs, it's essential to explore the historical evolution and the diverse range of disciplines from which they draw inspiration, all the way up to the recent transformative developments we are currently witnessing.

Early Developments

The origins of LMs can be traced back several decades, originating in the foundational work on statistical models for natural language processing. Early LMs primarily utilized basic statistical methods, such as n-gram models...

Evolutions of LLMs Architectures

The development of language model architectures has undergone a transformative journey as shown in Figure 1.5, tracing its origins from simple word embeddings to sophisticated models capable of understanding and generating multimodal content. This progression is elegantly depicted in figure X about the "LLM Evolutionary Tree" that starts from foundational models before 2018, such as FastText, GloVe, and Word2Vec, and extends to the latest advancements like the LLaMA series and Google's Bard.

Figure 1.5: A timeline of LLMs development. Image Credit

Let's look at this evolution in a bit more detail:

Early Foundations: Word Embeddings

Initially, models like FastText, GloVe, and Word2Vec represented words as vectors in high-dimensional space, capturing semantic and syntactic similarities based on their co-occurrence in large text corpora. These embeddings provided a static representation of words, serving as the backbone for many early...

GPT Assistant Training Recipe

Before diving into the specifics of how GPT assistants like ChatGPT are developed, it's essential to understand the foundational elements and methodologies involved in training these advanced language models. The process includes several stages, each contributing to the model's ability to comprehend and generate human-like text.

The diagram in figure 1.7 illustrates the standard training recipe used to develop a GPT assistant, such as ChatGPT. This process is divided into four distinct stages, each crucial for evolving a basic neural network into an advanced AI capable of understanding and generating profound and convincing human-like text.

Figure 1.7: Training stages of GPT assistants

Let's start with the first and most computationally intensive stage which is for building the base model from internet scale data.

Building the Base Model

The first stage in the training of LLMs such as GPTs is the creation of a robust base model. This foundational...

Decoding the Realities and Myths of LLMs

LLMs like OpenAI's GPT series have sparked widespread intrigue and debate across the tech world and beyond. While they are often seen as groundbreaking advancements, there are numerous misconceptions and exaggerated claims surrounding their capabilities and origins. This section aims to clarify these misunderstandings by exploring the historical development of LLMs, addressing common myths, and examining their real-world applications and limitations.

From their early statistical underpinnings to the sophisticated neural networks, we see today, as you've seen earlier in this chapter, the evolution of language models has been a collaborative and incremental process, contrary to the notion that they suddenly emerged from a single innovator or institution. Additionally, we will discuss the critical insights of Ada Lovelace, which remain profoundly relevant in understanding the fundamental nature of these models, as well as the limitations...

Objective-Driven AI

The concept of objective-driven AI, depicted in figure 1.14, proposed by AI pioneer Yann LeCun, represents a potential pathway towards more sophisticated forms of artificial intelligence, potentially leading to Artificial General Intelligence (AGI). This approach focuses on designing AI systems that can learn and plan to achieve specific objectives in complex environments, moving beyond mere pattern recognition to incorporate elements of reasoning, planning, and decision-making.

LeCun argues that for AI to reach the level of general intelligence, it must have the ability to learn models of the world that allow it to predict and manipulate its environment. This would involve not just responding to inputs based on learned data but actively seeking information and learning causality, thus developing a more profound, actionable understanding of its surroundings.

Figure 1.14: Objective driven-AI by Yann LeCun

Human-Technology Augmentation

Historically, the development of technology has been driven by the desire to augment human capabilities as shown in figure 1.15, reduce labor, and solve complex problems. From the invention of the wheel to the creation of the internet, technological advancements have aimed to extend the physical and cognitive reach of humanity.

In the context of AI and LLMs, a primary goal for many developers is to augment human abilities rather than replace them (irrespective of the doom and gloom often presented in the media or by policymakers). AI systems are increasingly used to enhance decision-making processes, automate routine tasks, and provide insights that are beyond the scope of human capability due to data volume or complexity.

Figure 1.15: Human-technology augmentation

This section addressed common misconceptions and realities about LLMs, particularly how some policymakers use the purported existential risks of AI and the notion of AI taking over as distractions...

Summary

In this chapter, we've embarked on an exploration of LLMs, diving into their historical background, current capabilities, and the common misconceptions that surround these powerful tools. This journey through the development of LLMs not only highlights the technological breakthroughs that have shaped these models but also points toward future advancements and the challenges that lie ahead.

LLMs use an auto-regressive method to predict the next word in a sequence by considering previous words, but this approach has limitations. For instance, the likelihood of errors increases as the sequence lengthens because each prediction carries a chance of error that accumulates over time. Despite their impressive fluency, LLMs cannot truly plan or understand context as humans do, often producing responses that are a mere recombination of learned data without real insight. This is due to their training being limited to existing text, which prevents them from generating novel content or...

Left arrow icon Right arrow icon

Key benefits

  • Design patterns for LLMs and how they can be applied to solve real-world enterprise problems 
  • Strategies for effectively scaling and deploying LLMs in complex enterprise environments 
  • Fine-tuning and optimizing LLMs to achieve better performance and more relevant results.  
  • Staying ahead of the curve by exploring emerging trends and advancements in LLM technologies.

Description

The integration of Large Language Models (LLMs) into enterprise applications marks a significant advancement in how businesses leverage AI for enhanced decision-making and operational efficiency. This book is an essential guide for professionals seeking to integrate LLMs within their enterprise applications. "LLMs in Enterprise" not only demystifies the complexity behind LLM deployment but also provides a structured approach to enhancing decision-making and operational efficiency with AI. Starting with an introduction to the foundational concepts of LLMs, the book swiftly moves to practical applications, emphasizing real-world challenges and solutions. It covers a range of topics from data strategies. We explore various design patterns that are particularly effective in optimizing and deploying LLMs in enterprise environments. From fine-tuning strategies to advanced inferencing patterns, the book provides a toolkit for harnessing the power of LLMs to solve complex challenges and drive innovation in business processes. By the end of this book, you will have a deep understanding of various design patterns for LLMs and how to implement these patterns to enhance the performance and scalability of their Generative AI solutions.

Who is this book for?

​This book targets a diverse group of professionals who are interested in understanding and implementing advanced design patterns for Large Language Models (LLMs) within their enterprise applications, including:  ​​ AI and ML Researchers who are looking into practical applications of LLMs  Data Scientists and ML Engineers who design and implement large-scale Generative AI solutions Enterprise Architects and Technical Leaders who oversee the integration of AI technologies into business processes Software Developers who work on developing scalable Generative AI-powered applications.

What you will learn

  • Design patterns for integrating LLMs into enterprise applications, enhancing both efficiency and scalability 
  • Overcome common scaling and deployment challenges associated with LLMs 
  • Fine-tuning techniques and RAG approaches to improve the effectiveness and efficiency of LLMs
  • Emerging trends and advancements including multimodality and beyond
  • Optimize LLM performance through customized contextual models, advanced inferencing engines, and robust evaluation patterns
  • Ensure fairness, transparency, and accountability in AI applications
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 14, 2025
Edition : 1st
Language : English
ISBN-13 : 9781836203070
Category :
Languages :
Concepts :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Aug 14, 2025
Edition : 1st
Language : English
ISBN-13 : 9781836203070
Category :
Languages :
Concepts :

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

Table of Contents

5 Chapters
LLMs in Enterprise: Design strategies for large language model development, design patterns and best practices Chevron down icon Chevron up icon
1 Introduction to Large Language Models (LLMs) Chevron down icon Chevron up icon
2 LLMs in Enterprise: Applications, Challenges, and Design Patterns Chevron down icon Chevron up icon
4 Fine-Tuning and Retrieval-Augmented Generation(RAG) Strategies Chevron down icon Chevron up icon
5 Customizing Contextual LLMs 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

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela