Overview
This book explains how to build and test products around large language models, from helpful assistants to agents integrated into workflows. It covers retrieval-augmented generation (RAG), tool use, evaluation, and release decisions. Changing the information and tools available to an existing model can extend a product’s capabilities without retraining the model for every change.
The five Parts follow one development path.
- Part I: explains what enters and leaves a model request.
- Part II: develops ways to measure answer quality.
- Part III: supplies information from external sources.
- Part IV: examines controlled multi-step processes and tool use.
- Part V: brings these methods together in complete cases and decisions about release.
The capabilities introduced across these Parts build on one another. An external document can support an answer only after the application selects relevant content and includes it in the request. A proposed tool call affects another system when application code submits it and the receiving service carries it out. The application must check permissions, arguments, and any required approval before submitting the call. The map below shows how the model fits within the software that supplies information, checks results, and controls actions.
The side panel groups responsibilities around a request: finding relevant records, removing sensitive details during request assembly, checking the answer against its sources, controlling actions with permission checks, retry limits, and approval, and logging the outcome for later review.
Foundations and inspiration
The book’s topics and examples were inspired in part by Nebius Academy courses.
The explanations draw on research papers, official software documentation and textbooks. Citations identify the sources for methods and findings. Published experimental results are discussed with their tested conditions and limits. Invented examples illustrate calculations and processes.
The following sources provide background and further reading:
- The NIST AI Risk Management Framework 1.0 places measurement within the broader management of AI risks.1
- NIST’s Generative AI Profile extends that guidance to risks relevant to generative AI.2
- Bommasani et al.’s On the Opportunities and Risks of Foundation Models explains the broad training and adaptation that define foundation models.3
Recent papers from NeurIPS and other machine learning and natural language processing conferences also inform the book.
The development activities covered in this book include defining requirements, preparing model requests, evaluating results, logging execution, and making release decisions. The table maps these activities and their records to the NIST AI Risk Management Framework (AI RMF 1.0)4 and its Generative AI Profile (NIST AI 600-1)5, and to five ISO/IEC standards: AI risk management (23894)6, AI system life-cycle processes (5338)7, AI system quality (25059)8, requirements engineering (29148)9, and AI management systems (42001)10.
NIST subcategories are cited by their identifiers in AI RMF 1.0. Risk names in the Generative AI Profile column follow NIST AI 600-1. The ISO/IEC standards are mapped by their published scope, because their full texts define clauses this book does not reproduce.
The mapping identifies engineering records relevant to the listed outcomes and topics. It does not certify conformance with any framework or standard.
| Book step | Sections | NIST AI RMF 1.0 | NIST AI 600-1 risk | ISO/IEC standard |
|---|---|---|---|---|
| Product requirements, risk tolerance, and error costs | 5.1 | MAP 1.4, 1.5, 1.6, 3.2 | - | 29148, 25059 |
| Task scope, output specification, and non-goals | 2.1, 2.4, 14.3 | MAP 3.3 | - | 29148 |
| Evaluation criteria, golden set, and slices | 4.1, 4.2 | MAP 2.3; MEASURE 1.1, 2.3 | - | 25059 |
| Baselines, run records, and test documentation | 5.2, 5.3, 13.1 to 13.4 | MEASURE 2.1 | - | 5338 |
| Uncertainty, release thresholds, and failure slices | 4.8, 5.4, 5.5 | MEASURE 2.5; MANAGE 1.1 | - | 5338 |
| Metrics, judge models, and human review | 4.3 to 4.7 | MEASURE 2.13 | - | 25059 |
| Grounded answers and evidence checks | 6.6, 7.1 to 7.4 | MEASURE 2.5, 2.9 | Confabulation | 25059 |
| Instruction priority, prompt injection, and tool authorization | 3.5, 9.2, 9.8 | MEASURE 2.7 | Information security | 23894 |
| Validators and human approval | 8.7 | MAP 3.5 | Human-AI configuration | 23894 |
| Access filters and memory deletion | 6.5, 11.3, 11.4 | MEASURE 2.10 | Data privacy | 23894 |
| Traces and the release decision record | 12.3, 12.5, 14.3 | MEASURE 2.8; MANAGE 1.1, 1.3 | - | 23894, 5338 |
| Validation after release | 14.4 | MEASURE 2.4, 3.1, 3.3; MANAGE 2.4, 4.1, 4.3 | - | 5338 |
| Organizational governance | Not covered | GOVERN function | - | 42001 |
This mapping uses the editions cited here. Later editions may change subcategories or clauses.
References and appendices
Logging guidance, three appendices, a Glossary, and a References section support the fourteen chapters:
- Logging: Chapter 13 explains what to log at each stage, established practices, and logging tools.
- Libraries and interfaces: Appendix A lists packages, models, interfaces and runtime tools, with installation commands and official links.
- Practice questions and Answers: Appendices B and C cover design and diagnosis questions and the reasoning needed to answer them.
- Glossary and References: Key definitions, papers, and dated documentation.
The examples assume basic Python, HTTP APIs, JSON, and school-level algebra and probability. Language-model concepts and the additional mathematics used here are explained where needed. No prior knowledge of a particular model provider or software library is required.
Readers already familiar with request handling and evaluation can start with retrieval, multi-step tool use, or the integrated cases, then follow links back to earlier explanations when needed.
Tabassi, E. (2023). Artificial Intelligence Risk Management Framework (AI RMF 1.0) (NIST AI 100-1). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.AI.100-1. The framework organizes outcomes under the GOVERN, MAP, MEASURE, and MANAGE functions and is intended for voluntary use.↩︎
National Institute of Standards and Technology. (2024). Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1). U.S. Department of Commerce. https://doi.org/10.6028/NIST.AI.600-1. The profile discusses risks relevant to generative AI, including confabulation, data privacy, human-AI configuration, and information security, where it discusses prompt injection.↩︎
Bommasani, R., Hudson, D. A., Adeli, E., Altman, R., Arora, S., von Arx, S., Bernstein, M. S., Bohg, J., Bosselut, A., Brunskill, E., Brynjolfsson, E., Buch, S., Card, D., Castellon, R., Chen, A., Creel, K., Davis, J. Q., Demszky, D., . . . Liang, P. (2021). On the opportunities and risks of foundation models. Stanford Center for Research on Foundation Models. https://arxiv.org/abs/2108.07258.↩︎
Tabassi, E. (2023). Artificial Intelligence Risk Management Framework (AI RMF 1.0) (NIST AI 100-1). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.AI.100-1. The framework organizes outcomes under the GOVERN, MAP, MEASURE, and MANAGE functions and is intended for voluntary use.↩︎
National Institute of Standards and Technology. (2024). Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1). U.S. Department of Commerce. https://doi.org/10.6028/NIST.AI.600-1. The profile discusses risks relevant to generative AI, including confabulation, data privacy, human-AI configuration, and information security, where it discusses prompt injection.↩︎
International Organization for Standardization & International Electrotechnical Commission. (2023). Information technology: Artificial intelligence: Guidance on risk management (ISO/IEC 23894:2023). https://www.iso.org/standard/77304.html. The standard gives guidance on managing risk specific to AI for organizations that develop, deploy, or use AI.↩︎
International Organization for Standardization & International Electrotechnical Commission. (2023). Information technology: Artificial intelligence: AI system life cycle processes (ISO/IEC 5338:2023). https://www.iso.org/standard/81118.html. The standard defines life-cycle processes for AI systems based on ISO/IEC/IEEE 15288 and 12207.↩︎
International Organization for Standardization & International Electrotechnical Commission. (2023). Software engineering — Systems and software Quality Requirements and Evaluation (SQuaRE) — Quality model for AI systems (ISO/IEC 25059:2023). https://www.iso.org/standard/80655.html. The published abstract describes a common model for specifying, measuring and evaluating AI-system quality; this mapping does not reproduce the standard’s full clauses.↩︎
International Organization for Standardization, International Electrotechnical Commission, & Institute of Electrical and Electronics Engineers. (2018). Systems and software engineering — Life cycle processes — Requirements engineering (ISO/IEC/IEEE 29148:2018). https://www.iso.org/standard/72089.html. The published abstract describes requirements-engineering processes and their information items across the life cycle.↩︎
International Organization for Standardization & International Electrotechnical Commission. (2023). Information technology: Artificial intelligence: Management system (ISO/IEC 42001:2023). https://www.iso.org/standard/81230.html. The standard specifies requirements for establishing, maintaining, and improving an AI management system in an organization.↩︎