DSPy Framework
progressive_disclosure:
entry_point:
summary: "Declarative framework for automatic prompt optimization treating prompts as code"
when_to_use:
- "When optimizing prompts systematically with evaluation data"
- "When building production LLM systems requiring accuracy improvements"
- "When implementing RAG, classification, or structured extraction tasks"
- "When version-controlled, reproducible prompts are needed"
quick_start:
- "pip install dspy-ai"
- "Define signature: class QA(dspy.Signature): question = dspy.InputField(); answer = dspy.OutputField()"
- "Create module: qa = dspy.ChainOfThought(QA)"
- "Optimize: optimizer.compile(qa, trainset=examples)"
token_estimate:
entry: 75
full: 5500