DSPy
Stanford framework for programming rather than prompting language models, with optimizers that tune prompts and weights for RAG pipelines and agent loops.
Updated
✨ Try AgentScout's free AI image generator →Good for: writing code, building AI agents
Use cases
About DSPy
DSPy is listed in our frameworks category and is aimed at builders. Stanford framework for programming rather than prompting language models, with optimizers that tune prompts and weights for RAG pipelines and agent loops. Pricing, as the maker states it: Open source. Maturity: Mature. We last checked the official link on 2026-10-18.
What is DSPy?
DSPy is a framework for programming, rather than prompting, language models. You write compositional Python code to build modular AI systems, from classifiers to RAG pipelines and agent loops.
It includes algorithms that optimize your prompts and weights, so the model learns to produce high-quality outputs. DSPy stands for Declarative Self-improving Python.
Sources: the official README and our directory listing, checked 2026-10-18. Official site: dspy.ai.
Who is DSPy for?
Developers and researchers building LLM pipelines who want to replace brittle hand-written prompts with code that can be optimized automatically.
DSPy at a glance
- Open source: Yes (MIT License)
- GitHub: stanfordnlp/dspy · 38,715 stars (as of Oct 21, 2026)
Key features
- Declarative Python modules instead of hand-written prompts
- Optimizers for prompts and weights
- Works for classifiers, RAG pipelines and agent loops
- Open source with an active community
DSPy FAQ
What is DSPy?
DSPy is a framework for programming, rather than prompting, language models. You write compositional Python code to build modular AI systems, from classifiers to RAG pipelines and agent loops.
Who is DSPy for?
Developers and researchers building LLM pipelines who want to replace brittle hand-written prompts with code that can be optimized automatically.
Is DSPy free?
DSPy's pricing, as the maker states it: Open source. Open-source tools are free to use, though you may still pay for model API usage or a hosted plan. Check the official site for current plans.
Is DSPy open source?
Yes. DSPy is released under the MIT License, according to its GitHub repository.
What are alternatives to DSPy?
Similar tools include LlamaIndex, Haystack, Langroid, Guidance, eve and BAML.
DSPy ratings and reviews
Be the first to rate DSPy: tap 1 to 5 stars below. A written review is optional.
DSPy alternatives
Compare 10 DSPy alternatives side by side →
Other frameworks tools in our directory. See all frameworks tools →
LlamaIndex
Framework for agents over your data (RAG, document agents).
Haystack
Open-source orchestration framework for building production LLM apps, RAG and agents.
Langroid
Python framework for multi-agent programming with LLMs.
Guidance
Programming paradigm for steering language models that constrains output with regex and grammars and interleaves control flow with generation.
eve
Vercel's open-source agent framework, pitched as Next.js for agents: a file-system-based way to define an agent's tools, prompts and workflows and run it in production.
BAML
Typed programming language for agents and LLM functions, with runtime types, typed errors and structured outputs designed to reduce agent mistakes.
Popular searches with this tool
🏆 Ranked in: LlamaIndex alternatives · AstrBot alternatives
🔁 Listed in: AstrBot alternatives · LlamaIndex alternatives
🧭 Task guides: RAG and document tools for building AI agents
💲 Estimate API cost: compare per-request and monthly costs for GPT, Claude, Gemini and Grok models.
Badge for makers
Built DSPy? Add this badge to your README or site. It links back to this page. About badges