About this project
DSPy (Declarative Self-improving Python) is a framework from Stanford NLP for programming—rather than prompting—foundation models. Instead of hand-crafting brittle prompts, developers write compositional Python code and let DSPy optimize the prompts and weights of their language model programs.
The project targets modular AI system development, with support for simple classifiers, sophisticated retrieval-augmented generation (RAG) pipelines, and agent loops. Its core idea is declarative programming: you describe the desired behavior and data flow, and DSPy compiles and tunes the underlying model interactions to deliver high-quality outputs.
Installation is via pip (`pip install dspy`), or directly from the main branch on GitHub. Documentation is hosted at dspy.ai, and the project maintains a Discord community for help and contributions.
The README also lists a series of research papers underlying the framework, including work on GEPA (reflective prompt evolution), optimizing instructions and demonstrations for multi-stage LM programs, compiling declarative LM calls into self-improving pipelines, fine-tuning combined with prompt optimization, auto-optimized training hyperparameters, Wikipedia-like article writing, extreme multi-label classification, DSPy assertions, and Demonstrate-Search-Predict. Citation information is provided for academic use.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.