DSPy
Stanford's framework for programming, not prompting, language models, with optimisers for prompts and weights.
Sources and review
Checked against public documentation on . Suitability guidance is our editorial judgment; this is not a performance benchmark or an endorsement.
Systems where you can define a metric and want prompts tuned automatically instead of by hand.
About DSPy
DSPy (Declarative Self-improving Python) replaces hand-written prompts with compositional Python modules and provides algorithms that optimise a program's prompts and weights against your metric. It is used for classifiers, RAG pipelines and agent loops alike.
DSPy is listed in this index written primarily in Python, with 39k stars on GitHub. Its latest recorded repository push was in November 2026; that is not an ASE editorial review date.
pip install dspy