AI engineering glossary · Prompt context engineering
What is DSPy?
DSPy: An open-source framework that treats language model programs as modules with typed inputs and outputs, and automatically tunes their prompts and examples against a metric you define. It lets developers write code rather than hand-written prompt strings.
DSPy: an example
You declare a module 'question -> answer', provide 50 labelled questions and a metric, and an optimiser searches for better prompts and demonstrations.
Related terms
More Prompt context engineering terms
- Dynamic few-shot selection
- Few-shot chain-of-thought
- Few-shot prompting
- Frequency penalty
- Function calling
- GBNF grammar
- Generated knowledge prompting
- Grammar-constrained decoding
Where you learn it
DSPy is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.