DSPy
Builds Python LLM programs and optimizes their instructions and examples against defined evaluation metrics.
Description
DSPy is an open-source Python framework for programming applications that use language models. Developers define task inputs and outputs with signatures and compose modules instead of relying exclusively on manually written prompt templates. The library includes modules for predictions, step-by-step reasoning, and agent workflows with tools. These components can be combined for classification, information extraction, retrieval-augmented generation, and multi-step research. DSPy optimizers select instructions and examples using a dataset and an evaluation metric. Teams need a meaningful definition of success and should validate the resulting program on their own tasks. The Python package is free to use. Model access, compute, and evaluation workloads must be provisioned separately; optimization does not guarantee better performance without suitable data.