# DSPy vs smolagents

> DSPy scores 68.3 (B) to smolagents's 62.5 (B) for agent frameworks. Prices, MCP, x402, uptime and agent notes side by side.

- Canonical: https://www.anchorterminal.com/compare/dspy-vs-smolagents
- Markdown: https://www.anchorterminal.com/compare/dspy-vs-smolagents.md (~3,750 tokens)
- Slim: https://www.anchorterminal.com/compare/dspy-vs-smolagents.min.md (~780 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/compare/dspy-vs-smolagents.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-23

DSPy scores 68.3 (B) on agent readiness against smolagents's 62.5 (B), and leads in 1 of 7 scored categories. smolagents leads on schema & documentation, security & auth and transparency & trust. Both do agent frameworks.

- DSPy: grade B, 68.3/100, rank #414 of 1654. Markdown https://www.anchorterminal.com/tools/dspy.md · JSON https://www.anchorterminal.com/api/v1/tools/dspy.json
- smolagents: grade B, 62.5/100, rank #729 of 1654. Markdown https://www.anchorterminal.com/tools/smolagents.md · JSON https://www.anchorterminal.com/api/v1/tools/smolagents.json
- Best agent frameworks and SDKs: https://www.anchorterminal.com/best/frameworks/index.md
- All 253 frameworks comparisons: https://www.anchorterminal.com/compare/frameworks/index.md

## Which one, for what

### DSPy (B)

Good for: Python teams who want typed LM programs they can evaluate and optimise against a metric, with ReAct for tool use.

Ahead on:
- Maintenance & community, 87 against 34

Also in its favour:
- No incidents deducted, where smolagents loses 6 points for them

Watch for: 3.5 changed the default adapter, reasoning and API routing and removed CodeAct and ProgramOfThought in a minor release

### smolagents (B)

Good for: Small Python projects and research that want code-writing agents with minimal abstraction.

Ahead on:
- Schema & documentation, 81 against 71
- Security & auth, 66 against 60
- Transparency & trust, 65 against 52

Watch for: No release since 1.26.0 on 29 May 2026, and few commits to main since August


## Why the edge

### Maintenance & community: DSPy +53

- DSPy (87): 3.5.0 tagged on 10 November 2026, 13 days before this check (30). Three releases in the 90 days to 23 November (3.4.0, 3.4.1, 3.5.0) (20). The 50 newest issues had 19 with a comment and 8 closed, with 352 issues and 475 pull requests open, while 213 commits from about 30 authors reached the repository in 90 days (12). The package is current (15). CI on six Python versions, Dependabot and actions pinned to commit SHAs (10). 30+20+12+15+10 = 87.
- smolagents (34): v1.26.0 on 29 May 2026, 161 days before this check (10). No release in the 90 days to 6 November (0). 416 open issues and 1,045 open issues and pull requests on 6 November, with 144 issues opened in the 90 days to 3 November. Of the 50 newest, 26 had a comment and 1 was closed. Two 2026 CVE records say the vendor didn't respond to the reporter, and seven commits reached main from 8 August to 6 November (6). Python only, and the package is the current one (10). CI with actions pinned to commit SHAs and Dependabot for actions (8). 10+0+6+10+8 = 34.

### Transparency & trust: smolagents +13

- DSPy (52): MIT (30). The library keeps only its answer cache, in memory and on disk by default, which the cache guide describes; no terms or privacy policy exist for the project (18). Deprecation warnings name the removal version (ReActV2 removed in 3.6), but there is no written policy and 3.5 removed APIs without a prior deprecation release (8). No telemetry, though no page states it (12). 30+18+8+12 = 68.
- smolagents (65): Apache-2.0 (30). The library stores nothing itself; the default model sends prompts to Hugging Face's inference providers, which the docs show (20). Breaking removals such as WasmExecutor shipped in minor releases, without a written deprecation policy (5). No telemetry, though no page states it (12). 30+20+5+12 = 67.

### Schema & documentation: smolagents +10

- DSPy (71): Framework reading. A typed Python API with an API reference for modules, tools, adapters and errors (20). No llms.txt at dspy.ai; the docs are Markdown in the repository but not served for agents (0). The tools and ReAct pages say what each part is for and when to read on (15). Tools are typed from signatures and Pydantic annotations and validated against JSON Schema (14). Many tutorials with code, and an errors page in the reference (12). Versioned docs, GitHub release notes and an upgrade guide, with no changelog file (10). 20+0+15+14+12+10 = 71.
- smolagents (81): Framework reading. A typed Python API with reference pages for agents, models, tools and executors (22). llms.txt and Markdown pages on huggingface.co (10). The docs say when to use CodeAgent or ToolCallingAgent and when a sandbox is needed (17). Tools declare typed inputs in a schema dictionary or from a decorated function (12). Many runnable examples; error classes exist but aren't catalogued (10). Versions tagged with release notes, no changelog file (10). 22+10+17+12+10+10 = 81.

### Security & auth: smolagents +6

