Programmatically Developing LLM Prompts With DSPy | Real Python Podcast #306 @realpython
Programmatically Developing LLM Prompts With DSPy | Real Python Podcast #306  @realpython
Uploaded August 2026 | Updated September 2026, 2 weeks ago
How can you move from manually writing prompts for an LLM application toward defining them programmatically? This week on the show, Brett Kennedy returns to discuss his new book "Building LLM Applications with DSPy."

πŸ‘‰ Links from the show: realpython.com/podcasts/rpp/306

With large language models becoming embedded in production software, manual prompt engineering becomes brittle, time-consuming, and difficult to maintain. Brett shares how DSPy replaces manually writing and adjusting prompts with structured prompt programming.

We dig into how DSPy uses declarative signatures to define inputs and outputs. We also discuss how developers programmatically compile, tune, and optimize prompts for specific LLM-based tasks within an application.

Topics:

- 00:00:00 -- Introduction
- 00:01:50 -- Working on a new book
- 00:02:53 -- Writing with a partner
- 00:04:16 -- Building LLM Applications with DSPy
- 00:05:22 -- What is DSPy?
- 00:06:58 -- Working with signatures and typing
- 00:09:53 -- Prompt engineering failing to work for a new model
- 00:13:43 -- What is an optimizer?
- 00:19:04 -- Moving toward a new level of abstraction in prompting
- 00:23:19 -- Prompts for the LLM within a consumer facing application
- 00:28:26 -- Video Course Spotlight
- 00:30:21 -- Example of using with RAG
- 00:38:45 -- Example of a business plan tool
- 00:43:06 -- The Bitter Lesson
- 00:46:03 -- Structure of the book
- 00:49:55 -- Advice on starting with DSPy
- 00:54:15 -- Example of a transformed prompt
- 00:59:37 -- What are you excited about in the world of Python?
- 01:01:47 -- What do you want to learn next?
- 01:04:11 -- What's the best way to follow your work online?
- 01:04:40 -- Thanks and goodbye

πŸ‘‰ Links from the show: realpython.com/podcasts/rpp/306

Download your free Python Cheat Sheet here: realpython.com/cheatsheet
Free Python Skill Test with instant level + learning plan: realpython.com/skill-test
Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: realpython.com/start

🐍 Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at realpython.com

β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°
🐍 Start Here β†’ realpython.com/start
πŸ—ΊοΈ Guided Learning Paths β†’ realpython.com/learning-paths
🎧 Real Python Podcast β†’ realpython.com/podcast

πŸ“š Python Books β†’ realpython.com/books
πŸ“– Python Reference β†’ realpython.com/ref
πŸ§‘β€πŸ’» Quizzes & Exercises β†’ realpython.com/quizzes

πŸŽ“ Live Courses: realpython.com/live
⭐️ Reviews & Learner Stories: realpython.com/learner-stories
β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°
Programmatically Developing LLM Prompts With DSPy | Real Python Podcast #306Stop AI From Missing Edge Cases5 uv Gotchas Python Devs HitCount Your Lines of Code by File Type With TallymanPeople Dont Leave Bad Jobs, They Leave Bad ManagersExploring Pythons Built-in Functions: Math-Related Built-Ins & String Data TypesUnderstanding Mixin Classes in PythonHow Anthropic Targeted IDEs to Win Over DevelopersAccess Multiple AI Models With the OpenRouter APIProgramming in the AI Era: Real Python Office HoursOffice Politics That Quietly Hurt Your Company4 Building Blocks Behind Every AI Agent
Real Python |

Programmatically Developing LLM Prompts With DSPy | Real Python Podcast #306

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER