
DSPy
Open-source Python framework for building LLM programs from typed signatures and modules, with prompt optimizers.
Is DSPy free?
Yes, DSPy has a free plan. What you get: Open source (MIT): free framework; you pay your LLM provider for calls. To get it: pip install -U dspy; then set your language model with dspy.LM; then write a signature and call it through a module. Verified on dspy.ai.
Free plan at a glance
- Includes
- Open source (MIT): free framework; you pay your LLM provider for calls
MIT licensed and free; the language model you configure sets any cost.
- Duration
- Free forever
- Commercial use
- Allowed on the free plan
How to get it free
Self-host- pip install -U dspy
- Set your language model with dspy.LM
- Write a signature and call it through a module
Good to know
- Optimizer runs make many extra LLM calls, billed by your provider
dspy.ai, Checked Source
Overview
DSPy, started at Stanford NLP, has you declare LLM tasks as typed signatures instead of prompts, compose them with modules such as ChainOfThought and ReAct, and use optimizers like GEPA to tune prompts against a metric. It is MIT licensed and installs with pip.
Key features
- Signatures: declare tasks as typed inputs and outputs instead of prompt strings
- Modules such as Predict, ChainOfThought and ReAct for reasoning and tool use
- Optimizers, including GEPA, that tune prompts against your metric and examples
- Save and load compiled programs as JSON files
- Caching of LM calls, which you can turn off
Best for
- People
- Python developers building LLM pipelines, RAG or agents, NLP and AI researchers exploring new pipelines, Teams that want to optimize prompts against a metric
Limitations
- You need a language model to call; optimizing makes many extra calls, which your provider bills
- Python only, version 3.10 or later
Screenshot

FAQ
- Is DSPy free?
- Yes. DSPy has a free plan: Open source (MIT): free framework; you pay your LLM provider for calls. We last checked dspy.ai's pricing page on 2026-10-24.
- What does the DSPy free plan include?
- Open source (MIT): free framework; you pay your LLM provider for calls. Source: https://dspy.ai/current/ (checked 2026-10-24).
- How do I get DSPy for free?
- Steps: pip install -U dspy; Set your language model with dspy.LM; Write a signature and call it through a module. Start at https://dspy.ai/current/ (checked 2026-10-24).
- Do I need an account to use DSPy for free?
- Not for the free option: the free route is to self-host DSPy (pip install -U dspy). Checked 2026-10-24.
- What's the catch with DSPy's free plan?
- Optimizer runs make many extra LLM calls, billed by your provider. Checked 2026-10-24.
- What are free alternatives to DSPy?
- Tavily (free plan), Postman (free plan) and Exa (free credits) are free alternatives. We checked their free offers on 2026-10-25.
- Is DSPy free and open source?
- Yes. DSPy is licensed under the MIT License.Source: github.com/stanfordnlp/dspy/blob/main/LICENSE
- Does optimizing with DSPy cost money?
- DSPy itself is free, but optimizers make extra LLM calls. An example in the FAQ took about 6 minutes and 3,200 API calls, for a total cost of about $3 in OpenAI usage.Source: dspy.ai/current/faqs
- Can I save a compiled DSPy program?
- Yes. Compiled modules can be saved and loaded, and exporting a program for deployment is simply saving it.Source: dspy.ai/current/faqs
- Who makes DSPy?
- DSPy started at Stanford NLP and grew into a research community. It has been built in the open since December 2022.Source: dspy.ai/current
Free alternatives

Tavily
Search API built for AI agents.
Free forever, 1,000 API credits per month

Postman
API platform with AI agent builder and Postbot.
Free forever, Free plan for individuals and small teams

Exa
Web search API for AI.
Free credits, Start free with over $120 in credits per year
You.com
Web search and research APIs for AI agents, with a free MCP tier.
Free forever, Up to 100 Web Search API queries a day through the MCP server

Requesty
LLM router and gateway with cost tracking.
Free forever, Free $0 plan: full platform on free models
Sources
- Free offer
- Verified on github.com/stanfordnlp/dspy/blob/main/LICENSE
…is licensed under the MIT…
- Page content
Checked against
Added by our team. We check that a free option exists and record the date; signing up is between you and DSPy, so read their privacy policy and terms first.
Is this your tool? Claim it · Promote it