Skip to main content
Agent Frameworks & OrchestrationProduction

DSPy

stanfordnlp / dspy

Write prompts, retrieval and tool calls as composable modules, then optimise prompts and examples against a metric instead of hand-tuning chains.

39.2k stars 3535 forks Python Language MIT License Last push 2026-11-19

Why choose it

  • Modules and signatures make prompt programs testable.
  • Optimisers can search demonstrations and instructions against a metric.
  • A better fit than ad-hoc string concatenation when you have evaluation data.

Not for

You have no evaluation set and no way to measure improvement.
You only need one static prompt with no optimisation loop.

Minimum setup

  1. Start with a small labelled set and a simple metric.
  2. Build one module and record the baseline score.
  3. Run an optimiser and compare on a held-out set, not the training examples.

Dependencies and cost

Check runtime, model weights and external service dependencies in the README.

License and usage boundaries

Code is MIT; model weights, training data and generated content may have separate terms — check each before commercial use.

Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

Alternatives and neighbors

  • LangGraph — Production,Write an agent as a stateful graph: nodes, edges, checkpoints, human approval and rollback are explicit.
  • LlamaIndex — Production,A data framework for RAG and application layers: connectors, indexes, retrieval, query engines and agents.

Next steps

  • Open GitHub and read the README, LICENSE, latest release and issues first.
  • Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • Run a small sample first, then decide on production; never start with production data.

GitHub repository ↗ Docs ↗ Add to compare

Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.