dspy  by stanfordnlp

Framework for programming language models, not prompting

created 2 years ago
26,796 stars

Top 1.5% on sourcepulse

GitHubView on GitHub
Project Summary

DSPy is a Python framework designed for building and optimizing modular AI systems that leverage large language models (LLMs). It targets developers and researchers who want to move beyond traditional prompt engineering by enabling them to program LLM interactions declaratively, leading to more robust and adaptable AI applications.

How It Works

DSPy treats LLM calls as compiled programs, abstracting away the complexities of prompt engineering. Users define their AI system's logic using Python, and DSPy's compiler optimizes prompts and weights through techniques like instruction tuning and demonstration optimization. This declarative approach allows for iterative refinement and self-improvement of the LLM's performance without manual prompt adjustments.

Quick Start & Requirements

  • Install via pip: pip install dspy
  • Latest from main: pip install git+https://github.com/stanfordnlp/dspy.git
  • Requires Python. Specific LLM backends may have additional dependencies.
  • Official documentation: https://dspy.ai/

Highlighted Details

  • Enables programming LLMs with Python, abstracting prompt engineering.
  • Offers algorithms for optimizing prompts and weights for LLM pipelines.
  • Supports modular AI system development, including RAG and agent loops.
  • Compiles declarative LM calls into self-improving pipelines.

Maintenance & Community

Licensing & Compatibility

  • The repository does not explicitly state a license in the provided README. Further investigation into the repository's LICENSE file is recommended for commercial use or closed-source linking.

Limitations & Caveats

The README does not specify any limitations or caveats regarding the framework's current state, supported platforms, or known issues. Users should consult the official documentation for potential limitations.

Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
62
Issues (30d)
47
Star History
3,009 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.