Langfuse, LangSmith and Braintrust
Keep watching production where you already do. Viewport Evals turns those traces into tests and sends its scores back.
You probably already watch your agents in production with Langfuse, LangSmith, Braintrust or Phoenix. Keep doing that. Viewport Evals is the part that runs before you merge. It turns a real trace into a test, fails the pull request that breaks it, and sends the result back to the tool your team already looks at.
Who does what
| Your observability tool | Viewport Evals | |
|---|---|---|
| Runs | In production, all the time | On your laptop and in CI, before merge |
| Looks at | Live traces, latency, cost and feedback | Recorded runs, replayed offline |
| Decides | Nothing on its own. People read it. | Pass or fail. A failure blocks the merge. |
| Best at | Finding the problem | Keeping it fixed |
Neither replaces the other. Your observability tool shows you the run that went wrong. Evals makes sure it never goes wrong the same way again.
Traces in
Found a bad run in production? Import it. Evals reads a Langfuse, LangSmith or Braintrust trace by id, or an export file, and writes a fixture with every model call and tool result pinned, plus a case you can fill in from the trace.
# One command turned the production trace into this test (run it from this directory):
#
# uv run viewport-evals import langfuse-export.json --case refund-from-prod --tag golden
# uv run viewport-evals run --mode rescore --accept # fill the ~ placeholders from the trace, then review
#
# It wrote evals/refund-from-prod.yaml (prompt, replay: {tools: recorded}, expect.baseline) and its fixture, whose
# run is the trace (source: imported). Online, ``import langfuse:<trace id>`` fetches it with your keys.// One command turned the production trace into this test (run it from this directory):
//
// npx @viewportai/evals import langfuse-export.json --case refund-from-prod --tag golden
// npx @viewportai/evals run --mode rescore --accept # fill the ~ placeholders from the trace, then review
//
// It wrote evals/refund-from-prod.yaml (prompt, replay: { tools: recorded }, expect.baseline) and its fixture,
// whose run is the trace (source: imported). Online, `import langfuse:<trace id>` fetches it with your keys.From the command line it is one step:
npx @viewportai/evals import langfuse:<trace id> --case refund-from-prod --tag goldenThe new version of your agent then runs against the tool responses production really returned, and the case says
how its behavior may differ. Pass --sample 50 to turn a production sample into a golden set in one go.
Production replay covers serving tools from the trace and diffing against it.
Scores out
Every run can report back. Each exporter is a reporter, so it sees exactly what CI saw:
npx @viewportai/evals run --reporter langfuse
npx @viewportai/evals run --reporter braintrust --reporter junit=reports/evals.xml| Reporter | Lands as |
|---|---|
langfuse | one trace per case, with scores |
langsmith | one run per case, with feedback |
braintrust | an experiment, one row per case |
phoenix | one span per case, with annotations |
otel | one span per case through your OpenTelemetry setup |
Each case reports whether it passed, its pass rate across runs, and one score per assertion, such as
invariants.approval before any send. Ids are stable, so exporting the same run twice updates its scores instead of
duplicating them. Keys and endpoints are in the exporters guide.
What it will not do
- Block a merge because their API is down. A failed export prints one line and leaves the verdict alone. Pass
--strict-exportif you want it to fail the run instead. - Spend tokens in CI. Replays never call a model, so CI runs offline, with no API keys.
- Ask you to move. Your traces stay where they are. Evals reads them and writes scores back.