ModelRefs / DSPy — AI Glossary

DSPy — AI Glossary

A framework for programming (rather than prompting) LLMs using declarative signatures and automatic prompt optimization.

Overview

DSPy (Khattab et al. 2023, Stanford) replaces hand-crafted prompts with composable modules (Predict, ChainOfThought, ReAct) and compiles them by optimizing prompts/few-shot examples against a metric. Decouples program logic from prompt strings, enabling systematic prompt engineering as a software engineering task.

Reference details

Topicprompting
Last reviewed2026-06-24

Primary source

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to DSPy — AI Glossary.

Frequently asked questions

What is DSPy?

A framework for programming (rather than prompting) LLMs using declarative signatures and automatic prompt optimization.

What concepts are related to DSPy?

Closely related concepts include automatic prompt engineering, chain of thought, few shot.