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.

Level: advancedTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.