Training health and alerts

Training health and alerts

The thirty checks Kaimei runs on every training run, the findings they make, and the rules and channels that send them to you.

Kaimei checks every run as its batches arrive, and again when it finishes. A check that sees something makes a finding: what it saw, between which steps, the numbers behind it, and advice. A finding stays open until you acknowledge, resolve or mute it, or the check sees it end. The client runs five of the checks itself (non_finite, divergence, loss_spike, exploding_gradients, loss_scale_collapse), so a stop policy works offline; its findings have source: "client". Your own alerts, run.alert(title, text), are findings of the check custom.

Alert rules send findings to notification channels (email, a webhook or Slack). API keys need the runs scope for findings, the alerts scope for rules and channels, and the projects scope for a project's training settings.

#The health checks

Each check fires at its usual severity; a project's settings make it more or less sensitive. metric_alert findings come from alert rules that watch a metric, and custom from run.alert(). prediction_collapse, forgetting, overconfidence and mislabeled_examples also read the run's probe evaluations (the latest 30 of each set); those findings have the layer probe set <name>.

CheckSeverityFires when
non_finitecriticalA loss, a metric or the gradient norm is NaN or infinite.
divergencecriticalThe smoothed training loss is far above its lowest and still rising.
loss_spikemediumA point far outside the spread of the points before it; high when the loss does not come back down.
overfittinghighValidation loss is rising while training loss falls.
generalization_gapmediumThe gap between validation and training loss widens evaluation after evaluation.
not_learninghighThe loss has hardly moved, or a metric sits at chance.
plateaulowThe loss stopped improving for several evaluations.
oscillationmediumThe loss zigzags from step to step.
lr_too_lowlowThe updates are tiny next to the weights: the learning rate looks too low.
exploding_gradientshighThe gradient norm is far above its usual level.
vanishing_gradientsmediumGradients vanish in the early layers.
clipping_saturatedmediumGradient clipping is active on most steps.
update_ratio_bandmediumA layer's update ratio (the step's size over the weights') is far outside the usual band.
frozen_parametersmediumSome parameters are not training.
dead_unitsmediumUnits that output zero for nearly every input.
saturated_activationsmediumtanh or sigmoid units stuck at their limits.
weight_norm_runawaylowA layer's weights keep growing.
attention_collapsemediumAttention heads that look at one position only.
prediction_collapsehighThe model gives nearly every input the same answer.
overconfidencelowThe model is growing overconfident: validation loss, or the true class's loss on a probe set, rises while accuracy holds.
possible_leakagemediumValidation loss far below training loss, or validation scores near perfect.
mislabeled_exampleslowProbe examples never learned, with another class given a high probability.
forgettingmediumProbe examples are learned and then forgotten.
loss_scale_collapsehighMixed precision's loss scale is at its floor, or many steps are skipped for overflow.
dataloader_bottlenecklowTraining waits for data.
memory_pressuremediumGPU memory is nearly full.
throughput_droplowTraining slowed down, or one rank is a straggler.
edge_of_stabilityinfoSharpness has reached 2 / learning rate. Often normal: it explains an oscillation.
stalled_runhighThe run stopped reporting, or reports without making progress.
best_stopinfoThe best validation result is behind the run, at the step it names.

#The finding object

evidence holds the series and numbers the check read; the dashboard draws them.

Attributes

idstring
fnd_ identifier.
run_idstring

detectorstring

The check: one of the thirty, custom or metric_alert.

severitystring
critical, high, medium, low or info.
statestring
open, acknowledged, resolved or muted.
layerstring | null

The layer it is about, for per-layer checks; for metric_alert, the condition, such as val/loss > 1.

step_lo / step_hiinteger

The steps it covers.

title / summary / advicestring

What was seen, in a sentence and a paragraph, and what to try.

evidenceobject

The series and values behind it.

sourcestring
server or client.
notestring | null

Yours, up to 4,000 characters.

created_at / updated_at / resolved_attimestamp

Example
{
  "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
}

#List a run's findings

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

Open findings first, then by severity, newest first.

Path parameters

run_idstringrequired

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

Query parameters

statestringoptional

Comma separated: open, acknowledged, resolved or muted.

severitystringoptional

Comma separated: critical, high, medium, low or info.

limitintegeroptionaldefault 100

