---
slug: "dspy"
name: "DSPy"
effect: "Builds LM programs from typed signatures and modules, then optimizes their prompts against a metric"
category: "model-api"
url: "https://dspy.ai"
github: "stanfordnlp/dspy"
pricing: "open-source"
license: "MIT"
tags: ["python", "prompt-optimization", "signatures", "agents", "rag"]
platforms: []
install_kind: "pip"
date_added: "2026-10-14"
drop_score: 57
stars: 38639
pushed_at: "2026-10-14T14:05:08Z"
signals_status: "ok"
signals_fetched_at: "2026-10-15T01:18:56.827Z"
page: "https://agenttooldrop.com/tools/dspy"
---

# DSPy

Builds LM programs from typed signatures and modules, then optimizes their prompts against a metric

Category: Models and APIs. Pricing: Open source. License: MIT.

## Why you would want it

DSPy replaces hand-written prompts with Python code: signatures declare typed inputs and outputs, and modules such as Predict, ChainOfThought and ReAct control how a signature runs, including tool use. You compose modules with plain Python control flow into pipelines, RAG systems or agent loops. Optimizers such as GEPA, MIPROv2 and BootstrapFewShot take examples and a scoring function and tune the program's prompts and weights, and the result can be saved and reloaded.

## Best for

- Multi-step LLM pipelines
- Teams with labeled examples and a metric
- Replacing brittle prompt templates

## Use it when

You want LLM behavior defined in code and improved systematically against a metric rather than by editing prompts by hand.

## Skip it if

You only need a single prompt or one structured extraction call. Optimization needs example data and a scoring function, and it requires Python 3.10 or later.

## Install

Install with pip:

```sh
pip install dspy
```

Source: https://github.com/stanfordnlp/dspy#readme

## Live signals

Fetched 2026-10-15T01:18:56.827Z (status: ok).

- Repository: stanfordnlp/dspy
- Stars: 38,639
- Forks: 3,423
- Open issues and PRs: 807
- License (GitHub): MIT
- Last push: 2026-10-14
- Latest release: 3.4.1 (2026-10-12)

## Links

- Website: https://dspy.ai
- GitHub: https://github.com/stanfordnlp/dspy
- Install instructions verified at: https://github.com/stanfordnlp/dspy#readme
- Source for this entry: https://dspy.ai
- AgentToolDrop page: https://agenttooldrop.com/tools/dspy
- Full catalog (JSON): https://agenttooldrop.com/tools.json
