Dspy Miprov2 Optimizer

Use for MIPROv2, Bayesian optimization, instruction and demo tuning, and high-performance DSPy program optimization.

125 stars 13 forksSoftware Development Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add OmidZamani/dspy-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add OmidZamani/dspy-skills --skill dspy-miprov2-optimizer
Manual install
git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git /tmp/dspy-skills
mkdir -p ~/.claude/skills
cp -r /tmp/dspy-skills/skills/dspy-miprov2-optimizer ~/.claude/skills/dspy-miprov2-optimizer

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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
Read the full skill on GitHub

Details

Skill name
dspy-miprov2-optimizer
Path
skills/dspy-miprov2-optimizer/SKILL.md
License
MIT
Repo updated
23 June 2026

FAQ

What does the Dspy Miprov2 Optimizer skill do?

Use for MIPROv2, Bayesian optimization, instruction and demo tuning, and high-performance DSPy program optimization.

How do I install the Dspy Miprov2 Optimizer skill?

Claude Code plugin: /plugin marketplace add OmidZamani/dspy-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Dspy Miprov2 Optimizer popular?

It lives in OmidZamani/dspy-skills, which has 125 GitHub stars and 13 forks, and is included in 1 curated skill list.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.