Docs
/
Models
/

Assigning Bindings

Assigning Bindings

What Are Bindings?

Bindings connect your AI model to live data. Every model has inputs (data the model reads) and outputs (predictions the model writes). Bindings map each input and output to a tag — a live data point collected from a connected device.

Without bindings, the model has no data to process and nowhere to write its results. Once bindings are assigned and configured, the Predict Engine automatically feeds live tag values into the model at each scan cycle and writes the model's predictions back to the output tags.

Tags (live data)          Model               Tags (predictions)
┌──────────────────┐    ┌───────────┐    ┌──────────────────────┐
│ Temperature  ────│───►│           │───►│  Predicted Failure   │
│ Pressure     ────│───►│   ONNX    │───►│  Recommended Action  │
│ Flow Rate    ────│───►│   Model   │    └──────────────────────┘
│ Vibration    ────│───►│           │
└──────────────────┘    └───────────┘
     Input Bindings                        Output Bindings

How the Predict Engine Uses Bindings

At each scan cycle, the Predict Engine:

  1. Reads the recent history of each input tag (the number of samples depends on the model's sample_rate configuration)
  2. Calibrates each value by applying the binding's gain and bias (no-op when both are at defaults)
  3. Normalizes each value according to the binding's scaling configuration (e.g., Min-Max scales to 0–1)
  4. Runs inference — feeds the normalized input history through the model
  5. Denormalizes each output back to real-world units
  6. Calibrates inversely on outputs to convert from model space back to engineering units
  7. Writes the result to each output tag
  8. Validates that input values are within expected ranges (failure detection)

This happens automatically and continuously once the model is enabled.

The Bindings Tab

Navigate to a model's detail page and select the Bindings tab. The tab displays a two-column layout:

  • Left column — Input bindings (data the model reads)
  • Right column — Output bindings (predictions the model writes)

Each binding appears as a card showing:

  • Binding order number — the position in the model's input or output array
  • Tag name — the assigned tag, or "Unassigned" if no tag is linked
  • Live values — for inputs, the raw tag value and its normalized model input; for outputs, the model's raw output and the denormalized tag value
  • Failure bounds — the expected value range for failure detection
  • Status indicator — running, stopped, error, or unassigned

Assigning a Tag

Click any binding card to open its configuration drawer. The Tag section at the top contains a tag picker where you assign which tag feeds data into (or receives data from) this binding.

  1. Click the binding card to open the drawer
  2. In the Tag section, use the tag picker to search and select a tag
  3. The binding saves automatically when you close the drawer

For output bindings, the tag picker only shows writable tags — tags configured with output usage that can accept written values.

Training Metadata

If the model file includes training metadata (embedded via koios-model-utils), each binding may show a "From training" info box. This displays the binding's original name and description from training, helping you match bindings to the correct tags. For example, a binding named temperature_sensor_1 tells you which physical measurement it expects.

Scaling (Normalization)

Most ML models expect inputs in a specific numeric range (e.g., 0 to 1, or -1 to 1). Raw tag values like temperature (20–200) or pressure (0–500) need to be scaled before the model can process them. The Scaling section configures this transformation.

Scaling Methods

MethodFormulaOutput RangeUse Case
NoneNo transformationRaw valuesModel trained on raw data
Min-Max(value - min) / (max - min)0 to 1Most common for neural networks
Symmetric2 * (value - min) / (max - min) - 1-1 to 1Models using tanh activation
Z-Score(value - mean) / stdCentered at 0Standardized features

Parameter Source

When using Min-Max or Symmetric scaling, you choose where the min/max parameters come from:

  • Tag Range — Uses the rangeMin and rangeMax configured on the assigned tag. This is convenient when your tag ranges already match the training data ranges.
  • Custom — You provide explicit minimum and maximum values. Use this when the tag range doesn't match what the model was trained on.

Clamp Output

For output bindings, an optional Clamp Output toggle constrains the model's prediction to the binding's configured range. When enabled, if the model produces a value outside the normalization bounds, it is clamped to the minimum or maximum before being written to the tag. This prevents unexpected extreme values from reaching the output device.

Output Index

For models that forecast multiple future time steps (output depth > 1), each output binding has an Output Index setting (1-based) that selects which time step to use as its prediction. For example, if a model outputs 12 future steps and you only care about step 12, set the output index to 12. See Model Inference Requirements for details on multi-step output shapes.

Calibration (Gain & Bias)

Every binding can apply a linear transform on top of the raw value. The Scaling tab exposes two fields:

FieldDefaultDescription
Gain1.0Multiplier applied to the value. Cannot be zero.
Bias0.0Offset added after the gain.

Use calibration to correct sensor drift, convert engineering units, or fine-tune a model's response — without retraining or re-uploading the model file. Both values are non-nullable and default to the identity transform, so existing bindings see no change after upgrading to v1.1.0.

How Calibration Is Applied

Input bindings:

calibrated_value = (raw_tag_value × gain) + bias

Calibration runs before range checks, rate-of-change detection, and normalization, so every downstream check operates in the calibrated value space. If your gain or bias is non-default, the normalization source is automatically set to Custom — the tag's native range no longer matches what the model sees.

Output bindings (inverse):

tag_value = (denormalized_model_output − bias) / gain

Calibration is the final step before the value is written back to the tag.

Failure Detection

Failure detection monitors whether input values fall outside expected bounds. If an input is out of range, it may indicate a sensor fault, a disconnected device, or abnormal process conditions — any of which could cause the model to produce unreliable predictions.

Failure Range Mode

ModeBehavior
DisabledNo range checking performed
Normalization RangeUses the same min/max bounds configured in the Scaling section
CustomYou provide separate minimum and maximum failure bounds

Failure Evaluation

When the model uses interpolated samples (multiple data points per scan), this setting controls how samples are evaluated against the failure bounds:

EvaluationBehavior
AnyFails if any single sample is out of range
LatestOnly checks the most recent sample
AverageChecks the average of all samples

Failure Debounce

The debounce count prevents transient spikes from triggering failures. Set the number of consecutive scans that must fail before the binding enters a failure state. A value of 0 means failure triggers immediately on the first out-of-range scan.

Recovery Hysteresis

Once a binding enters a failure state, it doesn't recover the instant values return within bounds. The hysteresis percentage defines how far inside the range values must return before the binding recovers. This prevents rapid toggling between failed and healthy states when values hover near the boundary.

For example, with a range of 0–100 and 5% hysteresis, a failed binding only recovers when the value drops below 95 (or rises above 5).

Rate of Change Detection

Rate of Change (ROC) detection flags values that are changing too quickly, which can indicate equipment malfunction, sudden process upsets, or noisy sensors even when the value itself is within the normal range.

SettingDescription
ROC EnabledToggle rate-of-change detection on or off
ROC ThresholdMaximum allowed change per minute
Threshold ModeExpress the threshold in raw units per minute or as a percentage of the normalization range per minute
DirectionDetect rising changes, falling changes, or both
ROC WindowTime window (in seconds) over which the rate of change is calculated

Stale Data Detection

The Allowed Missed Samples setting controls how many consecutive scan cycles a tag can miss (produce no new data) before the binding is flagged as stale. This protects against situations where a device disconnects or a tag stops updating — the model would otherwise keep using the last known value indefinitely.

Binding Name and Description

Each binding has an editable name and description visible at the top of the configuration drawer. Click either field to edit it inline. If the model file included training metadata, the name and description are auto-populated from the metadata.

These fields are for your reference only — they help you identify which physical measurement or prediction each binding represents. They do not affect how the Predict Engine processes the binding.

Typical Workflow

  1. Upload a model file — bindings are created automatically from the model's input/output dimensions
  2. Review training metadata — if present, use the binding names to understand what each input/output expects
  3. Assign tags — click each binding and select the appropriate tag
  4. Configure scaling — set the normalization method and parameters to match how the model was trained
  5. Set failure detection — define acceptable ranges to catch sensor faults or abnormal data
  6. Enable the model — once all bindings are assigned and configured, enable the model to start inference

What's Next