Run series and live updates

Run series and live updates

Read what a run recorded: its series, points or their envelopes, layers, distributions, events and console, and follow it live.

What the dashboard draws a run from. A series is one key of a run (train/loss, layers/grad_norm, dist/grad/fc1.weight) of kind scalar, matrix (layers by steps) or distribution (9 quantiles and a 64-bin histogram per step).

Keys follow conventions the health checks and the dashboard read: train/ and val/ (also valid/, validation/, eval/) metrics, opt/lr, opt/grad_norm and the rest of the optimizer's, perf/ throughput, system/ hardware load, axis/epoch, layers/<measure> and dist/<grad|weight|update|act>/<tensor> inside the network, landscape/ for the loss landscape, and train/example_loss for each example's loss of a step's batch (detail="max"). Keys holding loss, error or perplexity are better low, keys holding acc, auc, f1, precision, recall or reward better high, unless the client defines otherwise.

#List a run's series

GET/v1/runs/{run_id}/seriesAPI key or session

Each series of the run with its statistics. A matrix series adds its layers.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

prefixstringoptional

Only keys that start with this, such as val/.

kindstringoptional
scalar, matrix or distribution.

Returns

A list of series: key, kind, goal, unit, count, first_step, last_step, min, max, last, best, best_step, updated_at.
for series in client.runs.series("run_3f2a19c0d1e2f3a4b5c6", prefix="val/").data:
    print(series.key, series.best, series.best_step)
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/series?prefix=val/ \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "key": "val/loss",
      "kind": "scalar",
      "goal": "min",
      "unit": null,
      "count": 3,
      "first_step": 400,
      "last_step": 1200,
      "min": 0.71,
      "max": 0.98,
      "last": 0.74,
      "best": 0.71,
      "best_step": 800,
      "updated_at": "2026-12-05T12:01:00.249239+00:00"
    }
  ]
}

#Read points

GET/v1/runs/{run_id}/series/pointsAPI key or session

Scalar series over a range of steps, ready to draw. A series with at most points points in the range comes raw; a longer one as an envelope of at most points buckets, each with the min, max, mean, first and last of its points, their count, and how many were not finite.

Buckets are aligned blocks of a power of two steps, so they don't shift as a live run grows. step_lo and step_hi are the steps of a bucket's first and last point (not the block's edges), and time_lo and time_hi their times, for a wall-clock axis. Min, max and mean leave out values that are not finite. The answer is what working it out from every point would give.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

keysstringrequired

Up to 100 comma-separated series keys.

fromintegeroptional

The first step to include. Left out: the run's first.

tointegeroptional

The last step to include. Left out: the run's last.

pointsintegeroptionaldefault 1500

1 to 5,000: the most points or buckets a series comes back with.

Returns

run_id, from, to, points, missing (keys the run doesn't have) and series.
points = client.runs.points("run_3f2a19c0d1e2f3a4b5c6", ["train/loss", "val/loss"], points=800)
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/series/points?keys=train/loss,val/loss&points=4 \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "run_id": "run_3f2a19c0d1e2f3a4b5c6",
  "from": 100,
  "to": 1200,
  "points": 4,
  "missing": [],
  "series": [
    {
      "key": "train/loss",
      "kind": "scalar",
      "mode": "envelope",
      "step_lo": [100, 600, 1100],
      "step_hi": [500, 1000, 1200],
      "time_lo": [1796472005000, 1796472030000, 1796472055000],
      "time_hi": [1796472025000, 1796472050000, 1796472060000],
      "min": [0.81, 0.55, 0.52],
      "max": [2.31, 0.72, 0.53],
      "mean": [1.372, 0.624, 0.525],
      "first": [2.31, 0.72, 0.53],
      "last": [0.81, 0.55, 0.52],
      "count": [5, 5, 2],
      "nonfinite": [0, 0, 0]
    },
    {
      "key": "val/loss",
      "kind": "scalar",
      "mode": "raw",
      "step": [400, 800, 1200],
      "time": [1796472020000, 1796472040000, 1796472060000],
      "value": [0.98, 0.71, 0.74]
    }
  ]
}

#Compare runs

GET/v1/runs/compare/pointsAPI key or session

One or more series of up to 100 runs, on one step axis, each run's as GET …/series/points answers.

Query parameters

runsstringrequired

Comma-separated run ids, at most 100.

keysstringoptionaldefault "train/loss"

Comma-separated series keys.

fromintegeroptional

The first step to include. Left out: the run's first.

tointegeroptional

The last step to include. Left out: the run's last.

pointsintegeroptionaldefault 800

1 to 5,000, per series.

Returns

runs: each run's run_id, name, status and series; missing_runs: ids not found in the workspace.
client.runs.compare(["run_3f2a19c0d1e2f3a4b5c6", "run_9a0c2e4f6b8d1a3c5e7f"], "val/loss")
curl https://api.kaimei.ai/v1/runs/compare/points?runs=run_3f2a19c0d1e2f3a4b5c6,run_9a0c2e4f6b8d1a3c5e7f&keys=val/loss \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "runs": [
    {
      "run_id": "run_3f2a19c0d1e2f3a4b5c6",
      "name": "bright-falcon-12",
      "status": "running",
      "from": 400,
      "to": 1200,
      "missing": [],
      "series": [
        {
          "key": "val/loss",
          "kind": "scalar",
          "mode": "raw",
          "step": [400, 800, 1200],
          "time": [1796472020000, 1796472040000, 1796472060000],
          "value": [0.98, 0.71, 0.74]
        }
      ]
    }
  ],
  "missing_runs": []
}

