DSPy

DSPy is an open-source framework from Stanford researchers for programming LLM pipelines declaratively and optimizing their prompts automatically.

3 articlesLast mentioned

DSPy is an open-source Python framework developed by Stanford NLP researchers and released in 2023. It lets developers declare pipelines that use large language models as programs rather than hand-written prompts, and then automatically improves those prompts and model weights with optimization algorithms. Its core building blocks are signatures that define inputs and outputs, modules that encapsulate reasoning strategies, and optimizers that refine prompts using examples and evaluation metrics.

The name is presented as an abbreviation of Declarative Self-improving Python, and the framework grew out of the earlier Demonstrate-Search-Predict (DSP) research. DSPy is used for retrieval-augmented generation, classification, information extraction, and agent pipelines, and is often applied to obtain consistent, structured outputs across different LLMs.

This entry is based on AIPOST articles and widely known facts. If something is wrong, please send us a correction request.

Articles covering this entry

  • AI Agent Tuning: When to Rewrite Prompts and When to Retrain WeightsAI Performance ·

    The DSPy framework instead places them in the prompt and searches for the best combination on a development set, with results on GSM8K that often surpass human-…

    Read article
  • Temperature, Attention and Context Rot: Model Mechanics Behind Agent DesignAI in Practice ·

    DSPy signatures express the same contract declaratively in code, defining typed input and output fields such as name, email and intent, and compile them into pr…

    Read article
  • AI Contract Review: Where Agents Fail on 40,000 Documents and How to Catch ItAI in Practice ·

    Preprocessing with document intelligence tooling, OCR and DSPy, a framework for programmatically optimizing prompts and language model pipelines.

    Read article

Found a mistake or missing an entry?

Wiki entries are based on AIPOST articles and widely known facts. If an entry is wrong, send us a correction request and we will check and fix it. Names from new articles are added to the wiki after the article is published.