dspy-miprov2
Installation
SKILL.md
Optimize Prompts with MIPROv2
Guide the user through using dspy.MIPROv2, DSPy's most powerful prompt optimizer. MIPROv2 jointly optimizes instructions and few-shot demonstrations to maximize a metric on your training data.
What is MIPROv2
MIPROv2 (Multi-prompt Instruction PRoposal Optimizer v2) is DSPy's recommended optimizer for prompt optimization. Unlike simpler optimizers that only tune few-shot examples, MIPROv2 jointly optimizes:
- Instructions — the natural-language task descriptions in each module's prompt
- Few-shot demonstrations — the input-output examples included in each module's prompt
It works by proposing candidate instructions, bootstrapping demonstrations, and searching over combinations using Bayesian optimization. The result is a program with better prompts that produce higher-quality outputs.
When to use MIPROv2
- Production optimization — you want the best prompt quality DSPy can deliver
- 50+ training examples — MIPROv2 needs enough data to search effectively
- Both instructions and demos matter — you want the optimizer to tune everything, not just examples
- You have budget for multiple LM calls — MIPROv2 is more expensive than BootstrapFewShot but produces better results