Buy New
-
To see product details, add this item to your cart.
Ships from: Amazon.com Sold by: Amazon.com
Used - Very Good
-
To see product details, add this item to your cart.
Ships from: Bay State Book Company Sold by: Bay State Book Company
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the authors
OK
Prompt Engineering for LLMs: The Art and Science of Building Large Language Model-Based Applications
Purchase options and add-ons
Large language models (LLMs) are revolutionizing the world, promising to automate tasks and solve complex problems. A new generation of software applications are using these models as building blocks to unlock new potential in almost every domain, but reliably accessing these capabilities requires new skills. This book will teach you the art and science of prompt engineering-the key to unlocking the true potential of LLMs.
Industry experts John Berryman and Albert Ziegler share how to communicate effectively with AI, transforming your ideas into a language model-friendly format. By learning both the philosophical foundation and practical techniques, you'll be equipped with the knowledge and confidence to build the next generation of LLM-powered applications.
- Understand LLM architecture and learn how to best interact with it
- Design a complete prompt-crafting strategy for an application
- Gather, triage, and present context elements to make an efficient prompt
- Master specific prompt-crafting techniques like few-shot learning, chain-of-thought prompting, and RAG
- ISBN-101098156153
- ISBN-13978-1098156152
- Edition1st
- PublisherO'Reilly Media
- Publication dateDecember 31, 2024
- LanguageEnglish
- Dimensions7 x 0.59 x 9.19 inches
- Print length280 pages
Frequently bought together

Customers who viewed this item also viewed
- AI Engineering: Building Applications with Foundation ModelsPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI OutputsPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Hands-On Large Language Models: Language Understanding and GenerationPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Build a Large Language Model (From Scratch)PaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- LLM Engineer's Handbook: Master the art of engineering large language models from concept to productionPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Designing Machine Learning Systems: An Iterative Process for Production-Ready ApplicationsPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
Customers also bought or read
- Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs
Paperback$50.00$50.00FREE delivery Sat, Sep 19 - AI Engineering: Building Applications with Foundation Models#1 Best SellerEnterprise Applications
Paperback$52.40$52.40FREE delivery Sat, Sep 19 - LLMs in Production: From language models to successful products
Paperback$48.13$48.13FREE delivery Sat, Sep 19 - Building LLMs for Production: Enhancing LLM Abilities and Reliability with Prompting, Fine-Tuning, and RAG
Paperback$43.38$43.38FREE delivery Mon, Sep 21 - LLM Engineer's Handbook: Master the art of engineering large language models from concept to production
Paperback$39.99$39.99FREE delivery Sep 19 - 21 - Hands-On Large Language Models: Language Understanding and Generation
Paperback$37.68$37.68FREE delivery Sat, Sep 19 - Building Applications with AI Agents: Designing and Implementing Multiagent Systems
Paperback$56.44$56.44FREE delivery Sat, Sep 19 - AI Agents in Action: Build, orchestrate, and deploy autonomous multi-agent systems
Paperback$59.99$59.99 - Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications
Paperback$40.00$40.00FREE delivery Sat, Sep 19 - Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph
Paperback$55.01$55.01FREE delivery Sat, Sep 19 - Build a Large Language Model (From Scratch)#1 Best SellerComputer Neural Networks
Paperback$49.24$49.24FREE delivery Sat, Sep 19 - Building AI Agents with LLMs, RAG, and Knowledge Graphs: A practical guide to autonomous and modern AI agents
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - Generative AI Design Patterns: Solutions to Common Challenges When Building GenAI Agents and Applications
Paperback$68.99$68.99FREE delivery Sat, Sep 19 - Designing Large Language Model Applications: A Holistic Approach to LLMs
Paperback$54.44$54.44FREE delivery Sat, Sep 19 - Building LLM Powered Applications: Create intelligent apps and agents with large language models
Paperback$39.99$39.99FREE delivery Mon, Sep 21 - Context Engineering for Multi-Agent Systems: Move beyond prompting to build a Context Engine, a transparent architecture of context and reasoning
Paperback$37.99$37.99FREE delivery Mon, Sep 21 - Generative AI with LangChain: Build production-ready LLM applications and advanced agents using Python, LangChain, and LangGraph
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - AI-Assisted Programming: Better Planning, Coding, Testing, and Deployment
Paperback$39.20$39.20FREE delivery Sat, Sep 19 - Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents
Paperback$46.39$46.39FREE delivery Mon, Sep 21 - Unlocking Data with Generative AI and RAG: Enhance generative AI systems by integrating internal data with large language models using RAG
Paperback$44.99$44.99FREE delivery Mon, Sep 21 - Natural Language Processing with Transformers, Revised Edition
Paperback$41.60$41.60FREE delivery Sat, Sep 19 - Agentic Coding with Claude Code: The everyday developer's guide to agentic coding with Claude Code
Paperback$36.33$36.33FREE delivery Mon, Sep 21 - Knowledge Graphs and LLMs in Action: Build AI systems using connected data
Paperback$55.99$55.99FREE delivery Sat, Sep 19 - AI Systems Performance Engineering: Optimizing Model Training and Inference Workloads with GPUs, CUDA, and PyTorch#1 Best SellerComputer Hardware Design & Architecture
Paperback$86.07$86.07FREE delivery Sat, Sep 19 - LLM Design Patterns: A Practical Guide to Building Robust and Efficient AI Systems
Paperback$42.99$42.99FREE delivery Sat, Sep 19 - Generative AI with Python and PyTorch: Navigating the AI frontier with LLMs, Stable Diffusion, and next-gen AI applications
Paperback$32.99$32.99Delivery Mon, Sep 21 - The Hundred-Page Language Models Book: hands-on with PyTorch (The Hundred-Page Books)
Paperback$46.95$46.95FREE delivery Mon, Sep 21 - Generative Deep Learning: Teaching Machines To Paint, Write, Compose, and Play
Paperback$47.37$47.37FREE delivery Sat, Sep 19 - Learn Model Context Protocol with Python: Build agentic systems in Python with the new standard for AI capabilities
Paperback$32.47$32.47Delivery Oct 6 - 14
From the brand
-
Browse more NLP & LLM books
-
Machine Learning, AI & more
-
More from O'Reilly
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface
This book is written for application engineers. If you build software products that customers use, then this book is for you. If you build internal applications or data-processing workflows, then this book is also for you. The reason that we are being so inclusive is because we believe that the usage of LLMs will soon become ubiquitous. Even if your day-to-day work doesn’t involve prompt engineering or LLM workflow design, your codebase will be filled with usages of LLMs, and you’ll need to understand how to interact with them just to get your job done.
However, a subset of application engineers will be the dedicated LLM wranglers—these are the prompt engineers. It’s their job to convert problems into a packet of information that the LLM can understand—which we call the prompt—and then convert the LLM completions back into results that bring value to those who use the application. If this is your current role—or if you want this to be your role—then this book is especially for you.
LLMs are very approachable—you speak with them in natural language. So, for this book, you won’t be expected to know everything about machine learning. But you do need to have a good grasp of basic engineering principles—you need to know how to program and how to use an API. Another prerequisite for this book is the ability to empathize, because unlike with any technology before, you need to understand how LLMs “think” so that you can guide them to generate the content you need. This book will show you how.
What You Will Learn
The goal of this book is to equip you with all the theory, techniques, tips, and tricks you need to master prompt engineering and build successful LLM applications.
In Part I of the book, we convey a foundational understanding of LLMs, their inner workings, and their functionality as text completion engines. We cover the extension of LLMs to their new role as chat engines, and we present a high-level approach to LLM application development.
In Part II, we introduce the core techniques for prompt engineering—how to source context information, rank its importance for the task at hand, pack the prompt (without overloading it), and organize everything into a template that will result in high-quality completions that elicit the answer you need.
In Part III, we move to more advanced techniques. We assemble loops, pipelines, and workflows of LLM inference to create conversational agency and LLM-driven workflows, and we then explain techniques for evaluating LLMs.
Throughout this book, we highlight one principle that underlies all others:
If you process that statement deeply, then you’ll arrive at the same conclusions that we share throughout this book: when you want an LLM to behave a certain way, you have to shape the prompt to resemble patterns seen in training data—use clear language, rely upon existing patterns rather than creating new ones, and don’t drown the LLM in superfluous content. Once you master prompt engineering, you can build upon these skills by creating conversation agency and workflows—the dominant paradigms for LLM applications.
Editorial Reviews
About the Author
Before his work on Copilot, John built an impressive career as a search engineer. His diverse experience includes helping to develop next-generation search system for the US Patent Office, building search and recommendations for Eventbrite, and contributing to GitHub's code search infrastructure. John is also coauthor of Relevant Search (Manning), a book that distills his expertise in the field.
John's unique background, spanning both cutting-edge AI applications and foundational search technologies, positions him at the forefront of innovation in LLM applications and information retrieval.
Albert Ziegler has been designing AI-driven systems long before LLM applications became mainstream. As founding engineer for GitHub Copilot, he designed its prompt engineering system and helped inspire a wave of AI-powered tools and "Copilot" applications, shaping the future of developer assistance and LLM applications.
Today, Albert continues to push the boundaries of AI technology as Head of AI at XBOW, an AI cybersecurity company. There, he leads efforts blending large language models with cutting-edge security applications to secure the digital world of tomorrow.
Product details
- Publisher : O'Reilly Media
- Publication date : December 31, 2024
- Edition : 1st
- Language : English
- Print length : 280 pages
- ISBN-10 : 1098156153
- ISBN-13 : 978-1098156152
- Item Weight : 1.03 pounds
- Dimensions : 7 x 0.59 x 9.19 inches
- Best Sellers Rank: #148,580 in Books (See Top 100 in Books)
- #10 in Web Services
- #52 in Natural Language Processing (Books)
- #693 in Computer Science (Books)
- Customer Reviews:
About the authors

John Berryman is the founder and principal consultant of Arcturus Labs, where he specializes in LLM application development. His expertise helps businesses harness the power of advanced AI technologies. As an early engineer on GitHub Copilot, John contributed to the development of its completions and chat functionalities, working at the forefront of AI-assisted coding tools.
Before his work on Copilot, John built an impressive career as a search engineer. His diverse experience includes helping to develop next-generation search system for the US Patent Office, building search and recommendations for Eventbrite, and contributing to GitHub's code search infrastructure. John is also coauthor of Relevant Search (Manning), a book that distills his expertise in the field.
John's unique background, spanning both cutting-edge AI applications and foundational search technologies, positions him at the forefront of innovation in LLM applications and information retrieval.

Albert Ziegler has been designing AI-driven systems long before LLM applications became mainstream. As founding engineer for GitHub Copilot, he designed its prompt engineering system and helped inspire a wave of AI-powered tools and "Copilot" applications, shaping the future of developer assistance and LLM applications.
Today, Albert continues to push the boundaries of AI technology as Head of AI at XBOW, an AI cybersecurity company. There, he leads efforts blending large language models with cutting-edge security applications to secure the digital world of tomorrow.