#Read values at a step

GET/v1/runs/{run_id}/atAPI key or session

Each scalar series' last point at or before a step: the values under the dashboard's cursor.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

stepintegerrequired

The step.

Returns

step and values: by key, the step, time and value of that point.
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/at?step=800 \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "step": 800,
  "values": {
    "opt/lr": {
      "step": 100,
      "time": 1796472005000,
      "value": 0.001
    },
    "train/loss": {
      "step": 800,
      "time": 1796472040000,
      "value": 0.61
    },
    "val/loss": {
      "step": 800,
      "time": 1796472040000,
      "value": 0.71
    }
  }
}

#Read a layers matrix

GET/v1/runs/{run_id}/layersAPI key or session

A per-layer measure, such as layers/grad_norm, as captures by layers: one row a capture, one column a parameter (or a module, for activations; <module>/head<h> for attention). More captures than rows are combined by agg.

A null cell is a layer not captured at that step (it joined the matrix later, or the capture skipped it); a measured value that isn't finite is a string such as "NaN".

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

keystringrequired

A matrix series.

fromintegeroptional

The first step to include. Left out: the run's first.

tointegeroptional

The last step to include. Left out: the run's last.

rowsintegeroptionaldefault 400

1 to 5,000.

aggstringoptionaldefault "mean"
mean, max or last.

Returns

key, measure, layers, step, time, values (rows of one value a layer) and aggregated.
matrix = client.runs.layers("run_3f2a19c0d1e2f3a4b5c6", "layers/update_ratio", rows=200, agg="max")
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/layers?key=layers/grad_norm \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "key": "layers/grad_norm",
  "measure": "grad_norm",
  "layers": ["encoder.0.weight", "head.weight"],
  "step": [500, 1000],
  "time": [1796472025000, 1796472050000],
  "values": [[0.12, 0.03], [0.08, 0.02]],
  "aggregated": false
}

#Read a distribution

GET/v1/runs/{run_id}/distributionsAPI key or session

A tensor's values over training: 9 quantiles a capture (at 0, 1, 5, 25, 50, 75, 95, 99 and 100%), and the 64-bin histograms taken with them (every tenth capture at detail="full").

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

keystringrequired

A distribution series, such as dist/grad/fc1.weight.

fromintegeroptional

The first step to include. Left out: the run's first.

tointegeroptional

The last step to include. Left out: the run's last.

pointsintegeroptionaldefault 300

1 to 5,000: the most rows.

Returns

key, q (the levels), step, time, quantiles, hist_step and hist ({edges, counts}).
client.runs.distributions("run_3f2a19c0d1e2f3a4b5c6", "dist/grad/head.weight")
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/distributions?key=dist/grad/head.weight \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "key": "dist/grad/head.weight",
  "q": [0.0, 0.01, 0.05, 0.25, 0.5, 0.75, 0.95, 0.99, 1.0],
  "step": [1000],
  "time": [1796472050000],
  "quantiles": [
    [-0.1, -0.05, -0.02, -0.01, 0.0, 0.01, 0.02, 0.05, 0.1]
  ],
  "hist_step": [],
  "hist": []
}

#List events

GET/v1/runs/{run_id}/eventsAPI key or session

The run's timeline: epochs, evaluations, checkpoints, learning-rate changes, resumes, exceptions, notes, stops, the overhead governor's steps, syncs and custom events, by step.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

kindstringoptional

Comma-separated kinds.

fromintegeroptional

The first step to include. Left out: the run's first.

tointegeroptional

The last step to include. Left out: the run's last.

limitintegeroptionaldefault 1000

1 to 10,000.

Returns

A list of events (id, step, time, kind, payload, rank) and has_more.
client.runs.events("run_3f2a19c0d1e2f3a4b5c6", kind="checkpoint,exception")
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/events?kind=epoch \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "id": "rev_f0c1c36705d2e6c96891",
      "step": 400,
      "time": 1796472020000,
      "kind": "epoch",
      "payload": {"epoch": 1},
      "rank": 0
    }
  ],
  "has_more": false
}

