Skip to content
Agents tracked: 492 Releases (7d): 545 Agent status: 1 with issuesSince last limit reset: Claude 9d · Codex 7d For AI agents: Markdown Updated Nov 20, 2026

DSPy by Stanford NLP

A framework for programming language models with declarative modules and optimizers instead of hand-written prompts.

Agent frameworks and SDKs Prompt programming frameworkOpen source · MITFree to start

Use it in: API / SDK Works with: MCP Local models

Price
Free (OSS)
free and open source
Popularity
#12 in Frameworks
Gid Score 54 / 100 · #12 of 50 ranked frameworks and SDKs
Trend
Growing
downloads up 6.9% over 30 days · up 24.3% last week
Development
Updated recently
latest 3.5.0, 10d ago
Community
39.1K GitHub stars
1.5M package downloads a week

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

MakerStanford NLP
TypePrompt programming framework
LicenseMIT
InterfacesPython library
Main languagePython
Open issues and PRs803

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.

Compare prices of all agents

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

Full monthly summary

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.

Action needed: TwoStepAdapter is deprecated and will be removed in a future version.
  • 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

All guides

Get started with DSPy

PyPIpip 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

All agent tooling

Listed because each tool documents support for DSPy or for agent frameworks in general. Savings and results depend on your workload.

Compare DSPy with another agent

vs
# 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 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 62 7.2M up 4.8% up 38.9% 30.8K+21/day 0.25.02d ago Free (OSS)

Tools used with DSPy

All tools

What 119 public GitHub projects that depend on DSPy use with it, from their dependency files.

  1. NumPy63.0%
  2. python-dotenv60.5%
  3. pandas59.7%
  4. OpenAI Python Library56.3%
  5. Pydantic55.5%
  6. Requests47.9%
  7. LiteLLM47.1%
  8. PyYAML47.1%
  9. tqdm46.2%
  10. Hugging Face Datasets43.7%

Used far more often here than in AI-built projects overall: what sets DSPy projects apart.

  1. Asyncer31.1% · 1944.5×
  2. backoff35.3% · 220.7×
  3. DiskCache32.8% · 205.0×
  4. Mako31.1% · 162.0×
  5. colorlog31.9% · 133.1×
  6. json-repair31.9% · 110.9×
  7. Optuna37.0% · 110.1×
  8. 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

All AI agent news

  1. Release GitHub Releases

    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

3.5.0
  • 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
3.4.1
  • 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
3.4.0
  • 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.
3.3.1
  • 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;
3.3.0
  • 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.
3.2.1
  • 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

Token prices of OpenAI modelsnewest OpenAI model in each family, output price per 1M tokens
OpenAI FlagshipOpenAI Mini

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.

Downloads per dayPyPI, 7-day average 219K/day
GitHub starsrunning total 39.1K
Hacker News mentionsposts and comments, rolling 7-day total 2 this week

Download the raw daily series: dspy.csv

Gid Score breakdown

Adoption71
Community66
Attention3
Momentum54

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

NumberLatest readingLast checked
Package downloadsNov 17, 2026Nov 19, 06:24 UTC
GitHub starsNov 19, 2026Nov 19, 06:26 UTC
Hacker News mentionsNov 18, 2026Nov 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:

AgentGid: #12 in Frameworks Gid Score: 54/100 downloads: 1.5M/week ▲7% 30d

[![AgentGid: #12 in Frameworks](https://agentgid.com/badges/dspy-rank.svg)](https://agentgid.com/agents/dspy/)
[![Gid Score: 54/100](https://agentgid.com/badges/dspy-score.svg)](https://agentgid.com/agents/dspy/)
[![downloads: 1.5M/week ▲7% 30d](https://agentgid.com/badges/dspy-downloads.svg)](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.