builder

DSPy

Program language models instead of prompting them.

dspy.ai ↗API

what it is

DSPy is an open-source Python framework from Stanford for programming, rather than prompting, language models. You build modular AI systems in code, and DSPy's algorithms optimise their prompts and weights for you.

who it's for

Python developers and researchers building reliable LLM pipelines and agents.

how to start

  1. 1Install it: pip install dspy
  2. 2Configure your language model and API key.
  3. 3Write your program as DSPy modules.
  4. 4Use an optimizer to improve it, following the docs at dspy.ai.

what you need

  • Python
  • An LLM API key or a local model

pricing

Free and open source

You pay your model provider for any API usage

checked Oct 10, 2026

key features

  • Declarative modules instead of prompts
  • Prompt and weight optimisers
  • Works from classifiers to agents
  • Open source

similar agents

alternatives

links

sources