DSPy takes a genuinely different approach from most prompting frameworks: instead of hand-crafting a prompt string and tweaking its wording until it works, a developer defines a module declaratively, describing the input and output it needs, and DSPy's optimizers automatically search for and tune the actual prompts or few-shot examples that get the best results against a given dataset and metric.
That shift, from manual prompt engineering to something closer to compiling a program against a training signal, has made DSPy popular with researchers and teams who treat LLM application behavior as something to measure and optimize systematically rather than tune by feel. Its module system composes the way ordinary code does, letting developers build multi-step pipelines out of smaller optimized pieces rather than one long, brittle prompt.
Coming out of Stanford's NLP group and under active academic and open-source development, it's free and MIT licensed, with a learning curve that's real: thinking in DSPy's declarative, optimization-first style takes real adjustment for developers used to directly writing and iterating on prompt text.