{
  "id": "dspy",
  "code": "PTL-0075",
  "term": "DSPy",
  "aliases": [
    "Declarative Self-improving Python"
  ],
  "category": "optimization",
  "definition": "DSPy is a framework that treats language-model pipelines as programs of declarative modules, and compiles them by automatically optimizing the prompts and few-shot demonstrations for each module against a metric.",
  "description": "Rather than hand-tuning prompt strings, developers specify input-output signatures and let optimizers bootstrap demonstrations or search instructions, making pipelines portable across models.",
  "example": null,
  "broader": [],
  "narrower": [],
  "related": [
    "automatic-prompt-engineer",
    "opro",
    "prompt-template"
  ],
  "introduced": 2023,
  "sources": [
    {
      "title": "DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines",
      "authors": "Khattab et al.",
      "year": 2023,
      "url": "https://arxiv.org/abs/2310.03714"
    }
  ],
  "url": "https://protologue.com/t/dspy/",
  "citation": "Protologue. (2026). DSPy. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.0.0, PTL-0075). https://protologue.com/t/dspy/"
}