Optimization
One of DSPy.rb’s most powerful features is automatic optimization. Instead of manually tweaking prompts, you can use optimizers to systematically improve your modules.
Why Optimize?
Traditional prompt engineering is:
- Time-consuming and manual
- Inconsistent across different inputs
- Hard to maintain as requirements change
DSPy.rb optimization is:
- Automatic and data-driven
- Consistent and reproducible
- Adapts to new requirements
Optimization Guides
Prompt Optimization
Learn the fundamentals of how DSPy.rb optimizes prompts automatically using examples and metrics.
Simple Optimizer
Start with BootstrapFewShot - the easiest optimizer that generates effective few-shot examples.
MIPROv2
Advanced optimization with MIPROv2 for production-grade performance and reliability.
Evaluation
Build metrics and evaluation frameworks to measure and improve your modules systematically.
Getting Started
We recommend starting with:
- Understanding Prompt Optimization concepts
- Trying the Simple Optimizer on your modules
- Building proper Evaluation metrics
- Graduating to MIPROv2 for production use