DSPy

Program — not prompt — language models
LLM / RAG frameworkLLM programming frameworkMITCloud-optionalPythonAdvanced
A high count usually means the project is heavily examined. A low count usually means it is little examined — not that it is safe.
No public activity signals for this tool — it has no open repository we can measure.
OSAI Pulse ⓘ ★★★★★★★★★★ /100 signals tracked
🐳 Docker pulls 📦 PyPI downloads / month 📦 npm downloads / month 🚀 Latest release ·
Visit website →View on GitHub

What is DSPy?

DSPy from Stanford is a framework for programming LLMs with composable modules and optimizers that automatically tune prompts instead of hand-crafting them.

Why people choose DSPy

DSPy at a glance

CategoryLLM / RAG framework
TypeLLM programming framework
LicenseMIT
Runs locallyCloud-optional
Built withPython
Skill levelAdvanced
Best foroptimizing LLM pipelines systematically

Open-source alternatives to DSPy

Other open-source llm / rag framework tools worth comparing:

LangChainCompose chains, tools and agentsLlamaIndexThe data framework for RAGHaystackProduction pipelines for search and RAGtxtaiAll-in-one embeddings databaseRAGFlowDeep-document-understanding RAGSemantic KernelMicrosoft's enterprise agent frameworkGraphRAGRAG that builds a knowledge graph firstLiteLLMOne API for 100+ LLM providersInstructorReliable structured outputs from LLMsOutlinesGuarantee valid JSON and grammarsGuidanceInterleave control and generationLLMWareEnterprise RAG with small specialised modelsFlashRankUltra-light reranking for better RAGSentence TransformersThe standard way to make embeddingsRagasMeasure whether your RAG is any goodPromptfooUnit tests for your promptsLangfuseSee what your LLM app actually didPhoenixTrace, evaluate and debug LLM apps

DSPy head-to-head

DSPy vs LangChainDSPy vs LlamaIndexDSPy vs HaystackDSPy vs txtaiDSPy vs RAGFlowDSPy vs Semantic KernelDSPy vs GraphRAGDSPy vs LiteLLMDSPy vs InstructorDSPy vs OutlinesDSPy vs GuidanceDSPy vs LLMWareDSPy vs FlashRankDSPy vs Sentence TransformersDSPy vs RagasDSPy vs PromptfooDSPy vs LangfuseDSPy vs Phoenix

FAQ

Is DSPy free?

DSPy is free and open-source (MIT license), so you can use, self-host and modify it at no cost.

Can I run DSPy locally?

DSPy can be used locally or in the cloud depending on your setup.

What is the best alternative to DSPy?

Popular open-source alternatives include LangChain, LlamaIndex, Haystack. See the comparisons above to choose.

Explore more open-source AI

Browse the full directory of open-source AI tools, models and projects — updated daily.

Browse all tools →