Loading...
Discovering amazing AI tools


A Python framework for programming foundation models with declarative, self-improving pipelines and automated prompt/parameter optimization.

A Python framework for programming foundation models with declarative, self-improving pipelines and automated prompt/parameter optimization.
DSPy (Declarative Self‑improving Python) is a framework that lets developers program foundation models using compositional Python modules instead of brittle prompt engineering. Users declare inputs and outputs, compose modular components (classifiers, retrievers, agents, RAG pipelines), and DSPy compiles prompt templates, runs evaluations, and applies iterative optimizers to improve prompts and module parameters automatically. The framework includes built-in optimizers (e.g., BootstrapFewShot, BetterTogether), an evaluation API with metrics and dataset support, and tooling to iterate quickly on modular AI systems, yielding higher accuracy and consistency without manual tuning.


