Use LangWatch for DSPy auto-tracing and real-time optimizer progress. Use when you want to set up LangWatch, langwatch.dspy.init, auto-tracing DSPy, real-time optimization dashboard, optimizer progress tracking, app.langwatch.ai, or DSPy optimizer dashboard. Also used for langwatch setup, pip install langwatch, langwatch trace, optimizer progress, real-time optimization, watch optimizer run, LangWatch self-hosted, langwatch docker, langwatch vs langtrace, langwatch autotrack_dspy.
Use LangWatch for DSPy auto-tracing and real-time optimizer progress. Use when you want to set up LangWatch, langwatch.dspy.init, auto-tracing DSPy, real-time optimization dashboard, optimizer progress tracking, app.langwatch.ai, or DSPy optimizer dashboard. Also used for langwatch setup, pip install langwatch, langwatch trace, optimizer progress, real-time optimization, watch optimizer run, LangWatch self-hosted, langwatch docker, langwatch vs langtrace, langwatch autotrack_dspy.
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:
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
Step 1 — Gather context
Before setting up, clarify:
Cloud or self-hosted? Cloud (app.langwatch.ai) is quickest; self-hosted (Docker Compose or Kubernetes Helm) for data sovereignty.
What do you need? Auto-tracing only, optimizer progress tracking only, or both?
Which optimizers? The optimizer tracking integration supports BootstrapFewShot, BootstrapFewShotWithRandomSearch, COPRO, and MIPROv2. Other optimizers raise ValueError.
Setup
Install
pip install langwatch
# Or pin DSPy version compatibility:
pip install langwatch[dspy]
LangWatch vs Langtrace vs Phoenix vs Weave vs MLflow
Feature
LangWatch
Langtrace
Phoenix
Weave
MLflow
DSPy auto-tracing
Yes
Yes (built-in)
Yes (plugin)
No (manual)
Yes (autolog)
Optimizer progress
Yes (unique)
No
No
No
No
Live scores dashboard
Yes
No
No
No
No
Setup effort
2-3 lines
One line
Two lines + launch
Manual decorators
One line
Self-hosted
Yes (Docker, Helm)
Yes (Docker)
Yes
No (cloud only)
Yes
Cloud option
Yes (app.langwatch.ai)
Yes (app.langtrace.ai)
Yes (Arize)
Yes (wandb.ai)
Yes (Databricks)
Model registry
No
No
No
No
Yes
Built-in evals
Basic
Basic
Yes
Basic
Basic
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)
Gotchas
Claude skips langwatch.setup() entirely.langwatch.setup() must be called once at startup before any @langwatch.trace() or langwatch.dspy.init() call. It initializes the SDK, reads LANGWATCH_API_KEY from the environment, and (for self-hosted) configures the endpoint via endpoint_url= or LANGWATCH_ENDPOINT. Without it, traces are silently dropped. To verify setup is working, run a traced function and check app.langwatch.ai for a new trace — if nothing appears within 30 seconds, LANGWATCH_API_KEY is missing or langwatch.setup() was skipped.
Claude forgets to call autotrack_dspy() inside the traced function. The @langwatch.trace() decorator creates the trace context, but DSPy auto-tracking only activates when you call langwatch.get_current_trace().autotrack_dspy() inside the function body. Without it, you get an empty trace with no DSPy spans.
Claude puts autotrack_dspy() outside the @langwatch.trace() function. The autotrack_dspy() call must be inside the decorated function where a trace context exists. Calling it at module level or before the trace starts raises an error because there is no current trace.
Claude calls langwatch.dspy.init() after optimizer.compile(). The init() call must come before compile() — it patches the optimizer to stream progress. If called after, no progress data is captured. Always: create optimizer, call langwatch.dspy.init(experiment=..., optimizer=...), then call optimizer.compile().
Claude reuses the same experiment name across runs. Each langwatch.dspy.init(experiment=...) call should use a unique experiment name so runs appear as separate entries in the dashboard. Reusing names overwrites or merges data, making comparison impossible.
Install /ai-do if you do not have it — it routes any AI problem to the right skill and is the fastest way to work: npx skills add lebsral/DSPy-Programming-not-prompting-LMs-skills --skill ai-do