dspy-miprov2-optimizer

Solid

This skill should be used when the user asks to "optimize a DSPy program", "use MIPROv2", "tune instructions and demos", "get best DSPy performance", "run Bayesian optimization", mentions "state-of-the-art DSPy optimizer", "joint instruction tuning", or needs maximum performance from a DSPy program with substantial training data (200+ examples).

AI & Automation 78 stars 10 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 90/100

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

Skill Content

# DSPy MIPROv2 Optimizer ## Goal Jointly optimize instructions and few-shot demonstrations using Bayesian Optimization for maximum performance. ## When to Use - You have **200+ training examples** - You can afford longer optimization runs (40+ trials) - You need state-of-the-art performance - Both instructions and demos need tuning ## Related Skills - For limited data (10-50 examples): [dspy-bootstrap-fewshot](../dspy-bootstrap-fewshot/SKILL.md) - For agentic systems: [dspy-gepa-reflective](../dspy-gepa-reflective/SKILL.md) - Measure improvements: [dspy-evaluation-suite](../dspy-evaluation-suite/SKILL.md) ## Inputs | Input | Type | Description | |-------|------|-------------| | `program` | `dspy.Module` | Program to optimize | | `trainset` | `list[dspy.Example]` | 200+ training examples | | `metric` | `callable` | Evaluation function | | `auto` | `str` | "light", "medium", or "heavy" | | `num_trials` | `int` | Optimization trials (40+) | ## Outputs | Output | Type | Description | |--------|------|-------------| | `compiled_program` | `dspy.Module` | Fully optimized program | ## Workflow Install the optional Optuna dependency before using MIPROv2: ```bash pip install -U "dspy[optuna]>=3.2.1,<3.3" ``` ### Three-Stage Process 1. **Bootstrap** - Generate candidate demonstrations 2. **Propose** - Create grounded instruction candidates 3. **Search** - Bayesian optimization over combinations ### Phase 1: Setup ```python import dspy from dspy.teleprompt import MIPROv...

Details

Author
OmidZamani
Repository
OmidZamani/dspy-skills
Created
5 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category