
Get the eBook free when you register your print book at Manning.
When you need a language model to respond accurately and quickly about a specific field of knowledge, the sprawling capacity of a LLM may hurt more than it helps. This book teaches you to build generative AI models optimized for specific fields.
Perfect for cost- or hardware-constrained environments, Small Language Models (SLMs) train on domain specific data for high-quality results in specific tasks. In this book you’ll develop SLMs that can generate everything from Python code to protein structures and antibody sequences—all on commodity hardware.
In Domain-Specific Small Language Models you’ll discover:
• Model sizing best practices
• Open source libraries, frameworks, utilities and runtimes
• Fine-tuning techniques for custom datasets
• Hugging Face’s libraries for SLMs
• Running SLMs on commodity hardware
• Model optimization or quantization
Foreword by Matthew R. Versaggi.
About the technology
Small-footprint language models trained on custom data sets and hosted locally can perform as well as large generalist models in speed and accuracy, often at a fraction of the cost. Domain-Specific Small Language Models shows you how to build privacy-preserving and regulation-compliant SLMs for agentic systems, specialist applications, and deployment on the edge.
About the book
This is a practical book that shows you how to adapt pretrained open source models to your domain using transfer learning and parameter-efficient fine-tuning. You’ll learn to minimize cost through optimization and quantization, develop secure APIs to serve your models, and deploy SLMs on commodity hardware—including small devices. The hands-on examples include integrating SLMs into RAG systems and agentic workflows.
What’s inside
• ONNX and other quantization methods
• Integrate SLMs into end-to-end applications
• Deploy SLMs on laptops, smartphones, and other devices
About the reader
For AI engineers familiar with Python.
About the author
Guglielmo Iozzia is a Director of AI and Applied Mathematics at Merck & Co. and a Distinguished Member of the American Society for Artificial Intelligence. He specializes in AI biomedical applications.
The technical editor on this book was Riccardo Mattivi.
Table of Contents
Part 1
1 Small language models
Part 2
2 Tuning for a specific domain
3 End-to-end transformer fine-tuning
4 Running inference
5 Exploring ONNX
6 Quantizing for your production environment
Part 3
7 Generating Python code
8 Generating protein structures
Part 4
9 Advanced quantization techniques
10 Profiling insights
11 Deployment and serving
12 Running on your laptop
13 Creating end-to-end LLM applications
14 Advanced components for LLM applications
15 Test-time compute and small language models
From the Publisher


“Gives the reader a jumpstart toward making efficient, focused models with well-controlled data.”
Janelle Shane, AI Weirdness

“Effectively cuts through the hype to focus on the tangible business value of localized, efficient artificial intelligence.”
Luca Longo, University College Cork

“A timely and much-needed reference for both researchers and industry practitioners.”
Ahmed Serag, Weill Cornell Medicine

why this book?
Domain-Specific Small Language Models shows how to build compact AI models tuned to a specific industry, workflow, or dataset, rather than relying on oversized general-purpose LLMs.
Readers learn practical techniques for fine-tuning, evaluation, deployment, and optimization, enabling them to run capable models with lower latency, lower infrastructure costs, and tighter control over data and outputs.
The book also helps engineers understand when small language models outperform larger systems in production, especially in environments where privacy, speed, and reliability matter more than raw parameter count.

about Manning
Manning helps developers and tech professionals stay ahead in a fast-moving industry with expert-led books, videos, and projects. Learning never stops, but it’s hard to keep up, so we focus on content that’s practical, clear, and trusted. As an independent publisher, we adapt quickly, from pioneering early-access books to offering DRM-free eBooks. Our series, like “In Action” and “In a Month of Lunches”, reflect a commitment to making complex topics accessible.
Publisher : Manning Publications
Publication date : May 26, 2026
Language : English
Print length : 376 pages
ISBN-10 : 1633436705
ISBN-13 : 978-1633436701
Item Weight : 12.7 ounces
Dimensions : 7.38 x 0.85 x 9.25 inches
Best Sellers Rank: #81,748 in Books (See Top 100 in Books) #34 in Python Programming #37 in Natural Language Processing (Books) #65 in Computer Programming Languages
Customer Reviews: 4.9 4.9 out of 5 stars (33) var dpAcrHasRegisteredArcLinkClickAction; P.when(‘A’, ‘ready’).execute(function(A) { if (dpAcrHasRegisteredArcLinkClickAction !== true) { dpAcrHasRegisteredArcLinkClickAction = true; A.declarative( ‘acrLink-click-metrics’, ‘click’, { “allowLinkDefault”: true }, function (event) { if (window.ue) { ue.count(“acrLinkClickCount”, (ue.count(“acrLinkClickCount”) || 0) + 1); } } ); } }); P.when(‘A’, ‘cf’).execute(function(A) { A.declarative(‘acrStarsLink-click-metrics’, ‘click’, { “allowLinkDefault” : true }, function(event){ if(window.ue) { ue.count(“acrStarsLinkWithPopoverClickCount”, (ue.count(“acrStarsLinkWithPopoverClickCount”) || 0) + 1); } }); });
