Skip to content

CLI: serve

Terminal window
vally serve [directory] [options]

Start an HTTP server that provides a REST API and built-in web dashboard for exploring eval results.

There are three ways to use it:

Terminal window
# Serve from a directory (in-memory, no persistence)
vally serve ./results
# Serve from an existing database (no directory needed)
vally serve --store eval-history.db
# Ingest a directory into a database and serve
vally serve ./results --store eval-history.db
ArgumentDescription
[directory]Path to eval output directory. Optional when using --store
FlagTypeDefaultDescription
--port <port>number3200Port to listen on
--host <host>string127.0.0.1Host to bind to. Use 0.0.0.0 to expose externally.
--corsbooleanfalseEnable CORS for cross-origin browser requests
--store <path>stringPersist data to a SQLite file (enables historical mode)
CodeMeaning
0Server started successfully
1Error (no runs found, bad port)

The server exposes a JSON API at /api/. Key endpoints:

EndpointDescription
GET /api/runsList all runs
GET /api/runs/:idRun detail (stimuli, models, config)
GET /api/runs/:id/outcomesOutcomes scoped to a run
GET /api/runs/:id/matrixScore matrix (any metric)
GET /api/runs/:id/rankingModel leaderboard
GET /api/runs/:id/gradersGrader failure analysis
GET /api/runs/:id/toolsPer-tool usage stats
GET /api/outcomesList/filter outcomes across runs
GET /api/outcomes/:idFull outcome with grader details
GET /api/outcomes/:id/trajectoryRaw trajectory events
GET /api/compare?runs=id1,id2Cross-run comparison
GET /api/metricsSelf-describing metric definitions

All responses use standardized error envelopes ({ error: { code, message } }) and explicit pagination ({ page: { nextCursor, limit, hasMore, total } }).

Terminal window
# Basic usage — view results from an eval run
vally serve ./vally-results/
# Custom port
vally serve ./vally-results/ --port 8080
# Persistent database — keeps history across sessions
vally serve ./vally-results/ --store eval-history.db
# Query the API with curl
curl http://127.0.0.1:3200/api/runs
curl http://127.0.0.1:3200/api/runs/<run-id>/ranking
  • Binds to 127.0.0.1 by default
  • CORS is disabled by default
  • Internal errors return a generic message (no paths or SQL fragments are exposed)