DSPy
A framework from Stanford that treats prompts as compilers—optimize them automatically using training data and evaluations.
Think of it like
Instead of hand-writing prompts, write a program and let DSPy optimize the prompts inside it.
Example
Define a module: input text → summarizer → translator → QA. You write the high-level flow, DSPy learns the best prompts for each step from examples and validates on a test set.
How it actually works
DSPy decouples logic from prompts. You write Python functions that call LLMs via DSPy primitives; DSPy optimizes the prompts under the hood by looking at training data and your evaluations. This shifts prompting from art to engineering. Young but growing in adoption; changes mindset from 'what prompt works' to 'what examples and structure work.'
For product teams
Reduces manual prompt tuning; brings structure and measurability to prompt engineering.
For engineers
Compiler-based prompt optimization; training-free adaptation; evaluations drive improvement.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome