DSPy
Free tierThe framework for programming—not prompting—language models
Free·All audiences·Open source
Key strengths
Programming (not prompting) language modelsModular AI system composition in PythonAutomatic prompt and weight optimizationSupports RAG pipelines, classifiers, and agent loopsDeclarative Self-improving Python (DSPy) paradigm
Completely free
Founded 2022
Self-hostable
Facts verified against github.com on
Recent changes
- Plans updated: Open-source Python library, free to install via pip under the MIT license.
Get alerts when DSPy changes
Free. We'll email you when pricing, the free tier, API access or open-source status changes.
No ratings yet
DSPy is installed as a standard Python package (pip install dspy) and is self-hostable with no required cloud dependency. Key developer concepts include:
- Signatures — declarative input/output type contracts that describe what an LM call should accomplish, without specifying how.
- Modules — composable building blocks (e.g.,
dspy.Predict,dspy.ChainOfThought,dspy.ReAct) that wrap LM calls and can be nested into larger pipelines. - Optimizers (Teleprompters) — algorithms such as
BootstrapFewShotandMIPROthat search over prompt candidates and/or fine-tune weights against a developer-defined metric and training set. - LM Adapters —
dspy.LMprovides a unified interface to connect any supported language model backend.
The framework follows the Declarative Self-improving Python (DSPy) paradigm: programs are written once and improved automatically, making pipelines robust to model or data changes. Source code and documentation are available on GitHub (MIT license, ~38,700 stars).
Alternatives
See all alternatives 