Skip to content

Triton Inferencer Node ​

Overview ​

The Triton Inferencer node runs AI inference through NVIDIA Triton Inference Server with TensorRT engines. Each model is served as a pipeline model of the custom C++ backend rp_pipeline, which does the preprocessing, calls the TensorRT engine and does the postprocessing on the server, so the node sends the raw image and receives the finished result.

Unlike the Inferencer node, which runs PyTorch and Paddle models on Rosepetal's Python server, this node needs an NVIDIA GPU. Its results have the same shape, so one node can replace the other without changing the flow downstream.

Key Features ​

  • TensorRT engines built on the controller from ONNX, in FP16 (default) or FP32
  • Models from three sources: the Triton model repository on the controller, models trained on the platform (Firebase), and a catalog of 40 presets (YOLO, RF-DETR, DEIMv2, PP-OCR, SVTRv2)
  • One Triton server for every triton-inferencer and ocr-triton node, started with the first one and stopped with the last
  • Parameters from the model: thresholds start on the model's own values; any of them can be overridden, also from msg, flow or global context
  • Slicing of large images for detection and segmentation
  • Images through shared memory (/dev/shm)
  • Static or dynamic model, promise mode and a debug image

Architecture ​

Node-RED                    Docker container "triton-server"
┌──────────────┐            ┌──────────────────────────┐
│  triton-     │── gRPC ──→ │  NVIDIA Triton Server    │
│  inferencer  │  + /dev/shm│  ├── rp_pipeline backend │
│  node        │            │  ├── TensorRT engines    │
│              │←─ results ─│  └── model repository    │
└──────────────┘            └──────────────────────────┘
  • Model repository: /opt/storage/models/triton-model-dir/ on the host (under another folder when INFERENCE_MODELS_HOST is set), mounted as /models. Triton runs with explicit model control: a model is loaded only when a node asks for it.
  • Server lifecycle: the first node starts the container triton-server from the triton image of Rosepetal's Docker registry, tagged with the package version (triton:1.4.16 for 1.4.16), pulling it if needed. A running container with that name is reused. When the last node is stopped or removed, the container is stopped.
  • Models: each node holds one model. A model stays loaded while a node holds it, and is unloaded 5 seconds after the last node releases it, unless a node takes it again meanwhile, as during a redeploy. A dynamic node that switches to another model releases the previous one.

Configuration ​

Settings Tab ​

PropertyDefaultMeaning
Nametriton-inferencerLabel of the node (when empty, the model name); also the key of its timings
Model SourceStaticStatic: the model of Model Name. Dynamic (msg/flow/global): the model named on each message by Model Field
FirebasenoneOptional firebase-config node. With it, the finished platform models that have an ONNX export appear in the list, and a model that is not installed is downloaded and converted
Model NamenoneStatic mode. A searchable list of the installed models, the Firebase models and the presets. Without it the node shows No model configured and does nothing
Model Fieldmsg.modelNameDynamic mode. msg, flow or global property with the model name: an installed model, a Firebase model id or a preset id
Input Fieldimagemsg property with the image or an array of images
Output Keyinferencemsg property that receives the result
Promise ModeoffSends the message at once with a promise of the result in Promises Field
Promises Fieldpromisesmsg property, an array, that receives the promises
Max Concurrent5Images in progress at once, 1 to 100; also the number of shared-memory regions the node uses

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), as in the inferencer. For a batch, the first image is drawn.

Restart Triton Server restarts the container for every node that uses it and reloads the models they hold.

Model Config Tab ​

PropertyMeaning
Task TypeWhich parameters the tab shows: those of the selected model's task and format (see Supported Tasks and Formats), or all of them
Image Size / ClassesRead only: input size and classes of the selected model
PrecisionFP16 (default) or FP32, see below
ParametersThe post-processing knobs of the table below
Restore defaultsClears every override

