lume-visual-dashboard

LUME model API

Set VITE_LUME_API_BASE_URL (see .env.example; copy it to .env.local). It defaults to http://localhost:8000. The data layer is split in three:

const { data: config } = useModelConfig(model);
const { data, isPlaceholderData } = useEvaluate(model, { screen: 'OTR_B', inputs: { Q1: q } });

Live stream (server-sent events)

GET /api/v1/models/{name}/live/stream evaluates the model over and over at the machine’s current inputs and sends each result as a frame event. A frame has the same shape as an evaluate response, with input_sources set to live, or to baseline for a PV that couldn’t be read. It isn’t a TanStack Query, because the data is pushed:

const { status, frame, errorMessage, error, reconnect } = useLiveStream(model, {
  screen: 'OTR3',
  outputs: ['QUAD:IN20:525:BCTRL'],
});

status is one of these values:

status Meaning
idle Not connected: no model name, no screen or outputs, or { enabled: false }.
connecting The first connection attempt.
open Connected. Frames come as fast as the model runs. For cu_hxr_staged that’s a few seconds apart, with no fixed rate.
reconnecting The connection dropped or failed, and the hook is trying again. error holds the cause and frame keeps the last frame.
closed Stopped for good, because retrying can’t fix the error. error says why, and reconnect() tries again.

How the hook handles errors: