stanfordnlp/dspy

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 38 minutes ago
Added to GitGenius on June 24th, 2026
Created on January 9th, 2023
Open Issues & Pull Requests: 654 (+0)
Number of forks: 3,177
Total Stargazers: 36,708 (+5)
Total Subscribers: 205 (+0)

Issue Activity (beta)

Open issues: 306
New in 7 days: 7
Closed in 7 days: 6
Avg open age: 317 days
Stale 30+ days: 280
Stale 90+ days: 249

Recent activity

Opened in 7 days: 7
Closed in 7 days: 6
Comments in 7 days: 4
Events in 7 days: 10

Top labels

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

Repository Insights (GitGenius)

Median issue/PR response: 0.1 hours
Mean response time: 7.3 days
90th percentile: 5.8 days
Tracked items: 1,326

Most active contributors

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.

According to GitGenius activity tracking, DSPy maintains an exceptionally responsive development community with a median issue and pull request response latency of just 0.1 hours, though the mean response time of 177.8 hours reflects occasional deeper discussions on complex issues. The repository has accumulated 1310 tracked items, with bug reports and enhancement requests being the most active issue categories at 301 and 237 items respectively. The core maintainer okhat has driven 1461 events in the repository's activity history, while isaacbmiller and chenmoneygithub have contributed 316 and 311 events respectively, indicating a concentrated but active core team managing the project.

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. GitGenius identifies overlapping contributors with keras-team/keras-hub, run-llama/llama_index, and langchain-ai/langchain, suggesting DSPy serves as a complementary tool within the larger language model development landscape. 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.

dspy
by
stanfordnlpstanfordnlp/dspy

Repository Details

Fetching additional details & charts...