stanfordnlp/dspy

DSPy: The framework for programming—not prompting—language models

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 16 minutes ago
Added to GitGenius on June 24th, 2026
Created on January 9th, 2023
Open Issues & Pull Requests: 717 (+0)
GitHub issues: Enabled
Number of forks: 3,345
Total Stargazers: 38,213 (+0)
Total Subscribers: 219 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 12.7 hours
Mean response time: 12.3 days
90th percentile: 19.7 days
Tracked items: 1,324

How this project is maintained

About 12% of issues opened in the past year have never received a reply. 89% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. 60% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 57% of issues opened in the past year have been closed. Three people close 69% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 326
New in 7 days: 6
Closed in 7 days: 2
Avg open age: 290 days
Stale 30+ days: 293
Stale 90+ days: 258

Recent activity

Opened in 7 days: 5
Closed in 7 days: 1
Comments in 7 days: 0
Events in 7 days: 1

Top labels

  • bug (316)
  • enhancement (246)
  • Behavior 2.5 (39)
  • LM Issues (21)
  • good first issue (8)
  • help wanted (6)
  • Parse Issues (5)
  • faq-undocumented (4)

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

DSPy is a Python framework developed at Stanford NLP that shifts the paradigm from prompt engineering to systematic programming of language models. Rather than manually crafting prompts, DSPy enables developers to write compositional Python code that teaches language models to deliver high-quality outputs through automated optimization of both prompts and weights. The framework is designed to support a wide range of applications, from simple classifiers to complex retrieval-augmented generation pipelines and agent loops.

The core philosophy of DSPy, which stands for Declarative Self-improving Python, addresses a fundamental limitation in current language model development: the brittleness and inefficiency of hand-written prompts. By providing a structured programming interface, DSPy allows developers to build modular AI systems where the framework itself handles the optimization process rather than requiring manual prompt iteration. This approach enables faster development cycles and more reliable system behavior across different tasks and model configurations.

The framework's scope encompasses multiple interconnected domains including prompt engineering, language model optimization, modular system design, natural language processing, AI workflow orchestration, and evaluation tools. DSPy provides built-in capabilities for task chaining, allowing complex multi-step language model programs to be composed and optimized as unified systems. The evaluation tools enable developers to measure and improve system performance systematically rather than relying on subjective prompt quality assessments.

DSPy's research foundation is substantial, with multiple peer-reviewed papers documenting the framework's evolution and capabilities. The original foundational work, "Demonstrate-Search-Predict: Composing Retrieval & Language Models for Knowledge-Intensive NLP," dates to December 2022, followed by the core DSPy paper in October 2023. More recent publications from 2024 and 2025 explore advanced topics including multi-stage language model program optimization, fine-tuning integration, and reflective prompt evolution techniques that can outperform traditional reinforcement learning approaches.

The repository's interconnections with other major machine learning frameworks reveal its positioning within the broader ecosystem. The framework maintains active community engagement through Discord and social media channels, with comprehensive documentation available at dspy.ai serving as the primary resource for both framework usage and understanding the underlying research principles.