dspy

Solid

Build complex AI systems with declarative programming, optimize prompts automatically, create modular RAG systems and agents with DSPy - Stanford NLP's framework for systematic LM programming

AI & Automation 191,515 stars 33299 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# DSPy: Declarative Language Model Programming ## When to Use This Skill Use DSPy when you need to: - **Build complex AI systems** with multiple components and workflows - **Program LMs declaratively** instead of manual prompt engineering - **Optimize prompts automatically** using data-driven methods - **Create modular AI pipelines** that are maintainable and portable - **Improve model outputs systematically** with optimizers - **Build RAG systems, agents, or classifiers** with better reliability **GitHub Stars**: 22,000+ | **Created By**: Stanford NLP ## Installation ```bash # Stable release pip install dspy # Latest development version pip install git+https://github.com/stanfordnlp/dspy.git # With specific LM providers pip install dspy[openai] # OpenAI pip install dspy[anthropic] # Anthropic Claude pip install dspy[all] # All providers ``` ## Quick Start ### Basic Example: Question Answering ```python import dspy # Configure your language model lm = dspy.Claude(model="claude-sonnet-4-5-20250929") dspy.settings.configure(lm=lm) # Define a signature (input → output) class QA(dspy.Signature): """Answer questions with short factual answers.""" question = dspy.InputField() answer = dspy.OutputField(desc="often between 1 and 5 words") # Create a module qa = dspy.Predict(QA) # Use it response = qa(question="What is the capital of France?") print(response.answer) # "Paris" ``` ### Chain of Thought Reasoning ```python import dspy lm...

Details

Author
NousResearch
Repository
NousResearch/hermes-agent
Created
10 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category