Dspy Better Together

Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.

125 stars 13 forksAI, LLMs & Agents 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-better-together
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-better-together ~/.claude/skills/dspy-better-together

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 BetterTogether

## Goal

Sequence prompt and weight optimizers, evaluate intermediate programs, and return the best candidate.

## Prerequisites

- Use DSPy `3.2.1` or later in the stable `3.2.x` series.
- Assign an LM directly to every predictor with `student.set_lm(lm)`.
- Keep a validation set, or allow `BetterTogether` to hold out part of the trainset.
- Confirm the LM provider supports fine-tuning before including `BootstrapFinetune`.

## Basic Pattern

```python
import dspy

lm = dspy.LM("openai/gpt-4o-mini")
dspy.configure(lm=lm)

student = dspy.ChainOfThought("question -> answer")
student.set_lm(lm)

def metric(example, pred, trace=None):
    return float(example.answer.lower() == pred.answer.lower())

optimizer = dspy.BetterTogether(
    metric=metric,
    p=dspy.GEPA(
        metric=lambda gold, pred, trace=None, pred_name=None, pred_trace=None:
            dspy.Prediction(score=metric(gold, pred), feedback="Check answer correctness."),
        reflection_lm=dspy.LM("openai/gpt-4o"),
        auto="light",
    ),
    w=dspy.BootstrapFinetune(metric=metric),
)

compiled = optimizer.compile(
    student,
    trainset=trainset,
    valset=valset,
    strategy="p -> w -> p",
)
```

## Strategy Choices

| Strategy | Use it when |
|----------|-------------|
| `"p -> w"` | Start with a simple prompt-then-weight pass |
| `"p -> w -> p"` | Re-optimize prompts after fine-tuning |
| `"w -> p"` | Fine-tuning data is already strong |
Read the full skill on GitHub

Details

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

FAQ

What does the Dspy Better Together skill do?

Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.

How do I install the Dspy Better Together 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 Better Together 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

Dspy Adapters Multimodal

125

OmidZamani/dspy-skills

Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.

Images, Video & AudioIn 1 list13

Dspy Advanced Module Composition

125

OmidZamani/dspy-skills

Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.

Productivity & NotesIn 1 list13

Dspy Bootstrap Fewshot

125

OmidZamani/dspy-skills

Use for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.

AI, LLMs & AgentsIn 1 list13

Checkup

91

agentvitals/checkup

给 AI agent 做一次专业体检(AgentVitals · AI体检)。当用户说"做个体检 / 测测你自己 / checkup / vitals / 看看你多稳 / 去 AgentVitals 测一下 / 测福祉"时使用标准体检;当用户说"做个进阶体检 / 测骨气 / 测性格 / 测测你敢不敢说真话 / 测主动性 / 测创意"时使用进阶体检(骨气×主动×创意三维,免费每天 1 次)。逐题作答服务器下发的探针,获得评分与专属称号;标准体检与各平台 agent 同榜排名。Use when the user asks the agent to run a health checkup / wellbeing test / benchmark itself on AgentVitals ("run a checkup", "check your vitals", "test yourself", "how stable are you", "/checkup"), or an advanced personality checkup (backbone, proactivity, creativity).

AI, LLMs & AgentsIn 1 list

Dspy Embedding Retrieval

125

OmidZamani/dspy-skills

Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models.

AI, LLMs & AgentsIn 1 list13

Checkup

91

agentvitals/checkup

Give your AI agent a professional health checkup (AgentVitals). Use when the user asks the agent to run a checkup / test itself / benchmark itself ("run a checkup", "check your vitals", "test yourself", "how stable are you", "/checkup"), or an advanced personality checkup (backbone, proactivity, creativity). 给 AI agent 做一次专业体检(AgentVitals · AI体检)。当用户说"做个体检 / 测测你自己 / checkup / 看看你多稳 / 测福祉 / 测骨气"时使用。

AI, LLMs & AgentsIn 1 list

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.