Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dspy

> 编程语言
Open source

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

36.5K stars0 likes3 views
WebsiteGitHub

About

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

DSPy: Programming—not prompting—Foundation Models

Documentation: DSPy Docs

DSPy is the framework for programming—rather than prompting—language models. It allows you to iterate fast on building modular AI systems and offers algorithms for optimizing their prompts and weights, whether you're building simple classifiers, sophisticated RAG pipelines, or Agent loops.

DSPy stands for Declarative Self-improving Python. Instead of brittle prompts, you write compositional Python code and use DSPy to teach your LM to deliver high-quality outputs. Learn more via our official documentation site or meet the community, seek help, or start contributing via this GitHub repo and our Discord server.

Documentation: dspy.ai

Please go to the DSPy Docs at dspy.ai

Installation

bash
pip install dspy

To install the very latest from main:

bash
pip install git+https://github.com/stanfordnlp/dspy.git

📜 Citation & Reading More

If you're looking to understand the framework, please go to the DSPy Docs at dspy.ai.

If you're looking to understand the underlying research, this is a set of our papers:

[Jul'25] GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
[Jun'24] Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs
[Oct'23] DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines
[Jul'24] Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Together
[Jun'24] Prompts as Auto-Optimized Training Hyperparameters
[Feb'24] Assisting in Writing Wikipedia-like Articles From Scratch with Large Language Models
[Jan'24] In-Context Learning for Extreme Multi-Label Classification
[Dec'23] DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelines
[Dec'22] Demonstrate-Search-Predict: Composing Retrieval & Language Models for Knowledge-Intensive NLP

To stay up to date or learn more, follow @DSPyOSS on Twitter or the DSPy page on LinkedIn.

The DSPy logo is designed by Chuyi Zhang.

If you use DSPy or DSP in a research paper, please cite our work as follows:

…

Issues· 757 open

View all issuesOpen on GitHub
  • #10523

    [Bug] BootstrapFewShot loses teacher demos after a teacher exception

    Updated Sep 30, 2026
  • #10529

    [Bug] Signature.insert/prepend/append silently drops a field whose name exists in the other section

    bugUpdated Sep 29, 2026
  • #9574

    [Bug] ParallelEvaluate `causes cannot schedule new futures after shutdown on long evals`

    help wantedUpdated Sep 29, 2026
  • #10470

    Proposal: optional durable memory via MemCode

    enhancementUpdated Sep 29, 2026
  • #10527

    [Bug] ParallelExecutor drops a task result equal to "cancelled"

    Updated Sep 29, 2026
  • #10525

    [Bug] FAISS retrieval can return the last corpus passage for a missing candidate

    Updated Sep 29, 2026
  • #10497

    Prediction/Example fields named items/keys/values/get/... return methods instead of stored values

    Updated Sep 28, 2026
  • #10516

    [Bug] 3.4.0: importing litellm after dspy fails with circular import in openai (lazy openai proxy) when numpy is installed and litellm < 1.102

    Updated Sep 28, 2026
  • #10508

    [Bug] Reserved <<CUSTOM-TYPE-*-IDENTIFIER>> markers leak into assistant messages when a custom Type is an output field in demos or History

    Updated Sep 26, 2026
  • #10509

    [Bug] PythonInterpreter: SyntaxError message is always empty

    bugUpdated Sep 26, 2026

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言