1 to 1,000.

offsetintegeroptionaldefault 0

Findings to skip.

Returns

A page of findings.
for finding in client.runs.findings("run_3f2a19c0d1e2f3a4b5c6", state="open").data:
    print(finding.severity, finding.title)
curl https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/findings?state=open \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "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
    }
  ],
  "total": 1,
  "limit": 100,
  "offset": 0,
  "has_more": false,
  "next_cursor": null
}

#Update a finding

PATCH/v1/runs/{run_id}/findings/{finding_id}API key or session

Acknowledge, resolve, mute or annotate a finding. Muting it mutes its check (and layer) for the run; setting it open again undoes that. When one check is muted in three runs of a project, its sensitivity there drops a level.

Path parameters

run_idstringrequired

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

finding_idstringrequired
fnd_ identifier.

Body parameters

statestringoptional
open, acknowledged, resolved or muted.
notestringoptional

Up to 4,000 characters, kept on the finding.

Returns

The finding.
curl -X PATCH https://api.kaimei.ai/v1/runs/run_3f2a19c0d1e2f3a4b5c6/findings/fnd_8057422bb9588d65c631 \
  -H "Authorization: Bearer $KAIMEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state": "acknowledged", "note": "Known: the holdout set is small."}'
200 OKResponse
{
  "object": "finding",
  "id": "fnd_8057422bb9588d65c631",
  "run_id": "run_3f2a19c0d1e2f3a4b5c6",
  "detector": "custom",
  "severity": "high",
  "state": "acknowledged",
  "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": "Known: the holdout set is small.",
  "created_at": "2026-12-05T12:01:00.249239+00:00",
  "updated_at": "2026-12-05T12:01:00.547797+00:00",
  "resolved_at": null
}

#List findings across runs

GET/v1/run-findingsAPI key or session

Findings of every run in the workspace, newest first, each with its run's id, name and status.

Query parameters

projectstringoptional

A project's slug, id or name.

modelstringoptional

A model's slug or id.

runstringoptional

A run's id.

statestringoptional

Comma separated: open, acknowledged, resolved or muted.

severitystringoptional

Comma separated.

detectorstringoptional

Comma-separated checks.

limitintegeroptionaldefault 50

1 to 200.

offsetintegeroptionaldefault 0

Findings to skip.

cursorstringoptional

The next_cursor of the page before: pages without offsets.

Returns

A page of findings, each with run.
curl https://api.kaimei.ai/v1/run-findings?state=acknowledged \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "object": "finding",
      "id": "fnd_8057422bb9588d65c631",
      "run_id": "run_3f2a19c0d1e2f3a4b5c6",
      "detector": "custom",
      "severity": "high",
      "state": "acknowledged",
      "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": "Known: the holdout set is small.",
      "created_at": "2026-12-05T12:01:00.249239+00:00",
      "updated_at": "2026-12-05T12:01:00.547797+00:00",
      "resolved_at": null,
      "run": {
        "id": "run_3f2a19c0d1e2f3a4b5c6",
        "name": "bright-falcon-12",
        "status": "running"
      }
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0,
  "has_more": false,
  "next_cursor": null
}

#Read a project's training settings

GET/v1/projects/{project}/training-settingsAPI key or session

How sensitive the checks are for the project's runs, and the mutes that lower them.

Path parameters

projectstringrequired

Project slug, id or name.

Returns

project, sensitivity (low, normal or high), detectors (the checks set apart from it), mutes (by check, the runs that muted it), mutes_to_lower and updated_at.
curl https://api.kaimei.ai/v1/projects/credit-risk/training-settings \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "training_settings",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "sensitivity": "normal",
  "detectors": {},
  "mutes": {},
  "mutes_to_lower": 3,
  "updated_at": null
}

#Set a project's training settings

PUT/v1/projects/{project}/training-settingsAPI key or session

Change how sensitive the checks are. Only the fields sent change. Low sensitivity fires least.

Path parameters

projectstringrequired

Project slug, id or name.

Body parameters

sensitivitystringoptional
low, normal or high, for every check.
detectorsobjectoptional

By check, a level of its own, or null to follow the project's again. An unknown check is 400 invalid_detector.

Returns

