Evals

Score exporters

Send every verdict and assertion score to Langfuse, Braintrust, LangSmith or Phoenix, or as OpenTelemetry spans, from the same run that gates CI.

Viewport Evals sits next to your observability platform: traces come in through production replay, and scores go out through exporters. An exporter is a reporter, so you add it with --reporter and it sees the same verdicts as every other reporter:

uv run viewport-evals run --reporter langfuse
pnpm exec viewport-evals run --reporter braintrust --reporter junit=reports/evals.xml
ReporterSendsEnvironment
langfuseone OTLP span per case to /api/public/otel/v1/traces, then scores to /api/public/scoresLANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URL or LANGFUSE_HOST (default https://cloud.langfuse.com)
braintrusta project and an experiment, then one row per caseBRAINTRUST_API_KEY, BRAINTRUST_API_URL (default https://api.braintrust.dev), BRAINTRUST_PROJECT (default viewport-evals)
langsmitha session, one run per case, then one feedback item per scoreLANGSMITH_API_KEY or LANGCHAIN_API_KEY, LANGSMITH_ENDPOINT (default https://api.smith.langchain.com), LANGSMITH_PROJECT (default viewport-evals)
phoenixone span per case, then span annotationsPHOENIX_API_KEY (when set), PHOENIX_BASE_URL or PHOENIX_COLLECTOR_ENDPOINT (default http://localhost:6006), PHOENIX_PROJECT_NAME (default viewport-evals)
otelone span per case through the OpenTelemetry API, viewport.evals.* attributesyour OpenTelemetry SDK setup; a no-op without one

What is exported

Every verdict except skipped ones. Per case, in order:

  1. viewport.passed: 1 when the case passed (or failed as expected), else 0, with the one-line reason as the comment.
  2. viewport.pass_rate: passes over runs.
  3. One score per assertion name, such as tools.exactly or invariants.approval before any send: the fraction of runs where it passed, commented with the first failing message.
  4. <assertion>:score next to any assertion that reported a score, such as a judge.

Case input and output come from the first run's trajectory. Ids are derived from the run id, case id and score name, never random, so re-exporting a run overwrites its scores instead of duplicating them.

Failure handling

Requests are batched (100 items), and retried on network errors, timeouts, 408, 429 and 5xx (three attempts). Each attempt has a total deadline of 30 seconds, from connecting to reading the whole response; set timeoutMs / timeout_ms on the reporter to change it. A failed export prints one line and never changes the verdicts or the exit code, so an observability outage cannot block a merge. A missing key is reported the same way. Pass --strict-export to fail the run with evals.export_failed instead.

Python and TypeScript send byte-identical requests, pinned by golden files in spec/exporters/.

On this page