Write, refine, organize, and optimize AI prompts that generate relevant and useful text and images!
Generative AI models such as ChatGPT, Stable Diffusion, and Gemini can produce amazingly “human-like” news articles, document summaries, images, computer code, and more—if you know how to write effective prompts. This book will teach you the prompt design and authoring skills you need to get useful and relevant responses from AI models, along with advanced prompting techniques for Retrieval Augmented Generation (RAG), building autonomous agents, and data privacy.
AI Engineering in Practice teaches you how to:
Design prompts that generate accurate and readable responses from LLMs
Mitigate hallucinations in LLM output
Domain-aware content generation using RAG
How AI model design affects your prompts
Evaluate, optimize, and organize your prompts
Prompt engineering is the discipline of writing instructions for AI models to generate relevant, accurate, and usable completions. AI Engineering in Practice shows you how to engineer prompts that ensure the outputs of LLMs and other generative AI models exactly match your requirements. You’ll learn how to structure your objectives, take advantage of contextual details, and even pick the right model for your task.
about the reader
No special skills with AI or machine learning required. Code examples are in Python.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical field guide to turning ad-hoc prompting into dependable production systems: it teaches prompt design, RAG grounding, routing, validation, and agent architectures for anyone building real applications on LLMs. Best for developers, product engineers, and technical leads who need reliability, cost control, and measurable quality—not just clever one-off prompts.
【Book Arc】
- **Opening (~0%–10%)**: Frames the core problem—ad-hoc prompting collapses at production scale—using contrasting cases (a hallucinating airline chatbot vs. a high-volume engineered assistant) and introduces the five-layer blueprint: routing, RAG, prompting, validation, and integration.
- **Early (~10%–28%)**: Walks through a single customer transaction to show how the layers interact, then pivots to foundation-model fundamentals: why they are called foundation models, their applications, and the architectural logic behind reliable systems.
- **Middle (~28%–47%)**: Explains how models are built and behave—data collection and preprocessing, Transformer self-attention, training objectives, instruction fine-tuning, evaluation methods (perplexity, human ratings, benchmarks), and inference-time generation controls.
- **Late (~47%–60%)**: Covers distribution and operational trade-offs: commercial APIs vs. open-source deployment, quantization, inference engines, LoRA fine-tuning, token costs, latency, observability, and security risks like prompt injection.
- **Ending (~60%+ of indexed excerpts)**: The excerpts do not cover the later chapters in detail; the book's stated structure promises advanced material on chaining prompts into workflows, intelligent routing, RAG implementation, autonomous agents, and operational practices.
【Key Takeaways】
- **Production reliability comes from layered defenses, not better prompts alone** (Opening): routing, RAG grounding, validation, and integration convert isolated model calls into dependable systems.
- **The demo-to-production gap is an engineering problem** (Opening): single-case success fails at scale, exposing edge cases, context limits, cost explosions, and security vulnerabilities invisible in testing.
- **Prompt routing is a major cost lever** (Early): classifying query complexity and sending simple requests to lightweight models can cut monthly API bills dramatically compared to sending everything to premium models.
- **RAG grounds responses in verified knowledge** (Early): vector databases retrieve semantically relevant documents—not just keyword matches—and inject them as authoritative context, sharply reducing hallucinations.
- **Foundation models are general-purpose bases, not task-specific tools** (Early): a single pretrained model can be specialized, extended, or prompted into many different applications without starting from scratch.
- **Model behavior is shaped by training and inference choices** (Middle): data quality, architecture, context length, parameter count, token budget, and generation parameters all affect what you get back.
- **Evaluation needs multiple methods** (Middle): perplexity catches regressions, human ratings guide quality, and benchmarks like HELM and MMLU compare models across domains.
- **Deployment involves real trade-offs** (Late): APIs offer ease and state-of-the-art access; open-source models offer control at the cost of complexity, with quantization, inference engines, and observability tools as key operational concerns.
【Reading Tips】
- **Deep-read the opening chapter**: the five-layer blueprint and the transaction walkthrough are the mental model for everything that follows—skim later if you already know foundation-model basics.
- **Skim the model-fundamentals chapter if you have ML background**: the training, preprocessing, and Transformer material is useful context but not the book's core value.
- **Treat the architecture layers as a checklist**: as you read, map each technique (routing, RAG, validation, integration) to your own system's weak points.
- **Pay attention to cost and latency examples**: the routing math and operational trade-offs are where engineering discipline translates into real savings.
- **Note the Python code examples**: the book assumes no AI/ML expertise, so hands-on readers can follow along without special setup.
【Coverage Limits】
This guide is based on stratified excerpts covering roughly the first half of the book; the later chapters on RAG implementation, autonomous agents, and advanced operational practices are referenced but not detailed in the available material.
Page 4
ut of this book, you should have a general understanding of computer usage and be familiar with the concept of artificial intelligence. Previous programming...
rst hits the intelligent router, which analyzes the text to classify it as a PAYMENT_ISSUE with COMPLEX difficulty. This classification determines routing; t...
er prompts, avoid common pitfalls, and build smarter tools. You don’t need a PhD in machine learning. But knowing the building blocks will make you a more po...
requirements, making it easier to run on smaller hardware. To serve models efficiently in production, developers rely on optimized inference engines like vLL...
elf. To build reliable applications, developers must manage operational constraints like token limits, computational costs, and the model's lack of real-time...
rn to request a news article about a recent political event. Include an appropriate indicator (e.g., “News Article:”) to instruct the model to start its stru...
ty and effectiveness of this combination therapy in humans. Significance: This groundbreaking study offers hope for Alzheimer's patients, potentially providi...
ack Friday Upgrade"). The generic approach uses predictable promotional language that lacks strategic insight about what drives email engagement. Notice how...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
AI Engineering in Practice (MEAP) (Richard Davies, Rafael Fischer) (z-library.sk, 1lib.sk, z-lib.sk)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
AI Engineering in Practice (MEAP) (Richard Davies, Rafael Fischer) (z-library.sk, 1lib.sk, z-lib.sk)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment