Prompt workshop
What is DSPy?
DSPy is a framework for compiling language-model programs from signatures, modules, and a metric.
You write the program. An optimizer searches prompts and few-shot demos. This site maps the loop; it does not run DSPy.
Why it matters
DSPy is a framework for writing language model programs as code instead of text. You define signatures (input/output types), modules (processing steps), and a metric (how to score outputs). The compiler searches for the best prompts and demonstrations.
DSPy matters because it turns prompt engineering from an art into an engineering discipline with reproducible results.
Key takeaways
- 1DSPy compiles prompts from signatures, modules, and metrics.
- 2It turns prompt engineering into reproducible engineering.
- 3The compiled artifacts are inspectable text plus demonstrations.
Common mistakes
- ✕Using DSPy for tasks that don't have a measurable metric.
- ✕Not inspecting the compiled prompts to understand what the optimizer found.
Related terms
Concept neighborhood
Terms linked from DSPy in the glossary graph.