Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
lebsral avatar

Dspy Langwatch

  • 4 installs
  • 11 repo stars
  • Updated June 28, 2026
  • lebsral/dspy-programming-not-prompting-lms-skills

Helps with ai & agent building tasks.

About

dspy-langwatch is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • dspy-langwatch
  • AI & Agent Building
  • AI-coding skill

Dspy Langwatch by the numbers

  • 4 all-time installs (skills.sh)
  • Ranked #13,372 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lebsral/dspy-programming-not-prompting-lms-skills --skill dspy-langwatch

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs4
repo stars11
Last updatedJune 28, 2026
Repositorylebsral/dspy-programming-not-prompting-lms-skills

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

LangWatch — Auto-Tracing + Real-Time Optimizer Progress for DSPy

Guide the user through setting up LangWatch for automatic DSPy tracing and live optimizer progress tracking.

What is LangWatch

LangWatch is an open-source LLMOps platform with two distinct DSPy integrations:

1. Auto-tracing (inference): automatically captures module inputs/outputs, LM calls, and retrieval queries 2. Optimizer progress tracking (unique feature): streams live step-by-step scores, predictor states, and cost as optimizers run

No other observability tool (Langtrace, Phoenix, Weave, MLflow) patches DSPy optimizers to stream live progress.

When to use LangWatch

Use LangWatch when:

  • You run long optimization passes and want to see progress in real-time
  • You want auto-tracing of DSPy inference with no manual decorators
  • You want a dashboard showing optimizer scores, cost, and predictor state as they happen
  • You need both inference tracing AND optimizer monitoring in one tool

Do NOT use LangWatch when:

  • You only need tracing and want the simplest one-line setup — see /dspy-langtrace
  • You want a local trace viewer with built-in evals — see /dspy-phoenix
  • Your team already uses W&B for experiment tracking — see /dspy-weave
  • You need a model registry and full ML lifecycle — see /dspy-mlflow

Setup

Install

pip install langwatch
# Or pin DSPy version compatibility:
pip install langwatch[dspy]

Cloud setup (quickest)

1. Sign up at app.langwatch.ai 2. Create a project and copy your API key 3. Set the environment variable:

export LANGWATCH_API_KEY="your-key"

Self-hosted setup

Docker Compose
git clone https://github.com/langwatch/langwatch.git
cd langwatch
docker compose up -d

Then point your SDK at your local instance:

export LANGWATCH_ENDPOINT="http://localhost:5560"
Helm chart (Kubernetes)

LangWatch provides a Helm chart for production Kubernetes deployments. See the LangWatch docs for Helm values and configuration.

Integration 1: Auto-Tracing (Inference)

Use @langwatch.trace() and autotrack_dspy() to automatically capture all DSPy calls during inference.

What gets traced

ComponentDetails captured
Module callsInputs/outputs per dspy.Module.forward()
LM callsModel name, messages, response, token counts
RetrievalsQueries, retrieved passages
Nested spansFull call tree with parent-child relationships

Basic auto-tracing

import langwatch
import dspy

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

@langwatch.trace()
def answer_question(question):
    langwatch.get_current_trace().autotrack_dspy()

    program = dspy.ChainOfThought("question -> answer")
    return program(question=question)

result = answer_question("What is DSPy?")
# View traces at app.langwatch.ai (or your self-hosted URL)

Tracing a full pipeline

import langwatch
import dspy

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

class RAGPipeline(dspy.Module):
    def __init__(self):
        self.retrieve = dspy.Retrieve(k=3)
        self.answer = dspy.ChainOfThought("context, question -> answer")

    def forward(self, question):
        context = self.retrieve(question).passages
        return self.answer(context=context, question=question)

pipeline = RAGPipeline()

@langwatch.trace()
def handle_query(question):
    langwatch.get_current_trace().autotrack_dspy()
    return pipeline(question=question)

result = handle_query("How do refunds work?")
# LangWatch captures:
#   - The RAGPipeline call
#   - The Retrieve call (query, passages)
#   - The ChainOfThought LM call (prompt, response, tokens)

Adding metadata to traces

@langwatch.trace()
def handle_query(user_id, question):
    trace = langwatch.get_current_trace()
    trace.autotrack_dspy()
    trace.update(metadata={"user_id": user_id, "environment": "production"})
    return pipeline(question=question)

Integration 2: Optimizer Progress Tracking (Unique Feature)

