Skip to main content

WebSocket Events

miLLM streams real-time events over Socket.IO mounted at the standard /socket.io path on the same port as the HTTP APIs. The Admin UI is the primary consumer, but any Socket.IO client can subscribe — useful for dashboards, experiment loggers, or progress bars in scripts.

import socketio

sio = socketio.Client()
sio.connect("http://localhost:8000")

@sio.on("monitoring:activation")
def on_activation(data):
print("features:", data["features"])

@sio.on("system:metrics")
def on_metrics(data):
print("gpu:", data)

sio.wait()

Event catalog

System

EventPayload highlightsNotes
system:metricsGPU utilization, VRAM used/total, temperaturePeriodic broadcast; also sent immediately on system:join

Model lifecycle

EventPayload highlights
model:download:progressmodel_id, percent, bytes progress
model:download:completemodel_id
model:download:errormodel_id, error
model:load:progressmodel_id, stage/percent
model:load:completemodel_id
model:load:errormodel_id, error
model:unload:completemodel_id

SAE lifecycle

EventPayload highlights
sae:download:progresssae_id, percent
sae:download:completesae_id
sae:download:errorsae_id, error
sae:attachedsae_id, layer
sae:detachedsae_id

Steering & monitoring

EventPayload highlightsNotes
steering:updateenabled, values (feature → strength), active_countEmitted on every steering change from any source
monitoring:statemonitoring configurationOn configure/toggle
monitoring:activationtimestamp, request_id, features (top-k [index, activation] pairs), positionThrottled (~10/sec max); one per recorded generation
sensing:eventOne persisted cluster co-activation event: id, profile_id, phase, span, fired_members, score, summarycontext text is never sent over WS (fetch /api/sensing/events/{id})Throttled (max 5 per request flush, min 100 ms between flushes); the DB is complete regardless
circuit:sensing:eventOne persisted circuit edge firing (Feature 15): id, circuit_id, request_id, phase, edge_key, token_lag, edge_rung, summarycontext text is never sent over WS (fetch /api/circuit-sensing/events/{id})Same throttle discipline; the payload is built with include_context=False, so no decoded prompt text leaves the box

Patterns

Experiment logging — subscribe to monitoring:activation and steering:update and append both to your run log; you get a timeline of what the steering was and what fired without polling.

Progress bars — the *:download:progress events carry percentages; downloads can be driven headlessly via the Models/SAEs APIs with progress rendered from these events.

Reconnection — all events are fire-and-forget state deltas. After a reconnect, resync authoritative state from the REST endpoints (/api/saes/attachment, /api/saes/steering, /api/monitoring) rather than assuming you saw every event.