DSPy: Programming—not prompting—Foundation Models DSPy: Programming—not prompting—Foundation Models

DSPy: Programming—not prompting—Foundation Models

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

Terminal window
pip install dspy

To install the very latest from main:

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

← Back to projects