DSPy
Free tierThe framework for programming—not prompting—language models
Key strengths
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.
DSPy is an open-source Python framework (MIT license, ~38,700 GitHub stars) that replaces hand-crafted prompt strings with declarative, composable modules for building language model (LM) pipelines. Rather than engineering prompts manually, developers define program logic in Python — signatures, modules, and optimizers — and DSPy's compiler automatically tunes prompts and/or model weights to meet a specified metric. Core abstractions include dspy.Signature (input/output contracts), dspy.Module (composable LM calls), and a suite of teleprompters/optimizers (e.g., BootstrapFewShot, MIPRO) that run optimization loops over a training set. DSPy supports RAG pipelines, multi-step agent loops, and classifiers, and integrates with any LM backend accessible via its dspy.LM adapter layer. Install via pip install dspy; self-hostable with no external service dependency.