The settings.
curl -X PUT https://api.kaimei.ai/v1/projects/credit-risk/training-settings \
  -H "Authorization: Bearer $KAIMEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sensitivity": "high", "detectors": {"plateau": "low"}}'
200 OKResponse
{
  "object": "training_settings",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "sensitivity": "high",
  "detectors": {"plateau": "low"},
  "mutes": {},
  "mutes_to_lower": 3,
  "updated_at": "2026-12-05T12:01:00.569052+00:00"
}

#The alert rule object

A rule sends the findings it matches to its channels: findings of its detectors at min_severity or above, and, with a metric, a metric_alert finding when that condition holds on a run.

Attributes

idstring
alr_ identifier.
namestring

projectobject | null

The project whose runs it covers, or null for every run of the workspace.

detectorsarray of strings

Checks, custom, or * for all of them, custom included.

min_severitystring
critical, high, medium, low or info.
metricobject | null
{key, op, value}, op one of >, >=, <, <=, ==, !=: checked on each run's latest value of the series. Its finding resolves when the condition stops holding.
channelsarray of strings
nch_ ids.
cooldown_minutesinteger

At most one message per check per run in this many minutes.

enabledboolean

stop_runboolean

A matching finding also asks the run to stop, once (an auto_stop event and an audit entry).

created_at / updated_attimestamp

When messages go. A finding is sent when it is new, opens again, or its severity rises. Low and info findings sent by email or to Slack wait for a daily digest, one message a destination once the oldest has waited a day; webhooks get every finding as it comes. With no rule covering a run, critical and high findings are emailed to the person who started it (to the workspace's owners for a workspace key), at most once per check per run in 30 minutes. Failed sends are retried.

Example
{
  "object": "alert_rule",
  "id": "alr_e918366ec59f763cb3de",
  "name": "Divergence and NaNs",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "detectors": ["non_finite", "divergence"],
  "min_severity": "high",
  "metric": null,
  "channels": ["nch_ea0cb649a8acf51ee7cd"],
  "cooldown_minutes": 30,
  "enabled": true,
  "stop_run": true,
  "created_at": "2026-12-05T12:01:00.602590+00:00",
  "updated_at": "2026-12-05T12:01:00.602590+00:00"
}

#List alert rules

GET/v1/alert-rulesAPI key or session

Every rule of the workspace.

Returns

A list of alert rules.
curl https://api.kaimei.ai/v1/alert-rules \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "object": "alert_rule",
      "id": "alr_e918366ec59f763cb3de",
      "name": "Divergence and NaNs",
      "project": {
        "id": "prj_d28a961cfec4c14af1e9",
        "slug": "credit-risk",
        "name": "credit-risk"
      },
      "detectors": ["non_finite", "divergence"],
      "min_severity": "high",
      "metric": null,
      "channels": ["nch_ea0cb649a8acf51ee7cd"],
      "cooldown_minutes": 30,
      "enabled": true,
      "stop_run": true,
      "created_at": "2026-12-05T12:01:00.602590+00:00",
      "updated_at": "2026-12-05T12:01:00.602590+00:00"
    }
  ],
  "has_more": false
}

#Create an alert rule

POST/v1/alert-rulesAPI key or session

Send matching findings to channels, and optionally stop the run. A rule watches findings, a metric, or both (400 invalid_rule otherwise).

Body parameters

namestringrequired

1 to 120 characters.

projectstringoptional

A project's slug, id or name. Left out: every run of the workspace.

detectorsarray of stringsoptional

Checks, custom or *. Left out: ["*"], or none when the rule watches a metric. An unknown check is 400 invalid_detector.

min_severitystringoptionaldefault "high"
critical, high, medium, low or info.
metricobjectoptional
{key, op, value}, value a finite number (400 invalid_metric otherwise).
channelsarray of stringsoptional

Channel ids of this workspace (404 channel_not_found otherwise).

cooldown_minutesintegeroptionaldefault 30

0 to 10,080.

enabledbooleanoptionaldefault true

stop_runbooleanoptionaldefault false

Also ask a run with a matching finding to stop.

Returns

The alert rule. 201.
curl -X POST https://api.kaimei.ai/v1/alert-rules \
  -H "Authorization: Bearer $KAIMEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Divergence and NaNs", "project": "credit-risk", "detectors": ["non_finite", "divergence"],
       "channels": ["nch_ea0cb649a8acf51ee7cd"], "stop_run": true}'
