dspy-optimizer-selection

Solid

This skill should be used when the user asks to "choose a DSPy optimizer", "compare DSPy optimizers", "which teleprompter should I use", "optimize prompts or weights", mentions LabeledFewShot, BootstrapFewShotWithRandomSearch, KNNFewShot, COPRO, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, or BetterTogether, or needs a cost-aware DSPy optimization plan.

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 Optimizer Selection ## Goal Choose the smallest DSPy optimizer that matches the data, budget, and artifact being tuned. Establish a baseline before compiling anything. ## Selection Matrix | Need | Start with | Notes | |------|------------|-------| | Include a few labeled examples | `dspy.LabeledFewShot` | Random labeled demos; useful as a baseline | | About 10 examples | `dspy.BootstrapFewShot` | Teacher-generated demos with metric filtering | | 50+ examples and stronger demo search | `dspy.BootstrapFewShotWithRandomSearch` | Searches multiple demo sets; alias: `dspy.BootstrapRS` | | Per-input nearest demos | `dspy.KNNFewShot` | Retrieves nearby examples before bootstrapping | | Instruction-only hill climbing | `dspy.COPRO` | Coordinate ascent over instructions | | Instruction and demo search | `dspy.MIPROv2` | Bayesian search; install `dspy[optuna]` | | Mini-batch introspective rules or demos | `dspy.SIMBA` | Uses output variability and self-reflection | | Rich textual feedback and trace reflection | `dspy.GEPA` | Metric must accept five arguments | | Distill prompts into model weights | `dspy.BootstrapFinetune` | Requires a fine-tunable LM and `set_lm()` | | Combine candidate programs | `dspy.Ensemble` | Trades inference cost for robustness | | Sequence prompt and weight optimization | `dspy.BetterTogether` | Meta-optimizer for configurable optimizer chains | ## Workflow 1. Split data into train and validation sets. 2. Evaluate the uncompiled program with [dspy...

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