The post-processing parameters (Confidence to DB Min Box Size) start on Model's default: no override is sent, and the node uses whatever the selected model carries: 0.5 for an anomaly model (its learned OK/NOK threshold), 0.6 for a PP-OCR detector, the trained task_specific.confidence for a YOLO model. Each can be set instead to a number, or to a msg, flow or global property read on every message. The editor shows the model's value beside each field, resolved from the loaded model on the Triton server, from the installed model's config when the server is stopped, or from the model's inference_config.json when it has not been prepared yet. The two orientation switches are true/false, and the slicing fields start on the values of the table below, which are sent to every model that has slicing inputs.

ParameterAccepted valuesApplies to
Confidence0 to 1Detection (also oriented boxes), segmentation, anomaly (the OK/NOK score), OCR (DB box score), detcls/segcls pipelines
IoU Threshold0 to 1YOLO detection, oriented boxes and segmentation (non-maximum suppression)
Max Detections1 to 10000Detection, segmentation, OCR, detcls/segcls
Mask Thresholdabove 0, below 1Segmentation, anomaly
Contour Epsilon0 to 1Segmentation, anomaly: polygon simplification
DB Threshold, DB Unclip Ratio, DB Max Candidates, DB Min Box Size0 to 1, above 0, 1 or more, 1 or morePaddleOCR text detection and OCR pipelines
Document Orientation, Textline Orientationtrue / false (default false)OCR pipelines installed with the orientation classifiers
Detection Confidence0 to 1, empty for the model'sdetcls and segcls pipelines: the threshold of the detection or segmentation stage
Slicing ModeNone (no slicing) (default) or Percentage slicesDetection and segmentation
X Grid (cols) / Y Grid (rows)1 or more (default 1)With slicing
Overlap X / Overlap Y0 to 1 (default 0.1)With slicing
Join AlgorithmNMM (default) or NMSWith slicing: how the results of the tiles are merged
Overlap MetricIoU (default) or IoSWith slicing
Join Threshold0 to 1 (default 0.5)With slicing

A parameter is sent only to models that declare the matching input; the others ignore it.

Precision ​

TensorRT precision of the model's engine, applied when the engine is built (trtexec --fp16); the ONNX stays FP32. Every build is kept: the downloaded ONNX and each engine built from it live in triton-model-dir/.variants/<model>/ (source/, fp16/, fp32/), so switching to a precision built before is a copy on deploy, and a new one is built from the kept ONNX without downloading. A model installed before this store (or by hand) has no kept ONNX: it is downloaded again from Firebase when the node has a connection, otherwise it keeps its engine and the node status says so. A node saved before this option existed keeps whatever engine is installed until the option is set. Precision is never changed automatically: an FP32 build that runs out of GPU memory fails and says to try FP16. One engine serves every node, so two nodes asking different precisions of the same model is an error on the second. OCR presets always build FP32. In dynamic mode the choice applies when a model is installed, not to models already on disk. Beside the selector the editor shows the installed precision and the stored builds.

Supported Tasks and Formats ​

The task_type and the format that a pipeline model declares in its config.pbtxt decide which parameters the tab shows:

Task/FormatParameters
detection/yolo, detection/yolo-e2eConfidence, IoU (not for end-to-end models), Max Detections, slicing
detection/rfdetr, detection/deimv2, detection/detr, detection/detr-e2eConfidence, Max Detections, slicing
obb/yoloConfidence, IoU, Max Detections
detection/paddle_detConfidence, Max Detections, DB parameters
segmentation/yolo, segmentation/yolo-e2eConfidence, IoU (not end-to-end), Max Detections, Mask Threshold, Contour Epsilon, slicing
classification/yolo, classification/rpclassnone
anomaly/anomalibConfidence (OK/NOK, 0.5 = trained threshold), Mask Threshold, Contour Epsilon
classification/paddle_textline_ori, classification/paddle_doc_ori, recognition/paddle_server_rec, recognition/paddle_mobile_rec, recognition/svtrv2_recnone (stages of the OCR presets)
ocr_pipeline/paddle_ocr_pipelineConfidence (DB box score), Max Detections, DB parameters, Document Orientation, Textline Orientation
detcls_pipeline/detcls, segcls_pipeline/segclsDetection Confidence, Confidence, Max Detections

