

DSPy: Programming—not prompting—Foundation Models
2/19/2025
DSPy
Programming—not prompting—Foundation Models
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:
Please go to the DSPy Docs at dspy.ai
Installation
pip install dspy
To install the very latest from main
:
pip install git+https://github.com/stanfordnlp/dspy.git
← Back to projects