DSPy

Stanford's framework for programming language models with modular Python code and automatic prompt optimization, not hand-written prompts.

Agents & Automation Open Source Open Source
Researched · Published · Reviewed
RECATOOLS Score
7.5 / 10
Founded
2023
HQ
Stanford, California, USA
Users
35K+ GitHub stars
Developer
Stanford NLP

Overview

DSPy (Declarative Self-improving Python) is an open-source (MIT) framework from the Stanford NLP group for programming language models instead of hand-crafting prompts. You define typed input/output signatures, compose modules like ChainOfThought and ReAct, and let DSPy optimizers automatically tune prompts and weights against a metric. Created by Omar Khattab and collaborators, it is widely used for building classifiers, RAG pipelines, and agent loops. It integrates with many model providers and has become influential in structured LLM programming.

Advertisement

Pricing

Pricing shown for reference only. These figures reflect RECATOOLS research as of 16 Sep 2026 and may be out of date or incomplete. This is not financial or purchasing advice — always confirm the current price on the provider’s official website before making any decision.

Free
Free
Fully free and open-source (MIT); you pay only for the underlying model calls.

What you can produce with DSPy

  • Prompts treated as optimizable parameters rather than hand-tuned strings — the "program, don't prompt" shift itself
  • Automatic prompt optimization through its optimizers, against a metric you define
  • Low runtime overhead, which practitioners consistently credit
  • A production-credible framework rather than a research toy: Cursor, Databricks and Mistral use it, and Shopify reported a large cost reduction using it for metadata extraction
  • ⚠️ A steep learning curve and a dense vocabulary — signatures, modules and optimizers, themselves renamed from "teleprompters" — with a much-cited HN thread calling the abstractions confusing and convoluted, and noting that optimizers need a well-defined metric that is rarely guaranteed in practice
  • ⚠️ Pinned dependencies, not latest: DSPy moves fast and pulls fast-moving libraries, and a July 2025 Hugging Face tokenizers update broke users outright
Advertisement
RECATOOLS Verdict

What this is for: Building LLM pipelines and agents as modular, optimizable Python programs instead of brittle prompt strings.

Who this is for: ML engineers and researchers who want systematic, reproducible prompt/weight optimization over trial-and-error prompting.

Availability: Free and open-source (MIT) from Stanford NLP; model API costs are separate.

Independent AI-assisted assessment by RECATOOLS.

What people say

With its "program, don't prompt" philosophy, DSPy is one of the most influential ideas in LLM engineering, backed by ~300 contributors and 500+ dependent projects. Production credibility is unusually strong for a research framework: teams at Cursor, Databricks, and Mistral use it, and Shopify reported a large cost reduction using DSPy for metadata extraction. Fans praise low runtime overhead and treating prompts as optimizable parameters rather than hand-tuned strings.

The two consistent criticisms are the learning curve and framework churn. DSPy introduces a dense vocabulary — signatures, modules, and optimizers (formerly "teleprompters," itself a rename) — and a much-cited HN thread called its abstractions "confusing, convoluted... similar to LangChain, offering more friction than actual benefit," noting that its optimizers need a well-defined metric that's rarely guaranteed in practice. On stability, DSPy moves fast and pulls latest dependencies: a July 2025 Hugging Face tokenizers update broke DSPy users, and there are open issues asking it to pin fast-moving libraries.

DSPy is a powerful, well-adopted paradigm shift. The price of entry is a steep learning curve and the need to pin dependencies, because the surface changes underneath you.

Summary of public user & expert reviews, compiled by RECATOOLS.

About this listing

Researched on
Published on
Last reviewed

This entry was compiled from publicly available data including DSPy's official website, press releases, documentation, and reputable third-party publications. RECATOOLS is not affiliated with DSPy unless explicitly stated.

Data accuracy

Third-party AI tools update their pricing, features, availability, and policies frequently. Information here may be outdated by the time you read this — we make reasonable efforts to keep listings current, but cannot guarantee absolute accuracy.

For the latest details, please refer to DSPy directly →

Spotted something out of date? Suggest an update →

Advertisement