Developer Tools · Reviewed June 1, 2026

DSPy

DSPy is the Stanford prompt-programming framework that automates prompt and weight optimization. 25K+ GitHub stars; used by Cursor, Mistral, others.

Pricing
Free
Rating
4.48/ 5 · 186 reviews
Last reviewed
June 1, 2026
Channels
DSPy developer tools tool screenshot
01

Overview

DSPy

DSPy is the open-source prompt-programming framework from Stanford that treats LLM interactions as programmable modules rather than hand-tuned prompts. DSPy lets developers compose multi-step LLM pipelines using typed signatures, then optimize prompts and (optionally) model weights against task-specific metrics. DSPy has grown to 25K+ GitHub stars and is used by production agent teams at Cursor, Mistral, Databricks, and other AI companies for systematic prompt engineering.

Production credibility: 25,000+ GitHub stars; led by Omar Khattab (Stanford PhD, now Databricks) with contributors from Stanford NLP, Together AI, and the broader open-source community. Apache 2.0 licensed. Used in production by agent and RAG teams at Cursor, Mistral, Databricks, and multiple AI labs. Multiple peer-reviewed papers including the foundational DSPy paper at ICLR 2024.

Key Features

  • Typed signatures define LLM input/output contracts as Python code
  • Modules compose multi-step LLM pipelines (ChainOfThought, ReAct, ProgramOfThought, custom)
  • Optimizers automatically tune prompts against metrics — BootstrapFewShot, MIPRO, COPRO, others
  • Optional weight optimization through LoRA-style fine-tuning of underlying models
  • Model-agnostic backend supporting OpenAI, Anthropic, Mistral, local Llama, and most providers
  • Apache 2.0 open-source; 25K+ GitHub stars; led by Omar Khattab (ex-Stanford, now Databricks)
  • Published in peer-reviewed venues including ICLR 2024 (foundational DSPy paper)

Ideal Use Case

Production agent and RAG teams that have outgrown hand-tuned prompts — particularly engineering teams maintaining complex LLM pipelines where prompt drift, model switches, or task variation make manual prompt engineering unscalable.

How DSPy differentiates

LangChain and LlamaIndex treat prompts as strings; the developer iterates manually. DSPy treats prompts as parameters of programmable modules that get optimized automatically against task metrics. The trade-off is a steeper learning curve — DSPy's compositional model takes longer to learn than string-template LangChain. But for production pipelines where prompt brittleness and model-switching pain are the binding constraints, DSPy's optimizer-driven approach removes the manual tuning work that dominates LLM engineering effort.

FAQ

Q: What is DSPy? A: DSPy is an open-source prompt-programming framework from Stanford that treats LLM interactions as programmable modules with typed signatures, then optimizes prompts and weights automatically against task metrics.

Q: Who built DSPy? A: Omar Khattab (Stanford PhD, now at Databricks) leads DSPy with contributors from Stanford NLP, Together AI, and the broader open-source community. The foundational DSPy paper was published at ICLR 2024.

Q: DSPy vs LangChain vs LlamaIndex? A: LangChain and LlamaIndex treat prompts as strings the developer iterates manually. DSPy treats prompts as parameters that get optimized automatically against metrics. Steeper learning curve; lower manual-tuning burden in production.

Q: Is DSPy open source? A: Yes — DSPy is Apache 2.0 licensed with 25,000+ GitHub stars. The project is led by Omar Khattab with broad community contribution.

Q: Who uses DSPy in production? A: Agent and RAG teams at Cursor, Mistral, Databricks, and multiple AI labs use DSPy in production for prompt and weight optimization.

tl;dr

DSPy is the Stanford prompt-programming framework that automates prompt and weight optimization. 25K+ GitHub stars; Apache 2.0. Led by Omar Khattab. Used in production by Cursor, Mistral, Databricks for systematic agent and RAG pipeline engineering. Treats prompts as optimized parameters, not hand-tuned strings.

Related

Looking for more options? Browse the Developer Tools directory or read our best AI coding tools listicle. DSPy is also tracked on Crunchbase.

02

Why Use DSPy

Rating
4.48
Across 186 verified reviews
Saved
215
By ToolDirectory readers
Pricing
Free
Publisher-listed pricing model
Listed
Since 2026
Continuously re-reviewed by editors
Category
Developer Tools
Primary listing
Verified by editors during the most recent review · ToolDirectory.AI
DSPy developer tools tool screenshot
03

User Reviews

4.48
Out of 5 · 186 ratings
5
118
4
48
3
14
2
4
1
2
04

Similar Tools

Sign up for our newsletter

Receive weekly updates so you can stay up-to-date with the world of AI