DSPy logo

DSPy

Free tier

The 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.
What's changed across AI tools →

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 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.

Alternatives

Alternatives to DSPy

See all alternatives
Browse all 15 agent frameworks tools