Module events

Module events 

Source
Expand description

2026-09-26: The /v1/events stream: one JSON object per SSE data: line (JSONL); the server sends one per device-sample period.

Schema (version EVENT_SCHEMA_VERSION); every key is always present, and a quantity the device does not report is null, never 0:

{ "v": 1, "seq": <u64, per-stream>, "kind": "snapshot",
  "level": "off"|"basic"|"kernel", "at_ns": <telemetry clock>,
  "device_state": "not_started"|"available"|"unavailable",
  "device": null | { "power_mw", "energy_counter_mj", "graphics_clock_mhz",
      "sm_clock_mhz", "mem_clock_mhz", "temperature_c",
      "clocks_event_reasons", "mem_used_bytes", "mem_total_bytes",
      "pcie_tx_kbps", "pcie_rx_kbps", "nvlink_active_links",
      "samples", "age_ns", "read_errors" },
  "energy": { "gpu_mj_total", "gpu_counter_mj", "tokens_total",
      "joules_per_token_live", "joules_per_token_cumulative",
      "counter_resets", "counter_wraps" },
  "sched": { "pending", "active", "prefilling", "swapped",
      "kv_blocks_free", "kv_blocks_total", "ssm_slots_used",
      "ssm_slots_total", "ticks", "stream_syncs", "blocking_d2h",
      "graph_replays", "graph_captures" },
  "spec": [ { "drafts", "steps", "acceptance_by_depth": [f64] } ],
  "requests": { "finished", "ttft_mean_ms", "tpot_mean_ms", "e2e_mean_ms",
      "energy_mean_j", "energy_unattributed" } }

Owner: telemetry. Invariants: an event line holds no newline.

Constants§

EVENT_SCHEMA_VERSION

Functions§

snapshot_line
2026-09-26: One event line, with no trailing newline (SSE framing adds it).