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| Reporter | Sends | Environment |
|---|---|---|
langfuse | one OTLP span per case to /api/public/otel/v1/traces, then scores to /api/public/scores | LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URL or LANGFUSE_HOST (default https://cloud.langfuse.com) |
braintrust | a project and an experiment, then one row per case | BRAINTRUST_API_KEY, BRAINTRUST_API_URL (default https://api.braintrust.dev), BRAINTRUST_PROJECT (default viewport-evals) |
langsmith | a session, one run per case, then one feedback item per score | LANGSMITH_API_KEY or LANGCHAIN_API_KEY, LANGSMITH_ENDPOINT (default https://api.smith.langchain.com), LANGSMITH_PROJECT (default viewport-evals) |
phoenix | one span per case, then span annotations | PHOENIX_API_KEY (when set), PHOENIX_BASE_URL or PHOENIX_COLLECTOR_ENDPOINT (default http://localhost:6006), PHOENIX_PROJECT_NAME (default viewport-evals) |
otel | one span per case through the OpenTelemetry API, viewport.evals.* attributes | your OpenTelemetry SDK setup; a no-op without one |
What is exported
Every verdict except skipped ones. Per case, in order:
viewport.passed: 1 when the case passed (or failed as expected), else 0, with the one-line reason as the comment.viewport.pass_rate: passes over runs.- One score per assertion name, such as
tools.exactlyorinvariants.approval before any send: the fraction of runs where it passed, commented with the first failing message. <assertion>:scorenext 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/.