- fix(xml): honor positional tuple schemas
- fix(adapters): preserve nested XML enum and null guidance
- Default LM API-family selection to native lm15 routing
- fix: honor reasoning dictionaries in ChainOfThought
- fix(xml): parse nested numeric and boolean literals
- fix: preserve CoT reasoning in Refine feedback
DSPy by Stanford NLP
A framework for programming language models with declarative modules and optimizers instead of hand-written prompts.
Use it in: API / SDK Works with: MCP Local models
On this page
Usage data: latest readings Nov 17 to Nov 19, 2026, last checked Nov 19, 06:26 UTC. Date of each number
What DSPy does
DSPy is a prompt programming framework from Stanford NLP. You use it through a Python library. Its documentation covers MCP servers and local models. It can run models from OpenAI, Anthropic, Google and any OpenAI-compatible endpoint. It is used from Python. It is free and open source (MIT); you pay only for the models it calls.
Key facts
| Maker | Stanford NLP |
|---|---|
| Type | Prompt programming framework |
| License | MIT |
| Interfaces | Python library |
| Main language | Python |
| Open issues and PRs | 803 |
Pricing
DSPy is open source and free to use; you pay only for the models and infrastructure it runs on.
Checked Nov 4, 2026. Prices change often; confirm before you buy.
Quick answers
- Free to start?Yes
- Open source?Yes (MIT)
- Where you use itPython library
- Supports MCP?Yes
- Model providersopenai, anthropic, google, any OpenAI-compatible, local
- Feature comparisonAll agents
- Closest alternativeLangChain · all alternatives
What's new in DSPy: November 2026 so far
November brought refinements to XML handling, reasoning preservation, and language model routing, along with updates to the underlying LM15 infrastructure. The release deprecates the TwoStepAdapter in preparation for future versions.
- XML parsing now correctly handles nested numeric and boolean literals, as well as enum and null guidance in nested structures.
- Chain of Thought reasoning is now preserved in both standard operation and Refine feedback loops.
- Language model API selection defaults to native lm15 routing for improved consistency.
- Vendored lm15 updated to version 2.2.0 with streaming and reasoning coverage support.
1 release this month · summarised from the official release notes · all months
AgentGid articles about DSPy
Get started with DSPy
| PyPI | pip install dspy |
|---|
These commands use the packages tracked on this page. The vendor may recommend a different installer.
Add-ons for DSPy: save tokens, add memory and tools
LiteLLM
One gateway for 100+ models with spend tracking, budgets, rate limits and fallbacks.
Langfuse
Traces every model and tool call with its cost and latency, and runs evaluations.
Firecrawl
Turns websites into clean Markdown or structured data the agent can read.
E2B
Runs agent-written code in isolated cloud sandboxes instead of on your machine.
Composio
Connects the agent to 1,000+ apps and APIs with managed sign-in.
Mem0
Adds long-term memory, so the agent remembers users and past work across sessions.
Listed because each tool documents support for DSPy or for agent frameworks in general. Savings and results depend on your workload.
DSPy alternatives
Best DSPy alternatives compared · All agent frameworks and SDKs
| # | Agent | Gid Score | Downloads 7d | 7d | 30d | Stars | Latest release | Price | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 |
LangChainLangChain |
79 | 41.1M | up 5.7% | down 2.7% | 150K+76/day | 1.5.22d ago | Free (OSS) | |||
| 2 |
LangGraphLangChain |
75 | 20.1M | up 5.5% | up 29.2% | 45.1K+48/day | 1.2.23yesterday | Free (OSS) | |||
| 3 |
AI SDKVercel |
68 | 47.2M | up 3.9% | up 38.4% | 28.1K+30/day | 7.0.1772d ago | Free (OSS) | |||
| 4 |
Claude Agent SDKAnthropic |
64 | 29.3M | up 5.9% | up 37.6% | 8,588+9/day | 0.2.185yesterday | Free (OSS) | |||
| 5 |
MastraMastra |
63 | 3.7M | up 14.9% | up 49.9% | 29.6K+23/day | 1.84.02d ago | Free (OSS) | |||
| 6 |
OpenAI Agents SDKOpenAI |
62 | 7.2M | up 4.8% | up 38.9% | 30.8K+21/day | 0.25.02d ago | Free (OSS) | |||
Tools used with DSPy
What 119 public GitHub projects that depend on DSPy use with it, from their dependency files.
- NumPy63.0%
- python-dotenv60.5%
- pandas59.7%
- OpenAI Python Library56.3%
- Pydantic55.5%
- Requests47.9%
- LiteLLM47.1%
- PyYAML47.1%
- tqdm46.2%
- Hugging Face Datasets43.7%
Used far more often here than in AI-built projects overall: what sets DSPy projects apart.
- Asyncer31.1% · 1944.5×
- backoff35.3% · 220.7×
- DiskCache32.8% · 205.0×
- Mako31.1% · 162.0×
- colorlog31.9% · 133.1×
- json-repair31.9% · 110.9×
- Optuna37.0% · 110.1×
- Hugging Face Datasets43.7% · 105.1×
Ratings from people who use DSPy
No ratings yet. Used DSPy? Rate it and say what it is good and bad at.
DSPy news
-
DSPy 3.5.0 released
fix(xml): honor positional tuple schemas; fix(adapters): preserve nested XML enum and null guidance; Default LM API-family selection to native lm15 routing
What changed: recent DSPy releases
3 stable releases in the last 90 days · Monthly summary · Full changelog
- skills: reference material for the reflection LM. Pass a path, a directory containing SKILL.md, an inline string, or a list of these. YAML frontmatter is parsed at construction.
- additional_instructions: extra guidance applied to every proposal.
- base_instructions: replaces the reflection prompt but keeps its input and output fields.
- max_chars: a hard character limit. A draft that is too long gets one compression attempt; DSPy never truncates an instruction.
- truncate_history_outputs: shortens long tool and REPL outputs inside history inputs before rendering, without changing the originals.
- adapter: the adapter used for proposal calls. The default is JSONAdapter().
Earlier releases
- Public OpenAI-style lm(messages=[...]) calls, including SDK message objects. Use explicit requests as above.
- Custom BaseLM.forward() and aforward() integrations. Implement the engine interface.
- LegacyEngine, AsyncLegacyEngine, and custom complete_legacy() shortcuts. These are transition tools, not permanent escape hatches.
- Native n answers use separate sequential requests, potentially billing input tokens more than once. Use engine="litellm" for that backend's native n behavior.
- Custom engine objects own their connection. Put api_key, api_base, timeout, and related client settings on the engine itself.
- Custom engines need importable classes and JSON-compatible dump_state()/load_state() implementations to save and restore. Restoring them requires allow_unsafe_lm_state=True.
- unsolicited sandbox diagnostics can no longer desynchronize JSON-RPC replies;
- request IDs are unpredictable, and recursive execution through one of an
- bundled runtime files are protected and Deno-cache access is revoked after
- mounted files with distinct host paths cannot silently collide at the same
- guest code cannot change host-tool identity by mutating JavaScript globals or
- interpreter execution start and end;
- parallel_tool_calls support: DSPy preserves each call/result pair by ID. You can do this in native mode or in non-native mode
- Multi-turn native tool call support: Prior tool calls and results can be replayed as assistant and tool messages instead of being flattened into prompt text.
- Each turn lives in dspy.History as structured messages rather than one ever-growing trajectory string, so providers with prompt caching can reuse stable prefixes more effectively.
- LiteLLM can become an optional compatibility fallback in the planned 3.5+ path, instead of a required part of the core LM contract.
- Custom LM authors can implement one typed LMRequest -> LMResponse path instead of guessing which OpenAI/LiteLLM-shaped inputs will arrive.
- Custom LMs can translate between DSPy's typed objects and their own provider, local runtime, gateway, or inference stack.
- Removed the upper bound on litellm.
- Usecase page has been updated! To add your use-case, open a PR!
- Fixed async streaming LM calls so custom headers are forwarded to LiteLLM streaming completions.
- Fixed dspy.Embedder so per-call caching=False is honored for both sync and async embedding calls.
- Moved Deployment into the technical documentation tabs and promoted production use cases under Community.
- Updated the production use-cases copy for DSPy.
DSPy prices over time
DSPy popularity and usage data
DSPy was downloaded 1.5M times from PyPI in the week ending Nov 17, 2026, up 24.3% on the week before and up 6.9% over the last 30 days compared with the 30 before. The GitHub repository has 39.1K stars, 469 of them added in the last 30 days. The latest stable release is 3.5.0, published Nov 10, 2026; there was 1 stable release in the past 30 days. It was mentioned in 6 Hacker News posts and comments over the last 30 days.
Download the raw daily series: dspy.csv
Gid Score breakdown
Gid Score shows public popularity and activity (usage, GitHub stars, mentions, growth), not the quality of the product. Each component is scored 0 to 100 from public signals; a dash means no data for it. How the Gid Score works.
How fresh these numbers are
| Number | Latest reading | Last checked |
|---|---|---|
| Package downloads | Nov 17, 2026 | Nov 19, 06:24 UTC |
| GitHub stars | Nov 19, 2026 | Nov 19, 06:26 UTC |
| Hacker News mentions | Nov 18, 2026 | Nov 19, 06:26 UTC |
We fetch every source once a day. Registries publish downloads and page views a day or two late, so their latest reading trails the check. A reading more than 4 days old is marked out of date; the Gid Score still uses it until a newer one arrives.
DSPy FAQ
How much does DSPy cost?
DSPy is open source and free to use; you pay only for the models and infrastructure it runs on.
Is DSPy open source?
Yes. DSPy is open source, released under the MIT license.
How popular is DSPy?
DSPy was downloaded 1.5M times from PyPI in the week ending Nov 17, 2026, up 24.3% on the week before and up 6.9% over the last 30 days compared with the 30 before. The GitHub repository has 39.1K stars, 469 of them added in the last 30 days. The latest stable release is 3.5.0, published Nov 10, 2026; there was 1 stable release in the past 30 days.
What is the latest version of DSPy?
The latest stable release we track is 3.5.0, published on Nov 10, 2026.
What are the alternatives to DSPy?
The closest alternatives in the same category by Gid Score are LangChain, LangGraph, AI SDK, Claude Agent SDK.
For the makers of DSPy badges, corrections
Add a live badge to your README or site:
[](https://agentgid.com/agents/dspy/)
[](https://agentgid.com/agents/dspy/)
[](https://agentgid.com/agents/dspy/)
Something wrong or outdated on this page? Send a correction with a link to the official source. More for makers.
Where these numbers come from
PyPI: dspy. GitHub: stanfordnlp/dspy. See data sources for how each one is collected.