201 CreatedResponse
{
  "object": "alert_rule",
  "id": "alr_e918366ec59f763cb3de",
  "name": "Divergence and NaNs",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "detectors": ["non_finite", "divergence"],
  "min_severity": "high",
  "metric": null,
  "channels": ["nch_ea0cb649a8acf51ee7cd"],
  "cooldown_minutes": 30,
  "enabled": true,
  "stop_run": true,
  "created_at": "2026-12-05T12:01:00.602590+00:00",
  "updated_at": "2026-12-05T12:01:00.602590+00:00"
}
201 CreatedWith a metric
{
  "object": "alert_rule",
  "id": "alr_a10a255a2a22da38b4d1",
  "name": "val/loss above 1",
  "project": null,
  "detectors": [],
  "min_severity": "high",
  "metric": {"key": "val/loss", "op": ">", "value": 1.0},
  "channels": ["nch_ea0cb649a8acf51ee7cd"],
  "cooldown_minutes": 30,
  "enabled": true,
  "stop_run": false,
  "created_at": "2026-12-05T12:01:00.636964+00:00",
  "updated_at": "2026-12-05T12:01:00.636964+00:00"
}

#Retrieve an alert rule

GET/v1/alert-rules/{rule_id}API key or session

One rule (404 alert_rule_not_found otherwise).

Path parameters

rule_idstringrequired
alr_ identifier.

Returns

The alert rule.
curl https://api.kaimei.ai/v1/alert-rules/alr_e918366ec59f763cb3de \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "alert_rule",
  "id": "alr_e918366ec59f763cb3de",
  "name": "Divergence and NaNs",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "detectors": ["non_finite", "divergence"],
  "min_severity": "high",
  "metric": null,
  "channels": ["nch_ea0cb649a8acf51ee7cd"],
  "cooldown_minutes": 30,
  "enabled": true,
  "stop_run": true,
  "created_at": "2026-12-05T12:01:00.602590+00:00",
  "updated_at": "2026-12-05T12:01:00.602590+00:00"
}

#Update an alert rule

PATCH/v1/alert-rules/{rule_id}API key or session

Only the fields sent change. project and metric take null to clear them.

Path parameters

rule_idstringrequired
alr_ identifier.

Body parameters

name / project / detectors / min_severity / metric / channels / cooldown_minutes / enabled / stop_runoptional

As when creating a rule.

Returns

The alert rule.
curl -X PATCH https://api.kaimei.ai/v1/alert-rules/alr_e918366ec59f763cb3de \
  -H "Authorization: Bearer $KAIMEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cooldown_minutes": 60}'
200 OKResponse
{
  "object": "alert_rule",
  "id": "alr_e918366ec59f763cb3de",
  "name": "Divergence and NaNs",
  "project": {
    "id": "prj_d28a961cfec4c14af1e9",
    "slug": "credit-risk",
    "name": "credit-risk"
  },
  "detectors": ["non_finite", "divergence"],
  "min_severity": "high",
  "metric": null,
  "channels": ["nch_ea0cb649a8acf51ee7cd"],
  "cooldown_minutes": 60,
  "enabled": true,
  "stop_run": true,
  "created_at": "2026-12-05T12:01:00.602590+00:00",
  "updated_at": "2026-12-05T12:01:00.627959+00:00"
}

#Delete an alert rule

DELETE/v1/alert-rules/{rule_id}API key or session

Stop sending what the rule matched.

Path parameters

rule_idstringrequired
alr_ identifier.

Returns

A deletion receipt.
curl -X DELETE https://api.kaimei.ai/v1/alert-rules/alr_a10a255a2a22da38b4d1 \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "id": "alr_a10a255a2a22da38b4d1",
  "object": "alert_rule",
  "deleted": true
}

#The notification channel object

Where alert rules send findings. The target is stored sealed and shown masked.

Attributes

idstring
nch_ identifier.
kindstring
email, webhook or slack.
namestring

targetstring

The address or URL, masked.

verified_attimestamp | null

When a test message last got through.

created_attimestamp

secretstring

A webhook's signing secret, whsec_…, in the response that creates it and never again.

