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

ManningBooks
Build an AI Agent (From Scratch) is a step-by-step guide to creating a working AI agent, starting with the bare essentials and growing yo...
New
ManningBooks
The bestselling book on Python deep learning, now covering generative AI, Keras 3, PyTorch, and JAX! François Chollet and Matthew ...
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
AI agent technology is changing fast! This totally revised Second Edition of AI Agents in Action by Micheal Lanham guides you through the...
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
Rearchitecting LLMs: Structural techniques for efficient models turns research from the latest AI papers into production-ready practices ...
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
Building LLM Applications with DSPy introduces DSPy best practices you can adopt to create reliable, production-ready systems through pro...
New
ManningBooks
Build Applications with Local AI Models on a Mac shows you exactly how to build and run a ChatGPT-style assistant entirely on your own Ma...
New

Other popular topics Top

New
PragmaticBookshelf
Learn from the award-winning programming series that inspired the Elixir language, and go on a step-by-step journey through the most impo...
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
PragmaticBookshelf
Use advanced functional programming principles, practical Domain-Driven Design techniques, and production-ready Elixir code to build scal...
New
PragmaticBookshelf
Lint your docs like code: turn any style guide into enforceable rules with Vale and publish clear, consistent content every time. ...
New