Evals

Results and the viewer

Every local run writes a results directory of plain JSON files, served read-only by viewport-evals ui and readable by any tool.

viewport-evals run writes what happened to a results directory, by default .viewport/evals/runs/ (set results_dir / resultsDir in config or VIEWPORT_EVALS_RESULTS_DIR). It is on by default locally and off under CI unless you pass --results; --no-results turns it off. In pytest the flags are --viewport-results and --no-viewport-results. Add .viewport/ to .gitignore.

Layout

.viewport/evals/runs/
  index.json                         the newest 500 runs; older pages in index-<k>.json
  <run id>/
    run.json                         evals/run/v1: id, start and end, mode, git, language, counts, status, tenant
    report.json                      evals/report/v1, the same as --reporter json
    cases/<case id>/
      verdict.json                   evals/verdict/v1
      attempt-<n>.trajectory.jsonl   the run's events, appended while it runs
      attempt-<n>.world.json         evals/world/v1: each world's before, after and changes
      attempt-<n>.invariants.json    evals/invariants/v1: each invariant's result and violations
      attempt-<n>.diff.json          evals/trajectory_diff/v1, when the case has a baseline

Run ids look like evr_<ulid>. Files are written atomically, trajectories append whole lines, and readers ignore fields they do not know. Python and TypeScript write byte-identical verdict, world, invariants and diff files for the same run. Result files point at events by their position in the attempt's trajectory. Every schema prints with viewport-evals schema <name>.

index.json is updated under a lock, so parallel runs are safe. A run directory missing from the index is invisible rather than an error; viewport-evals results reindex [dir] rebuilds the indexes from the run directories. run --tenant <id> records a run under a tenant, for shared hosts.

Serve it

uv run viewport-evals ui            # or: pnpm exec viewport-evals ui

viewport-evals ui [dir] [--port 7073] [--open] serves the results directory on http://127.0.0.1:7073/: read-only, reachable from this machine only, results under /results/ as JSON and JSONL with nosniff, never HTML or scripts from the results directory, no symlinks out and no dotfiles.

The interactive viewer (@viewportai/evals-viewer: runs, cases, a timeline of every attempt including multi-episode and simulated-time runs, world diffs, invariants, replay diffs and assertions) ships prebuilt inside both packages, so viewport-evals ui opens it with no extra install. --bundle <dir> serves a different viewer build instead. A source checkout or a package vendored from git has no bundle (it is build output), so ui serves a page listing recent runs with links to their files and prints how to get the viewer: make build-dist in the evals checkout (or cd viewer && corepack pnpm run build && node ../scripts/copy-viewer.mjs), or --bundle <dir> pointing at a built viewer/dist/app. Because the results directory is the read API, any tool can read it too: jq '.counts' .viewport/evals/runs/<run id>/run.json works as well as a viewer does.

From code, run_cases(cases, results=True) / runCases(cases, { results: true }) writes the same layout (or pass a directory), and reporters=[results_reporter(dir)] / reporters: [resultsReporter({ dir })] works too.

For hosts with their own server, @viewportai/evals/results exports the same serving rules (resultsHandler, isResultsPath, resultsContentType, containedFile) and the writer (resultsReporter, reindex); Python has viewportai.evals.results.

Next: the guides, starting with LangGraph.

On this page