dspy-bootstrap-fewshot

Solid

This skill should be used when the user asks to "bootstrap few-shot examples", "generate demonstrations", "use BootstrapFewShot", "optimize with limited data", "create training demos automatically", mentions "teacher model for few-shot", "10-50 training examples", or wants automatic demonstration generation for a DSPy program without extensive compute.

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 Bootstrap Few-Shot Optimizer ## Goal Automatically generate and select optimal few-shot demonstrations for your DSPy program using a teacher model. ## When to Use - You have **10-50 labeled examples** - Manual example selection is tedious or suboptimal - You want demonstrations with reasoning traces - Quick optimization without extensive compute ## Related Skills - For more data (200+ examples): [dspy-miprov2-optimizer](../dspy-miprov2-optimizer/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` | Your DSPy program to optimize | | `trainset` | `list[dspy.Example]` | Training examples | | `metric` | `callable` | Evaluation function | | `metric_threshold` | `float` | Numerical threshold for accepting demos (optional) | | `max_bootstrapped_demos` | `int` | Max teacher-generated demos (default: 4) | | `max_labeled_demos` | `int` | Max direct labeled demos (default: 16) | | `max_rounds` | `int` | Max bootstrapping attempts per example (default: 1) | | `teacher_settings` | `dict` | Configuration for teacher model (optional) | ## Outputs | Output | Type | Description | |--------|------|-------------| | `compiled_program` | `dspy.Module` | Optimized program with demos | ## Workflow ### Phase 1: Setup ```python import dspy from dspy.teleprompt imp...

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