---
slug: "dspy"
name: "DSPy"
effect: "Builds LM programs from typed signatures and modules, then optimizes their prompts against a metric"
category: "model-api"
tier: "standard"
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"
rank: null
rising_score: 39
stars: 38645
star_velocity: 28.1
velocity_basis: "since creation"
created_at: "2023-01-09T21:01:51Z"
pushed_at: "2026-10-15T01:20:23Z"
signals_status: "ok"
signals_fetched_at: "2026-10-15T05:02:40.000Z"
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. Tier: standard (a well-known tool, listed for reference, not ranked). 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-15T05:02:40.000Z (status: ok).

- Repository: stanfordnlp/dspy
- Repository created: 2023-01-09
- Stars: 38,645 (GitHub's count; it cannot be authenticated)
- Stars per day, since repo creation: 28.1 (an average over the repo's life, not a growth rate)
- Forks: 3,423
- Open issues and PRs: 805
- License (GitHub): MIT
- Last push: 2026-10-15
- 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