#Read console output

GET/v1/runs/{run_id}/logsAPI key or session

Lines the training process printed, in order. The client scrubs common token formats before they leave the machine.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

qstringoptional

Lines holding this text, in any case.

streamstringoptional
stdout or stderr.
from_step / to_stepintegeroptional

A range of steps.

limitintegeroptionaldefault 500

1 to 5,000.

cursorstringoptional

The next_cursor of the page before.

Returns

A list of lines (t, step, stream, rank, text), has_more and next_cursor.
client.runs.logs("run_3f2a19c0d1e2f3a4b5c6", q="error", stream="stderr")
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/logs?q=epoch \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "t": 1796472020000,
      "step": 400,
      "stream": "stdout",
      "rank": 0,
      "text": "epoch 1 done: val/loss 0.98"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

#Read what changed

GET/v1/runs/{run_id}/updatesAPI key or session

What changed since a cursor: the run, the series whose statistics moved, new events, and findings made or changed. Nothing changed is 304 Not Modified with no body, so polling a quiet run costs almost nothing. Without since, everything.

An update holds the newest of each: at most 10,000 series, 500 events and 200 findings (within about 4 MB, 1 MB and 1 MB), with truncated: true when it left older ones out. The series, events and findings lists have them all.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Query parameters

sincestringoptional

A cursor the API gave, from the run or an earlier update.

Returns

cursor, run (without config, environment and module tree), series, events, findings and truncated; or 304.
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/updates?since=v1 \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "cursor": "v2",
  "run": {
    "object": "run",
    "id": "run_3f2a19c0d1e2f3a4b5c6",
    "name": "bright-falcon-12",
    "status": "running",
    "steps": 1200,
    "points": 22,
    "live": true,
    "cursor": "v2",
    …: …
  },
  "series": [
    {
      "key": "train/loss",
      "kind": "scalar",
      "goal": "min",
      "unit": null,
      "count": 12,
      "first_step": 100,
      "last_step": 1200,
      "min": 0.52,
      "max": 2.31,
      "last": 0.52,
      "best": 0.52,
      "best_step": 1200,
      "updated_at": "2026-12-05T12:01:00.249239+00:00"
    },
    {
      "key": "val/loss",
      "kind": "scalar",
      "goal": "min",
      "unit": null,
      "count": 3,
      "first_step": 400,
      "last_step": 1200,
      "min": 0.71,
      "max": 0.98,
      "last": 0.74,
      "best": 0.71,
      "best_step": 800,
      "updated_at": "2026-12-05T12:01:00.249239+00:00"
    },
    …
  ],
  "events": [
    {
      "id": "rev_f0c1c36705d2e6c96891",
      "step": 400,
      "time": 1796472020000,
      "kind": "epoch",
      "payload": {"epoch": 1},
      "rank": 0
    }
  ],
  "findings": [
    {
      "object": "finding",
      "id": "fnd_8057422bb9588d65c631",
      "run_id": "run_3f2a19c0d1e2f3a4b5c6",
      "detector": "custom",
      "severity": "high",
      "state": "open",
      "layer": null,
      "step_lo": 1200,
      "step_hi": 1200,
      "title": "Validation AUC below 0.7",
      "summary": "val/auc is 0.66 at step 1200.",
      "evidence": {},
      "advice": null,
      "source": "client",
      "note": null,
      "created_at": "2026-12-05T12:01:00.249239+00:00",
      "updated_at": "2026-12-05T12:01:00.249239+00:00",
      "resolved_at": null
    }
  ],
  "truncated": false
}

#Stream updates

GET/v1/runs/{run_id}/streamAPI key or session

Server-sent events: : connected first, then an update event with the body of GET …/updates whenever the run changes, at most two a second, and a : ping comment after 15 quiet seconds. A deleted event says the run is gone. The stream closes after 10 minutes; reconnect with Last-Event-ID (each update's id is the run's cursor) to carry on where it stopped.

The first update holds what GET …/updates would, within the same limits. At most 10 streams of a run and 50 of a workspace are open at once on each API server; past either, 429 rate_limited, and the dashboard reads /updates every few seconds instead.

The dashboard reads it with fetch and an Authorization header, since the browser's EventSource can't send one.

Path parameters

run_idstringrequired

The run's id: run_ and 8 to 64 lowercase letters or digits.

Headers

Last-Event-IDstringoptional

The id of the last event received.

Returns

text/event-stream.
curl -N https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/stream \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
: connected

id: v3
event: update
data: {"cursor": "v3", "run": {…}, "series": […], "events": [], "findings": []}

: ping