A model that declares its pre- and postprocessing recipe in its config.json (as RP-OD and RP-CLASS models do) is keyed by the decode it declares (detr, yolo), so a new family that reuses an existing decode needs no change in the node. See Adding New Model Formats.

Getting a Model ​

Installed models ​

A model is installed when its pipeline model and its engine are in the Triton repository. The list shows every model of the repository whose config.pbtxt uses the rp_pipeline backend.

Firebase models ​

A model trained on the platform is installed the first time a node needs it (at deploy in static mode, at the first message in dynamic mode):

  1. Download of the ONNX export and its config.json, streamed to disk. An export above protobuf's 2 GB limit (anomaly models with a large ViT encoder, for example) comes as model.onnx plus a model.onnx.data weights sidecar; both are downloaded into the same folder.
  2. Metadata: a short-lived container reads the names and shapes of the ONNX tensors.
  3. Conversion: trtexec, in a short-lived container with the GPU, builds the TensorRT engine in the node's precision.
  4. Installation: the node writes two Triton models, <model>_weights (the engine) and <model> (the rp_pipeline model with the task's pre- and postprocessing), and swaps them into the repository at once.

Detection-and-classification and segmentation-and-classification pipelines (detcls, segcls) install one engine per stage plus the pipeline on top. The preparation of a model is limited to 30 minutes; the status shows each phase. POST /triton-inferencer/cancel-prepare/<model> cancels it.

The preprocessing follows the model's declared recipe when it has one; otherwise it depends on the family:

FormatPreprocessingDecode
yoloLetterbox padding, pad value 114, normalized to [0,1]yolo
rfdetr / rt-detrNo letterbox, mean/std normalizationdetr (class offset 1)
deimv2No letterbox, normalized to [0,1], no mean/stddetr (class offset 0)

If an installed engine cannot be loaded on this machine (built for another GPU or another TensorRT version), the node discards it and builds it again from the kept ONNX, from Firebase or from the preset; a model installed by hand, with no source, fails with an error that says so.

Presets ​

The catalog has 40 presets, downloaded from a public bucket: YOLOv8, YOLO11 and YOLO26 (n, s, m) for detection, segmentation and classification; RF-DETR (nano, small, medium) and DEIMv2 (atto, femto, pico, n) for detection; the OCR pipelines PP-OCRv5 (mobile, server) and PP-OCRv6 (tiny, small, medium); and the SVTRv2-B recognizer. The OCR presets are what ocr-triton runs.

Input ​

javascript
msg.image = imageBuffer;   // JPEG/PNG Buffer, or raw bitmap { width, height, data, channels, colorSpace }
return msg;
javascript
// Model Source: Dynamic, Model Field: msg.modelName
msg.modelName = "yolo11s-det";
msg.image = imageBuffer;
return msg;
  • An encoded Buffer is decoded on the controller. A raw bitmap is sent as it is: without channels, the node computes it from the length of data; without colorSpace, it takes RGB (RGBA with 4 channels). For BGR and BGRA images the node asks the server to swap the channels, when the model declares the SWAP_RB input.
  • An array of images is processed as a batch: one request per image, all at once, and the result is an array in the same order. A batch larger than the free Max Concurrent slots is rejected.
  • Parameters set to a msg property are read from each message.

Output ​

The result goes to the Output Key (msg.inference by default). It has the same shape as the inferencer node, from the same code — both run convertResultFromProto and then the shared format expansion in lib/result-conversion.js. Swapping one node for the other changes nothing downstream.

Coordinates are relative to the image, 0–1, and area is the fraction of the image covered. Every result carries every box format derived from the same geometry (raw_boxes, 4points, cwh, xywhr, 2points); segmentation and anomaly results also carry polygons, and the box is the polygons' bounding box. There is nothing to configure and no rasterized mask output.

Detection and segmentation return a list, one entry per instance. Anomaly and classification return a single object, one verdict per image. A batch of images returns a list of those, indexed by input order.

Detection:

javascript
{
  inference: [
    {
      tag: "person", confidence: 0.95, classId: 0,
      raw_boxes: [[0.08, 0.14], [0.25, 0.14], [0.25, 0.37], [0.08, 0.37]],
      "2points": { xmin: 0.08, ymin: 0.14, xmax: 0.25, ymax: 0.37 },
      color: { r: 255, g: 0, b: 0 }
      // ...plus cwh, xywhr and 4points
    }
  ]
}

Segmentation:

javascript
{
  inference: [
    {
      tag: "person", confidence: 0.92, classId: 0, area: 0.35,
      polygons: [[[0.1, 0.2], [0.5, 0.2], [0.5, 0.9], [0.1, 0.9]]],
      "2points": { xmin: 0.1, ymin: 0.2, xmax: 0.5, ymax: 0.9 },
      color: { r: 0, g: 255, b: 0 }
    }
  ]
}

Classification:

javascript
{
  inference: { tag: "cat", classId: 281, confidence: 0.98, all_tags: [...] }
}

OCR (PP-OCR presets; coords are normalised to the original image, one entry per detected text line in reading order; text joins them with a line break between boxes on different lines and a space between boxes on the same line). The det stage runs at the image's native resolution like the ocr-inferencer (PaddleX limit_side_len=64/min), capped at the engine's 1280 px profile. With Document Orientation on, the page is classified (0/90/180/270), read upright and the coordinates are mapped back to the original frame (metadata.document_angle); with Textline Orientation on, upside-down lines are flipped before recognition (metadata.orientation_angles, 0 = upright / 1 = flipped per line):

javascript
{
  inference: {
    texts: [ { coords: [[0.12, 0.20], [0.48, 0.20], [0.48, 0.31], [0.12, 0.31]], text: "L24980 01/06/27", score: 0.97 }, ... ],
    text: "L24980 01/06/27\nEXP 12/2027", text_concatenated: "...",
    text_largest_box: "...", text_highest_score: "...", text_most_centric: "...",
    metadata: { orientation_angles: [0, 0], document_angle: 180, warping_applied: false }
  }
}

Anomaly — one object per image, not a list. confidence is the normalised anomaly score, where 0.5 is the trained threshold (an anomalib export is min-max normalised, so 0.5 is what the model learned). polygons outline the anomalous pixels and area is the fraction of the image they cover; both come from thresholding the anomaly map, not from the verdict, so an OK image can still carry a mask:

javascript
{
  inference: {
    confidence: 0.87, tag: "NOK", classId: 1, area: 0.41,
    polygons: [[[0.098, 0.465], [0.091, 0.473], ...]],
    "2points": { xmin: 0.09, ymin: 0.11, xmax: 0.82, ymax: 0.94 },
    color: { r: 224, g: 170, b: 2 }
  }
}

Changed. Anomaly used to come back as a list of one, with polygons and area in pixels of the original image here and in pixels of the model's mask in the inferencer node — the same model, two different answers. Both are relative now. The Triton side of this needs a backend image built after the change; the inferencer side needs a serving image with the matching rosepetal-commons.

Document orientation (the classification/paddle_doc_ori stage of an OCR preset), in the shape of the ocr node's Document Rotation task:

javascript
{ inference: { angle: 180, orientation_label: "180", confidence: 0.99, all_tags: [...] } }

Performance ​

javascript
msg.performance.triton_inferencer["my-node"] = {
  node: { preprocess: 1.8, shm: 0.4, grpcCommunication: 0.9, postprocess: 0.6, total: 3.7 },
  server: { preprocess: 1.2, inference: 4.5, postprocess: 0.8, total: 6.6 },
  total: 10.9,
  imageCount: 4          // only for a batch
}

Times are in milliseconds; for a batch the node and server figures are averages per image and total is the time of the whole message. The key is the node's Name, or the node type (triton-inferencer) when the name is empty.

Promise mode ​

With Promise Mode on, the message leaves at once and a promise is appended to the Promises Field (created as an array when missing, and replaced by an empty array when it holds something that is not an array). It resolves to { <Output Key>: result, performance: { triton_inferencer: { ... } } }, or on failure to { error: "<text>", <Output Key>: "<text>" }. Resolve it with rp-promise-reader, as for the inferencer.

Errors ​

A message that cannot be processed is still sent, with msg.error set to the reason, and the node logs it:

msg.errorCause
Node not readyThe server or the model is still starting, or starting failed
Dynamic model name could not be resolvedDynamic mode and the Model Field is empty
No image found at msg.<field>Nothing in the Input Field
Batch of N would exceed max concurrent predictions (M), dropping messageToo many images in progress
Not enough free SHM slots for batch of N, dropping messageNo free shared-memory region for every image of the message
Failed to load model "<model>": <reason>The model could not be installed or loaded
Unsupported image format: expected Buffer or bitmap object {width, height, data}The input is neither
other textThe request to Triton failed

On error the Output Key is not written.

REST Admin Endpoints ​

HTTP endpoints registered at the Node-RED admin API, used by the editor:

MethodEndpointDescription
GET/triton-inferencer/modelsThe Triton repository index
GET/triton-inferencer/model-config/:modelNameTriton's configuration of a model
GET/triton-inferencer/model-defaults/:modelNameThe parameter values a model uses without overrides (origin and firebaseNodeId query parameters for models not installed yet)
GET/triton-inferencer/precision/:modelNamePrecision of the installed engine and of the stored builds
GET/triton-inferencer/pipeline-modelsInstalled rp_pipeline models with their task and format
GET/triton-inferencer/firebase-models?firebaseNodeId=<id>Finished Firebase models with an ONNX export
GET/triton-inferencer/default-modelsThe preset catalog
POST/triton-inferencer/cancel-prepare/:modelIdCancel the preparation of a model
POST/triton-inferencer/restart?nodeId=<id>Restart the Triton server (409 while a restart is in progress)

Status Indicators ​

StatusMeaning
Starting Triton...Starting or connecting to the container
yellow ring Pulling Docker image..., then Downloading: [...] N% and Extracting: [...] N%Pulling the triton image
Loading serversThe image is on the host; the container is starting
red ring Pull failed: <reason>The image could not be pulled
Downloading <model>..., Converting <model>..., Installing <model>...Preparing a model
Switching <model> to FP16... / FP32..., Rebuilding <model>...Changing or rebuilding the engine
green Ready (<model>)Static mode, model loaded
yellow ring Ready (<model>) — <note>Loaded, but the engine is not in the requested precision (the note says why)
green Ready (dynamic)Dynamic mode, waiting for messages
green Total: Xms | Node: Yms | Server: Zms | Comm: WmsTimings of the last message
red ring Not readyA message arrived before the node was ready; it is sent on with msg.error
red ring No model configuredStatic mode without a model
red ring Load failed: <model>A dynamic model could not be loaded
Restarting Triton server..., red ring Restart failed: <reason>Restart from the editor
red ring with the error textStarting failed

Requirements ​

  • An NVIDIA GPU with its driver, and Docker with the NVIDIA Container Toolkit: the container and the conversions are created with GPU access
  • /dev/shm shared with the container (it is mounted automatically)
  • Access to Rosepetal's Docker registry for the triton image
  • Disk space for the image and for the engines in /opt/storage/models/triton-model-dir

Adding New Model Formats ​

Recommended: the model declares its recipe in its config.json (common.preprocess / common.postprocess, written by rpdet). With the primitives the backend already has, the node needs no change at all: no FORMAT_PARAMS line, no model_format branch. RP-OD works this way.

For a model that predates the blocks:

  1. Register the format in FORMAT_PARAMS (in triton-inferencer.html):
    javascript
    'detection/myformat': ['confidenceThreshold', 'maxDetections']
  2. Set model_format in the model's config.pbtxt:
    parameters { key: "model_format" value: { string_value: "myformat" } }
  3. Add a pipeline template (optional) to triton-server/pipeline_templates/.
  4. Update the Firebase config generation (optional) in firebase-model-manager.js for automatic conversion.

ADD-NEW-MODELS.md, in the directory of the node's code, has the details.

See Also ​