ManningBooks

ManningBooks

Devtalk Sponsor

Building LLM Applications with DSPy (Manning)

Building LLM Applications with DSPy introduces DSPy best practices you can adopt to create reliable, production-ready systems through proper task definition, evaluation, and optimization. Practical to the core, this book helps you construct a full professional portfolio of AI applications, including an LLM-based classification system, a summarizer, and RAG-based application.

Serj Smorodinsky and William Brett Kennedy

If you’ve built anything serious with LLMs, you’ve probably hit the same wall: the first prompt works surprisingly well, the fifth prompt works worse in a new way, and a week later a model update or dataset shift makes yesterday’s “perfect” wording look fragile. This book is about moving past that cycle.

DSPy gives you a different way to build LLM applications. Instead of hand-writing and endlessly tweaking prompts, you define the task in Python: inputs, outputs, evaluation metrics, modules, and training examples. DSPy then generates and improves prompts through systematic testing.

The book walks through that workflow from the ground up:

  • how prompt programming differs from prompt engineering

  • how DSPy signatures, modules, predictions, examples, metrics, and evaluators fit together

  • how to build an intent classifier with the ATIS airline dataset

  • how to evaluate LLM programs with custom metrics and DSPy’s Evaluate

  • how to test accuracy, consistency, per-class performance, and cost

  • how to improve prompts with optimizers such as LabeledFewShot, BootstrapFewShot, BootstrapFewShotWithRandomSearch, KNN, COPRO, MIPROv2, SIMBA, GEPA, and Ensemble

  • how to think about train, validation, development, and test sets for LLM applications

One of the strongest parts of the book is that it treats LLM work like software and machine learning work, not like prompt folklore. You start with a baseline. You measure it. You improve it. You compare models and modules. You save the best program. You can re-run the process when models change.

The examples are practical: classification, summarization, LLM-as-a-judge, RAG, agentic RAG, and chatbots. The early chapters assume no DSPy background, but the material quickly gets into the parts developers care about when building production systems: evaluation design, optimizer choice, prompt drift, model switching, caching, rate limits, token costs, and debugging prompt history.

Serj Smorodinsky is a DSPy contributor and AI engineer with deep experience in NLP, chatbots, RAG systems, agentic workflows, and LLM evaluation. Brett Kennedy brings decades of software and data science experience. That mix shows in the book: it’s written for people who want clean code, measurable behavior, and systems that can be maintained after the first demo.

If you’ve been curious about DSPy, or if you’re tired of storing giant prompt strings in your codebase and hoping they keep working, this is a strong place to start.


Don’t forget you can get 45% off with your Devtalk discount! Just use the coupon code “devtalk.com” at checkout :+1:

Where Next?

Popular Ai topics Top

New
ManningBooks
Erlang and OTP in Action teaches you the concepts of concurrent programming and the use of Erlang’s message-passing model. It walks you t...
New
ManningBooks
AI Governance: Secure, privacy-preserving, ethical systems presents a structured playbook for safely harnessing the potential of Generati...
New
ManningBooks
After ChatGPT used RLHF to become production-ready, this foundational technique exploded in popularity. In The RLHF Book, AI expert Natha...
New
pragdave
Build a prototype in a weekend or a full product in a month or two. Untangle legacy systems, improve tests and documentation, and tackle ...
New
ManningBooks
Hugging Face in Action reveals how to get the absolute best out of everything Hugging Face, from accessing state-of-the-art models to bui...
New
ManningBooks
CUDA for Deep Learning shows you how to work within the CUDA ecosystem, from your first kernel to implementing advanced LLM features like...
New
ManningBooks
Introduction to Generative AI, Second Edition, guides you from your first eye-opening interaction with tools like ChatGPT to how AI tools...
New
New
ManningBooks
Crack Any Codebase with AI shows you how to use an efficient AI-driven process to quickly and accurately make sense of any software proje...
New

Other popular topics Top

PragmaticBookshelf
Take your Go skills to the next level by learning how to design, develop, and deploy a distributed service. Start from the bare essential...
New
PragmaticBookshelf
Stop developing web apps with yesterday’s tools. Today, developers are increasingly adopting Clojure as a web-development platform. See f...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
PragmaticBookshelf
Build modern server-driven web applications using htmx. Whatever programming language you use, you’ll write less (and cleaner) code. ...
New