Skip to content

VLM Online Node ​

Overview ​

The VLM Online node (vlm-online-inferencer, VLM online in the palette) finds objects in an image with a vision-language model: you describe what to look for in words, instead of training a model for it. It returns a box and a confidence for each object found.

The model runs in the cloud, through the Rosepetal orchestrator of the project: there is no GPU and no container on the device. The node sends the image to the platform, which calls the model provider and charges the call to the project's token allowance. The environment is chosen from the project of the firebase-config node, so there is no address to configure.

A call takes seconds and costs tokens, so the node is meant for inspecting a frame when something happens, not for every frame of a fast line.

Key Features ​

  • Open vocabulary: a prompt such as "every screw head", or a closed list of tags with a description each
  • Same detections as the other inference nodes: relative coordinates (0 to 1) in every box format, so rp-add-bbs or rp-cropBB can take them unchanged
  • No local resources: no GPU, no Docker image, nothing kept open between messages
  • Model catalog of the platform in the editor
  • Debug image with the boxes drawn on the frame that was sent

Configuration ​

PropertyDefaultMeaning
NameemptyLabel of the node; VLM online when empty. Also the key of its timings
Credentialsnone (required)The firebase-config node of the project. Its session authenticates every call, and its project decides the environment. Without it the node shows no credentials
Modelnone (required)The provider model that answers, from the platform's catalog for the project. The list needs a deployed, signed-in Credentials node. A model marked (deprecated) keeps working on a node that uses it, but is not offered to new ones
Imagemsg.payloadWhere the image is: a msg, flow or global property
Find byPromptPrompt — the model names what it finds or Tags — a fixed list of labels. Only the chosen field is sent
PromptemptyA sentence describing what to find. A string, or a msg, flow or global property
TagsemptyThe labels the model must choose from (see Tags). Edited as rows (list), as JSON, or read from a msg, flow or global property
Outputinferencemsg property that receives the detections
Parameters{}Optional sampling overrides for the provider call, as a JSON object or from a msg, flow or global property. An empty object is not sent
Timeout30000Milliseconds to wait for the platform

Under Debug Image: Show debug image (off), Debug interval (1), Debug image width (160), Box thickness (2, 1 to 10) and Font size (0.5, 0.3 to 2), with the same meaning as in the inferencer. The boxes are drawn on the JPEG that was sent.

Tags ​

Each tag has a name and an optional description, which becomes that tag's own line in the prompt: the place to say "the capsule on the neck, not the neck" next to the label it applies to.

json
[
  { "name": "cap", "description": "the aluminium capsule on the neck, not the neck" },
  { "name": "front label", "description": "the large label facing the camera" },
  { "name": "barcode" }
]

The name is also the tag of each detection. A tag with an explicit id keeps it, for flows that map the answer to a dataset's own tag ids. Read from a message, the value can also be an array of strings, or a comma-separated string of names.

Prompt or tags ​

A prompt opens the vocabulary: the model names what it finds, and those names come back in tag. Tags close it to your list. The two are alternatives: Find by selects one and the node sends only that one, whatever the other field holds. A flow saved before Find by existed uses the prompt when it has one, and the tags otherwise.

Parameters ​

Sampling overrides that the node passes to the platform as they are, for example:

json
{ "max_tokens": 16384, "reasoning": { "effort": "low" } }

The platform decides which keys it accepts and answers 400 to the others; the node's help in the editor lists them.

Input ​

javascript
msg.payload = imageBuffer;   // a JPEG, PNG, WebP or GIF Buffer, or a raw bitmap
return msg;
  • An encoded image is sent as JPEG: a JPEG as it is, the other formats converted on the device (quality 85).
  • A raw bitmap { data, width, height, channels, colorSpace } is converted to JPEG. channels (1, 3 or 4) is computed from the length of data when missing; BGR and BGRA are swapped to RGB first.
  • A Buffer that is not an encoded image fails with Buffer input is not a recognized encoded image (JPEG/PNG/WebP/BMP/GIF). A raw pixel buffer must be wrapped as {data, width, height, channels}.
  • A raw bitmap whose data does not match width × height × channels, or with a channel count other than 1, 3 or 4, fails with an error that says which; any other value fails with Unsupported image input. Expected an encoded image Buffer or a rosepetal raw bitmap {data, width, height, channels, colorSpace}.

Output ​

The Output property receives an array, one entry per object found:

javascript
msg.inference = [
  {
    tag: "cap",
    confidence: 0.91,
    raw_boxes: [[0.41, 0.08], [0.58, 0.08], [0.58, 0.19], [0.41, 0.19]],
    "2points": { xmin: 0.41, ymin: 0.08, xmax: 0.58, ymax: 0.19 }
    // ...plus 4points, xywhr and cwh
  }
]

The box formats are those of the inferencer, computed by the same code. There is no classId or color: a prompted model answers with label names, not indices into a class list.

Timings go to msg.performance.<Name> (msg.performance.VLMOnline when the node has no name):

PropertyMeaning
startTime, endTimeWhen the node started and finished, in milliseconds since 1970
encodeMsJPEG encoding on the device
requestMsThe round trip to the platform
inferenceMsThe provider's share of it, as the platform measured it; null when it reports none
totalMsThe whole message

Status and Errors ​

StatusMeaning
grey ring idleReady
red ring no credentialsNo Credentials node selected
yellow encoding, inferringConverting the image, waiting for the platform
green Total: Xms | Node: Yms | Server: Zms | Comm: WmsLast call: total, encoding, provider time, and the rest of the round trip. Server and Comm show ? when the platform reports no provider time
red, a short labelThe last message failed; back to idle after 8 seconds. The label is the one in the table below, or the first 40 characters of the error when it has none

A message that fails is not sent on: the error reaches the debug sidebar and any catch node. The errors are:

ErrorStatus labelCause
No model selected.Model is empty
No image on the configured input property.Nothing at Image
Task 'vlm:detect' needs a prompt. / Task 'vlm:detect' needs at least one tag.The field chosen by Find by is empty
No credentials: select a firebase-config node. ...no credentialsNo Credentials node
The firebase-config node is not signed in. Check its status in the editor.not signed inThe Credentials node has no session yet
Token allowance exhausted for this project. Usage is shared across the whole project, not per device.no tokens leftThe platform answered 402
Usage metering is unavailable, so the request was refused rather than run unmetered. Retry shortly.metering unavailable503
Credentials rejected: <detail>credentials rejected401
A message about inline images or about vlm:detect not being servedorchestrator too oldThe project's orchestrator predates this node
Request rejected: <detail>rejectedAnother 400, for example an unknown parameter
HTTP <status>: <detail>HTTP <status>Any other error status from the platform
A message that the request timed out after N ms, or that it failedNo answer within Timeout, or the platform could not be reached

A call the node gives up on is not cancelled on the platform: it can still finish there and be charged, and its answer is discarded. If a model is slow, raise Timeout rather than retrying.

Example ​

Check the closure of a bottle when a sensor fires, with a closed vocabulary:

[sensor trigger] → [camera] → [VLM online: Find by Tags] → [function] → [reject output]

Tags: [{"name": "cap", "description": "the aluminium capsule on the neck"}, {"name": "missing cap", "description": "an open neck with no capsule"}]

javascript
// function: reject when no cap is seen with enough confidence
const caps = msg.inference.filter(d => d.tag === "cap" && d.confidence >= 0.6);
msg.payload = caps.length === 0;   // true = reject
return msg;