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 and use DSPy to . Learn more via our or meet the community, seek help, or start contributing via this GitHub repo and our .
The current LM integration uses bundled native lm15 engines, without a LiteLLM
runtime dependency or fallback. See the LM migration guide
for breaking changes to provider options, custom LMs, text completions, and embeddings.
📜 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:
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:
@inproceedings{khattab2024dspy,
title={DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines},
author={Khattab, Omar and Singhvi, Arnav and Maheshwari, Paridhi and Zhang, Zhiyuan and Santhanam, Keshav and Vardhamanan, Sri and Haq, Saiful and Sharma, Ashutosh and Joshi, Thomas T. and Moazam, Hanna and Miller, Heather and Zaharia, Matei and Potts, Christopher},
journal={The Twelfth International Conference on Learning Representations},
year={2024}
}
@article{khattab2022demonstrate,
title={Demonstrate-Search-Predict: Composing Retrieval and Language Models for Knowledge-Intensive {NLP}},
author={Khattab, Omar and Santhanam, Keshav and Li, Xiang Lisa and Hall, David and Liang, Percy and Potts, Christopher and Zaharia, Matei},
journal={arXiv preprint arXiv:2212.14024},
year={2022}
}
At a glance
Category
Coding
Pricing model
Free
Best for
ai-agents, framework, prompt-programming
What is DSPy? DSPy is a coding tool listed on Scriptiii AI Tools. Stanford framework for programming, rather than prompting, language models. Pricing: Free. Free to use. Best for: ai-agents, framework, prompt-programming.
Questions & answers
Everything you need to know about DSPy
What is DSPy?
DSPy is a coding tool. Stanford framework for programming, rather than prompting, language models.
What does DSPy cost?
Free. Free to use.
What is DSPy best for?
ai-agents, framework, prompt-programming. It is filed under Coding.