- DSPy (60): Framework reading (telemetry defaults, approvals, guardrails, sandboxing). No telemetry found, and the optional LiteLLM engine switches LiteLLM telemetry off (25). No tool approval hook; RLM runs generated code in a Deno and Pyodide sandbox with no filesystem or network access (10). No prompt-injection guidance found (5). MLflow tracing through OpenTelemetry and callbacks (12). SECURITY.md with GitHub private reporting and a maintainer address, but OSV lists CVE-2025-12695 for the PythonInterpreter sandbox with no fixed version (8). 25+10+5+12+8 = 60.
- smolagents (66): Framework reading (telemetry defaults, approvals, guardrails, sandboxing). No telemetry found in the source (25). No human approval hook beyond step callbacks; the local executor restricts imports but the guide says it isn't a security tool, and isolation needs a remote executor (10). The secure execution guide covers LLM-generated code risks, without prompt-injection guidance for tool output (7). OpenTelemetry tracing through OpenInference and run inspection (12). SECURITY.md with private reporting and CVE credit, and the remote-executor RCE was fixed in public, but two 2026 CVE records say the vendor didn't respond (12). 25+10+7+12+12 = 66.

## Score by category

| Category | Weight | DSPy | smolagents | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% | 62 | 64 | smolagents +2 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 71 | 81 | smolagents +10 |
| Agent ergonomics | 13% | 64 | 68 | smolagents +4 |
| Security & auth | 14% | 60 | 66 | smolagents +6 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 87 | 34 | DSPy +53 |
| Transparency & trust | 7% | 52 | 65 | smolagents +13 |
| Negative events | ≤15 | 0 | -6 | |
| **Total** | | **68.3 · B** | **62.5 · B** | |

## Facts side by side

| Fact | DSPy | smolagents |
| --- | --- | --- |
| Kind | Agent framework | Agent framework |
| Vendor | Stanford NLP | Hugging Face |
| Hosted endpoint | no (local only) | no (local only) |
| Transports |  |  |
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MIT | Apache-2.0 |
| Read-only variant documented | no | no |
| llms.txt | no | yes |
| Last release | 2026-11-10 | 2026-05-29 |
| Terms last updated | no document linked | 2022-09-15 |
| Privacy policy last updated | no document linked | 2023-03-28 |
| Customer content may train models | not read yet | not found in the text |
| Terms restrict automated access | not read yet | not found in the text |
| Terms restrict benchmarking | not read yet | not found in the text |
| Terms or service can change without notice | not read yet | yes |
| Arbitration or class-action waiver | not read yet | not found in the text |
| Popularity | 39k stars | 30k stars, 171k PyPI/wk |

## How the scores have moved

### DSPy

No score change since it was listed.

### smolagents

- +3.8 on 13 November 2026 (C to B): checklist

## Verdicts

**DSPy.** An MIT Python framework with typed signatures, a ReAct agent that returns tool errors to the model, MCP tool conversion, a Deno sandbox for generated code, no telemetry found and monthly releases. Release 3.5 changed defaults and removed APIs in a minor version, and there is no tool approval hook or llms.txt.

**smolagents.** A compact Python library for code-writing and tool-calling agents, with MCP tools, any model provider and remote sandboxes through E2B, Docker, Modal or Blaxel. The newest release is 1.26.0 of 29 May 2026, a critical remote-executor RCE took about eight weeks to fix, and the local executor isn't a security boundary.

## Before you call either

### DSPy

1. Re-evaluate saved programs after upgrading to 3.5, since the default adapter and prompts changed
2. Install dspy[mcp] and convert each MCP tool with dspy.Tool.from_mcp_tool while the client session stays open
3. Disable the answer cache for calls whose output must change between runs, since memory and disk caches are on by default
4. Wrap tools that send, pay or delete in your own confirmation step, because ReAct runs tools without approval
5. Pin dspy to a minor version, since minor releases remove APIs

### smolagents

1. Run CodeAgent with `executor_type` set to e2b, docker, modal or blaxel whenever the model or its inputs aren't trusted
2. Use smolagents 1.24.0 or later to get the remote-executor deserialisation fix
3. Set max_steps and final_answer_checks so a run stops on its own
4. Pass structured_output explicitly to MCPClient to avoid the default-change warning
5. Pin the version, since minor releases have removed APIs

## Questions

### Which is better for AI agents, DSPy or smolagents?

DSPy scores 68.3 (B) on agent readiness against smolagents's 62.5 (B), and leads in 1 of 7 scored categories. smolagents leads on schema & documentation, security & auth and transparency & trust.

### Are DSPy and smolagents open source?

Yes. DSPy is open source (MIT). smolagents is open source (Apache-2.0).


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/dspy-vs-smolagents.json, and with the fewest tokens: https://www.anchorterminal.com/compare/dspy-vs-smolagents.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "dspy", "b": "smolagents"}`. From a terminal: `anchor compare dspy smolagents`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/dspy.json and https://www.anchorterminal.com/api/v1/tools/smolagents.json

