What problem does it solve?
DSPy helps you stop manually hand-crafting prompts by letting you describe the task declaratively and then automatically optimize the prompts using your data and evaluation metrics.
Core Features & Use Cases
- Declarative LM programs: Define tasks using signatures (inputs → outputs) and compose them into modules like predictors and pipelines.
- Automatic prompt optimization: Compile and improve modules using teleprompters (e.g., BootstrapFewShot, MIPRO) driven by a validation metric.
- RAG and agentic workflows: Build retrieval-augmented generation, reranking, and multi-hop pipelines using DSPy’s built-in primitives.
- Provider-agnostic LM configuration: Switch between OpenAI, Anthropic, or local models (e.g., Ollama) without rewriting your logic.
Quick Start
Configure DSPy with your preferred model, define a signature for a question-answering task, and run a prediction to get an answer.