LangWatch patches DSPy optimizer classes to stream live step-by-step progress. This is LangWatch's killer feature — no other tool does this.

What the optimizer dashboard shows

  • Live scores: see each trial's score as it completes
  • Predictor states: which instructions and demos the optimizer is testing
  • LM calls: every call the optimizer makes during search
  • Cost tracking: running cost total as the optimizer runs
  • Progress bar: how far through the optimization you are

Supported optimizers

OptimizerSupported
dspy.BootstrapFewShotYes
dspy.BootstrapFewShotWithRandomSearchYes
dspy.COPROYes
dspy.MIPROv2Yes
OthersRaises ValueError

Setup optimizer tracking

import langwatch.dspy
import dspy

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

trainset = [...]  # your training examples

def metric(example, prediction, trace=None):
    return prediction.answer.strip().lower() == example.answer.strip().lower()

program = dspy.ChainOfThought("question -> answer")
optimizer = dspy.MIPROv2(metric=metric, auto="medium")

# Initialize LangWatch optimizer tracking
langwatch.dspy.init(
    experiment="mipro-medium-run1",
    optimizer=optimizer,
)

# Run optimization — progress streams to the LangWatch dashboard
optimized = optimizer.compile(program, trainset=trainset)
# Watch live progress at app.langwatch.ai

Tracking BootstrapFewShot

import langwatch.dspy
import dspy

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

program = dspy.ChainOfThought("question -> answer")
optimizer = dspy.BootstrapFewShot(metric=metric, max_bootstrapped_demos=4)

langwatch.dspy.init(
    experiment="bootstrap-4demos",
    optimizer=optimizer,
)

optimized = optimizer.compile(program, trainset=trainset)

Comparing multiple optimizer runs

Run multiple experiments with different names — they appear side-by-side in the LangWatch dashboard:

import langwatch.dspy
import dspy

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

experiments = [
    ("bootstrap-4", dspy.BootstrapFewShot, {"metric": metric, "max_bootstrapped_demos": 4}),
    ("bootstrap-8", dspy.BootstrapFewShot, {"metric": metric, "max_bootstrapped_demos": 8}),
    ("mipro-light", dspy.MIPROv2, {"metric": metric, "auto": "light"}),
    ("mipro-medium", dspy.MIPROv2, {"metric": metric, "auto": "medium"}),
]

for name, opt_class, kwargs in experiments:
    program = dspy.ChainOfThought("question -> answer")
    optimizer = opt_class(**kwargs)
    langwatch.dspy.init(experiment=name, optimizer=optimizer)
    optimized = optimizer.compile(program, trainset=trainset)

LangWatch vs Langtrace vs Phoenix vs Weave vs MLflow

FeatureLangWatchLangtracePhoenixWeaveMLflow
DSPy auto-tracingYesYes (built-in)Yes (plugin)No (manual)Yes (autolog)
Optimizer progressYes (unique)NoNoNoNo
Live scores dashboardYesNoNoNoNo
Setup effort2-3 linesOne lineTwo lines + launchManual decoratorsOne line
Self-hostedYes (Docker, Helm)Yes (Docker)YesNo (cloud only)Yes
Cloud optionYes (app.langwatch.ai)Yes (app.langtrace.ai)Yes (Arize)Yes (wandb.ai)Yes (Databricks)
Model registryNoNoNoNoYes
Built-in evalsBasicBasicYesBasicBasic

Decision guide

What do you need?
|
+- Watch optimizer progress live? -> LangWatch (this skill)
+- Easiest auto-tracing setup? -> Langtrace (/dspy-langtrace)
+- Tracing + evals (local)? -> Phoenix (/dspy-phoenix)
+- Tracing + experiment tracking (cloud)? -> Weave (/dspy-weave)
+- Full ML lifecycle + model registry? -> MLflow (/dspy-mlflow)

Cross-references

  • Langtrace (auto-instrumentation, easiest one-line setup) — /dspy-langtrace
  • Arize Phoenix (open-source with evals) — /dspy-phoenix
  • W&B Weave (team dashboards, experiment tracking) — /dspy-weave
  • MLflow (full ML lifecycle, model registry) — /dspy-mlflow
  • Lightweight experiment tracking (JSONL-based, no extra tools) — /ai-tracking-experiments
  • Production monitoring/ai-monitoring
  • For worked examples, see examples.md

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.