DSPy
Open-source Python framework for programming and optimizing language-model pipelines.
Linked from dspy.ai · checked 1 Nov
- Tool type
- Python framework for LM programs
- Made for
- Developers and researchers
- Runs on
- Python 3.10 or later
- Installed as a Python package; runs in your own environment against the language models you connect.
What it does
DSPy is a Python framework for building AI systems. Developers write the task as a structured signature with typed inputs and outputs rather than a hand-written prompt, then wrap it in a module that sets the strategy, such as direct prediction, step-by-step reasoning or a tool-using ReAct agent. You connect a language model through the library and call the resulting program like ordinary Python.
To improve quality, you supply examples and a scoring metric and run an optimizer such as GEPA, which tunes the prompts or weights of the program against that metric. The output is a saved, reusable program. DSPy also covers retrieval, classification, extraction, multimodal inputs and agent loops, with tools and MCP support.
It is for developers and researchers comfortable writing Python. It is free under the MIT license; you pay your model provider for the calls your programs and optimization runs make. Recent releases changed the language-model integration, so check the migration guide when upgrading.
What it can do
- Declare tasks as typed signatures instead of managing prompts
- Compose modules for direct prediction, reasoning and tool-using ReAct agents
- Optimize programs against a metric with optimizers such as GEPA
- Save and load compiled programs
- Handle image inputs in signatures
- Use tools and MCP from agent modules
Works with
- MCP
Before you choose
- You supply the language model access; optimization runs make many model calls, so cost depends on the provider and model you choose.
- Recent versions use bundled native LM engines without a LiteLLM dependency, with breaking changes to provider options, custom LMs, text completions and embeddings.
- It is a developer library used from Python code, not a hosted app or visual builder.
Listed under
Get started
Install from PyPI and follow the Getting Started guide; the source is on GitHub under the MIT license.
- Install with pip install -U dspy (Python 3.10 or later).
- Connect a language model with dspy.LM and define a signature and module for your task.
- Add examples and a metric, then compile with an optimizer and save the program.
Plans and prices
Prices in USDThe library is MIT-licensed; no paid plans are listed on the project site.
- Full framework
- Community support via GitHub and Discord
Source: dspy.ai, checked 1 Nov 2026. Prices can change; check before you buy.
Sources for this overview
Product pages, documentation, and pricing checked 1 Nov 2026. Each source supports part of the overview; availability and prices can change.
Ratings and reviews
No ratings for DSPy yet.
What’s changed
Free accountSignals
Free accountData and security
Free accountCompare with similar tools
Free accountWhere this comes from
How we research- Company website
- dspy.ai: product, pricing and policy pages
- Web archive
- When the site first appeared
- YC directory mirror
- Batch and company name
- Social accounts
- Accounts the company links, and its posts on X
- Human review
- Checked by a person
- knowledge_base
- manual_review
Last checked 1 Nov 2026. Every field keeps its source and date; unknown means we couldn’t confirm it.