## Other comparisons with DSPy or smolagents

- [AgentOS vs DSPy](https://www.anchorterminal.com/compare/agentos-vs-dspy.md)
- [AgentOS vs smolagents](https://www.anchorterminal.com/compare/agentos-vs-smolagents.md)
- [Agno vs DSPy](https://www.anchorterminal.com/compare/agno-vs-dspy.md)
- [Agno vs smolagents](https://www.anchorterminal.com/compare/agno-vs-smolagents.md)
- [BoxLang AI vs DSPy](https://www.anchorterminal.com/compare/boxlang-ai-vs-dspy.md)
- [BoxLang AI vs smolagents](https://www.anchorterminal.com/compare/boxlang-ai-vs-smolagents.md)
- [Claude Agent SDK vs DSPy](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-dspy.md)
- [Claude Agent SDK vs smolagents](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-smolagents.md)
- [CrewAI vs DSPy](https://www.anchorterminal.com/compare/crewai-vs-dspy.md)
- [CrewAI vs smolagents](https://www.anchorterminal.com/compare/crewai-vs-smolagents.md)
- [Cursor Agent SDK vs DSPy](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-dspy.md)
- [Cursor Agent SDK vs smolagents](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-smolagents.md)
- [Docker Agent vs DSPy](https://www.anchorterminal.com/compare/docker-agent-vs-dspy.md)
- [Docker Agent vs smolagents](https://www.anchorterminal.com/compare/docker-agent-vs-smolagents.md)
- [DSPy vs Genkit](https://www.anchorterminal.com/compare/dspy-vs-genkit.md)
- [DSPy vs Agent Development Kit (ADK)](https://www.anchorterminal.com/compare/dspy-vs-google-adk.md)
- [DSPy vs guilds.run](https://www.anchorterminal.com/compare/dspy-vs-guilds-run.md)
- [DSPy vs Haystack](https://www.anchorterminal.com/compare/dspy-vs-haystack.md)
- [DSPy vs LangGraph](https://www.anchorterminal.com/compare/dspy-vs-langgraph.md)
- [DSPy vs LlamaIndex Framework](https://www.anchorterminal.com/compare/dspy-vs-llamaindex.md)
- [DSPy vs Mastra](https://www.anchorterminal.com/compare/dspy-vs-mastra.md)
- [DSPy vs Microsoft Agent Framework](https://www.anchorterminal.com/compare/dspy-vs-microsoft-agent-framework.md)
- [DSPy vs OpenAI Agents SDK](https://www.anchorterminal.com/compare/dspy-vs-openai-agents-sdk.md)
- [DSPy vs Pydantic AI](https://www.anchorterminal.com/compare/dspy-vs-pydantic-ai.md)
- [DSPy vs Strands Agents](https://www.anchorterminal.com/compare/dspy-vs-strands-agents.md)
- [DSPy vs Terse Durable Actors](https://www.anchorterminal.com/compare/dspy-vs-terse-durable-actors.md)
- [DSPy vs TradingAgents](https://www.anchorterminal.com/compare/dspy-vs-tradingagents.md)
- [DSPy vs AI SDK](https://www.anchorterminal.com/compare/dspy-vs-vercel-ai-sdk.md)
- [Genkit vs smolagents](https://www.anchorterminal.com/compare/genkit-vs-smolagents.md)
- [Agent Development Kit (ADK) vs smolagents](https://www.anchorterminal.com/compare/google-adk-vs-smolagents.md)
- [guilds.run vs smolagents](https://www.anchorterminal.com/compare/guilds-run-vs-smolagents.md)
- [Haystack vs smolagents](https://www.anchorterminal.com/compare/haystack-vs-smolagents.md)
- [LangGraph vs smolagents](https://www.anchorterminal.com/compare/langgraph-vs-smolagents.md)
- [LlamaIndex Framework vs smolagents](https://www.anchorterminal.com/compare/llamaindex-vs-smolagents.md)
- [Mastra vs smolagents](https://www.anchorterminal.com/compare/mastra-vs-smolagents.md)
- [Microsoft Agent Framework vs smolagents](https://www.anchorterminal.com/compare/microsoft-agent-framework-vs-smolagents.md)
- [OpenAI Agents SDK vs smolagents](https://www.anchorterminal.com/compare/openai-agents-sdk-vs-smolagents.md)
- [Pydantic AI vs smolagents](https://www.anchorterminal.com/compare/pydantic-ai-vs-smolagents.md)
- [smolagents vs Strands Agents](https://www.anchorterminal.com/compare/smolagents-vs-strands-agents.md)
- [smolagents vs Terse Durable Actors](https://www.anchorterminal.com/compare/smolagents-vs-terse-durable-actors.md)
- [smolagents vs TradingAgents](https://www.anchorterminal.com/compare/smolagents-vs-tradingagents.md)
- [smolagents vs AI SDK](https://www.anchorterminal.com/compare/smolagents-vs-vercel-ai-sdk.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