Webhooks. Kaimei POSTs {"type": "finding", "finding": {…}, "run": {"id", "name", "url"}, "workspace": {"slug"}} with X-Kaimei-Signature: t=<unix time>,v1=<hex>, the HMAC-SHA256 of <t>.<body> under the secret. Check it, and that t is recent, before trusting the body. Slack channels get a message with blocks. Private, loopback and cloud metadata addresses are refused when sending.

Example
{
  "object": "notification_channel",
  "id": "nch_ea0cb649a8acf51ee7cd",
  "kind": "email",
  "name": "Ada",
  "target": "a•••@example.com",
  "verified_at": null,
  "created_at": "2026-12-05T12:01:00.575644+00:00"
}

#List notification channels

GET/v1/notification-channelsAPI key or session

Every channel of the workspace, targets masked.

Returns

A list of channels.
curl https://api.kaimei.ai/v1/notification-channels \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "object": "notification_channel",
      "id": "nch_ea0cb649a8acf51ee7cd",
      "kind": "email",
      "name": "Ada",
      "target": "a•••@example.com",
      "verified_at": null,
      "created_at": "2026-12-05T12:01:00.575644+00:00"
    }
  ],
  "has_more": false
}

#Create a notification channel

POST/v1/notification-channelsAPI key or session

An email address, a webhook or a Slack incoming webhook. An email target must be the address of a member of the workspace (400 email_not_member); webhook and Slack targets are public https URLs (400 invalid_target). The plan sets how many channels a workspace has (403 quota_exceeded, param: notification_channels).

Body parameters

kindstringrequired
email, webhook or slack.
targetstringrequired

The address or URL.

namestringoptional

Up to 120 characters. Left out: made from the target.

Returns

The channel, with secret for a webhook. 201.
curl -X POST https://api.kaimei.ai/v1/notification-channels \
  -H "Authorization: Bearer $KAIMEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "webhook", "name": "Training alerts", "target": "https://hooks.example.com/kaimei"}'
201 CreatedResponse
{
  "object": "notification_channel",
  "id": "nch_5c1f7e09d2a84b3e6f10",
  "kind": "webhook",
  "name": "Training alerts",
  "target": "https://hooks.example.com/•••",
  "verified_at": null,
  "created_at": "2026-12-05T12:01:00.575644+00:00",
  "secret": "whsec_EXAMPLEnotARealSecret0000000000000000000000"
}

#Retrieve a notification channel

GET/v1/notification-channels/{channel_id}API key or session

One channel (404 channel_not_found otherwise).

Path parameters

channel_idstringrequired
nch_ identifier.

Returns

The channel.
curl https://api.kaimei.ai/v1/notification-channels/nch_ea0cb649a8acf51ee7cd \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "object": "notification_channel",
  "id": "nch_ea0cb649a8acf51ee7cd",
  "kind": "email",
  "name": "Ada",
  "target": "a•••@example.com",
  "verified_at": null,
  "created_at": "2026-12-05T12:01:00.575644+00:00"
}

#Delete a notification channel

DELETE/v1/notification-channels/{channel_id}API key or session

Delete the channel. Rules that sent to it stop sending there.

Path parameters

channel_idstringrequired
nch_ identifier.

Returns

A deletion receipt.
curl -X DELETE https://api.kaimei.ai/v1/notification-channels/nch_ea0cb649a8acf51ee7cd \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "id": "nch_ea0cb649a8acf51ee7cd",
  "object": "notification_channel",
  "deleted": true
}

#Test a notification channel

POST/v1/notification-channels/{channel_id}/testAPI key or session

Send a test message now. A webhook gets {"type": "test", "channel": {"id", "name"}, "workspace": {"slug"}}, signed like every webhook, and has 12 seconds to answer; Slack a short text; email a short message. A channel that answers is marked verified.

A workspace tests two channels at a time, and 30 an hour on the Free plan (90 on Standard, 300 on Team, 900 on Enterprise); past either, 429 rate_limited with Retry-After.

Path parameters

channel_idstringrequired
nch_ identifier.

Returns

ok, the HTTP status the target answered (null for email) and error.
curl -X POST https://api.kaimei.ai/v1/notification-channels/nch_ea0cb649a8acf51ee7cd/test \
  -H "Authorization: Bearer $KAIMEI_API_KEY"
200 OKResponse
{
  "ok": true,
  "status": null,
  "error": null
}