dspy-copro

Installation
SKILL.md

Instruction Optimization with dspy.COPRO

Guide the user through using dspy.COPRO to automatically generate, evaluate, and select the best instructions for their DSPy program's signatures.

What is COPRO

dspy.COPRO (Collaborative Prompting) is a DSPy optimizer that improves your program by finding better instructions for each signature. Instead of you hand-writing prompt instructions, COPRO generates many candidate instructions, evaluates each one against your metric, and keeps the best.

Key properties:

  • Generates instruction candidates -- uses an LM to propose alternative instructions for each predictor in your program
  • Evaluates each candidate -- scores every candidate against your metric on the training set
  • Iterates in depth -- runs multiple rounds, using top performers from round N to inform candidates in round N+1
  • Tunes instructions and prefixes -- optimizes both the signature docstring (instruction) and output field prefixes
  • Works with any program -- optimizes all predictors in a program sequentially

When to use COPRO

Use dspy.COPRO when:

Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
4
GitHub Stars
5
First Seen
Mar 17, 2026