Docs
/
Models
/

Importing & Exporting Models

Importing & Exporting Models

You can import and export AI model configurations — including their bindings — as CSV files. This is useful for migrating models between Koios instances, bulk-editing binding settings in a spreadsheet, or backing up model configurations before making changes.

How Models and Bindings Relate

Each AI model has a set of bindings — input bindings that map tags to model inputs, and output bindings that map model outputs back to tags. When you export models, Koios exports both the model settings and all of their bindings together.

The export produces a ZIP file containing two CSV files:

FileContents
models.csvOne row per model — general settings, inference config, and scan options
bindings.csvOne row per binding — tag assignments, normalization, failure detection, and output settings

Exporting Models

How to Export

There are two ways to export model configurations:

  1. From the model table — select one or more models using the checkboxes, then click Export config in the bulk actions menu. Only the selected models and their bindings are exported.
  2. Export all — if no models are selected, the export includes every model and binding in the system.

The export downloads a file named models_export.zip.

What's Included

Both CSVs contain all configuration fields. Columns that don't apply to a particular model or binding will be empty.

Model CSV Columns

Core fields:

ColumnDescription
idDatabase ID (primary key)
slugUUID identifier
nameModel name (unique)
descriptionOptional description
enabledWhether the model is actively running inference

Inference settings:

ColumnDescription
output_application0 = Absolute, 1 = Relative
output_mode0 = Continuous, 1 = Discrete
scan_rateInference interval in seconds (0.1–3600)
sample_rateHistorical data resample rate in seconds
on_demandWhether on-demand inference is enabled
on_demand_timeoutOn-demand timeout in seconds (0.5–30)
memory_onlyStore predictions in the live data cache only (skip time-series database)
log_levelDiagnostic log level (INFO, DEBUG, WARNING, ERROR)

References:

ColumnDescription
aiopmodel_fileActive model file (read-only — set by file upload)
scan_groupScan group ID (for synchronized execution)
remote_enable_tagTag ID for remote enable/disable control
parentFolder ID (if organized in folders)

System-managed fields (read-only):

ColumnDescription
inputsNumber of model inputs (set by model file metadata)
outputsNumber of model outputs (set by model file metadata)
created_atCreation timestamp
updated_atLast modification timestamp
last_modified_byUser who last modified the model

Binding CSV Columns

Core fields:

ColumnDescription
idDatabase ID (primary key) — required for binding import
slugUUID identifier
aiopmodelParent model ID
usage0 = Input, 1 = Output
binding_orderPosition in the input or output list (0-based)
nameBinding name (from model file metadata)
descriptionOptional description
tagAssigned tag ID (required for inputs, optional for outputs)

Normalization:

ColumnDescription
normalization_type0 = None, 1 = Min-Max, 2 = Symmetric, 3 = Z-Score
normalization_source0 = Tag Range, 1 = Custom
custom_minimumCustom min value (when source is Custom)
custom_maximumCustom max value (when source is Custom)
custom_meanCustom mean (for Z-Score normalization)
custom_stdCustom standard deviation (for Z-Score normalization)

Calibration:

ColumnDescription
gainLinear multiplier (default 1.0). Cannot be zero. See Calibration (Gain & Bias).
biasLinear offset added after gain (default 0.0).

Output settings:

ColumnDescription
output_index1-based output tensor index
clamp_outputClamp output values to the normalization range
max_upper_stepMaximum output step increase per scan
max_lower_stepMaximum output step decrease per scan

Failure detection:

ColumnDescription
failure_range_mode0 = Disabled, 1 = Custom, 2 = Normalization Range
custom_failure_minimumCustom failure range minimum
custom_failure_maximumCustom failure range maximum
failure_evaluation0 = Any, 1 = Latest, 2 = Average
failure_debounceConsecutive failing scans before the model enters a failed state
consider_stale_allowed_samplesAllowed missed input samples before failure
recovery_hysteresisRecovery hysteresis percentage (0–50%)

Rate-of-change detection:

ColumnDescription
roc_enabledWhether rate-of-change detection is enabled
roc_thresholdROC threshold value
roc_threshold_mode0 = Units per minute, 1 = Percent of range per minute
roc_direction0 = Rising, 1 = Falling, 2 = Both
roc_windowROC measurement window in seconds

Audit fields (read-only):

ColumnDescription
created_atCreation timestamp
updated_atLast modification timestamp
last_modified_byUser who last modified the binding

Importing Models

How to Import

  1. Navigate to the Models page
  2. Click the Import button in the table toolbar
  3. Select a file — either a ZIP (with models.csv and/or bindings.csv) or a single CSV
  4. Review the preview to verify what will change
  5. Click Confirm Import to apply the changes

File Formats

The import accepts three file formats:

FormatContents
ZIP fileContains models.csv and/or bindings.csv — both are processed together
Single CSV (models)Detected automatically by column headers — creates or updates models
Single CSV (bindings)Detected automatically by column headers — updates bindings only

Koios auto-detects whether a CSV contains models or bindings based on the column headers.

Models: Create or Update

How the import determines what to do with each model row:

ConditionAction
id column is emptyCreate a new model
id matches an existing model and fields differUpdate the existing model
id matches an existing model and nothing changedSkip the row
Row has validation errorsError — row is not imported

Bindings: Update Only

How the import determines what to do with each binding row:

ConditionAction
id matches an existing binding and fields differUpdate the existing binding
id matches an existing binding and nothing changedSkip the row
id is empty or doesn't match a bindingError — bindings cannot be created

Import Order

When importing a ZIP with both files, Koios processes models first, then bindings. This ensures any new models exist before their bindings are updated.

Example: Creating New Models

To create new models, leave the id column empty. Provide at least a name:

id,name,description,enabled,scan_rate,sample_rate,output_application,output_mode,log_level
,AHU Supply Air Model,Predicts supply air temperature,False,1.0,1.0,0,0,INFO
,Chiller Efficiency Model,Estimates COP from sensor data,False,5.0,5.0,0,0,INFO

Example: Bulk-Editing Binding Normalization

Export your models, then edit the bindings CSV to set normalization for all input bindings at once:

id,normalization_type,normalization_source,custom_minimum,custom_maximum
501,1,1,-20,50
502,1,1,0,100
503,1,1,0,500

This sets Min-Max normalization with custom ranges on three bindings.

Example: Assigning Tags to Bindings

id,tag
501,42
502,43
503,44

This assigns tag IDs 42, 43, and 44 to the three input bindings.

Preview Step

After selecting a file, Koios performs a dry run — it processes the CSV(s) without saving anything and shows you exactly what will happen:

  • Summary — counts of items that will be created, updated, skipped, or rejected
  • Row details — click any row to see a field-by-field diff of what will change
  • Diff table — click Show Diff Table for a full-width view of all changes, with changed fields highlighted

If the import includes both models and bindings (from a ZIP), the preview shows results for both.

Validation Rules

Model validation:

FieldValidation
nameRequired, max 128 characters, must be unique
descriptionMax 256 characters
scan_rateNumber between 0.01 and 3600
sample_rateNumber between 0.01 and 3600
on_demand_timeoutNumber between 0.5 and 30
output_applicationMust be 0 (Absolute) or 1 (Relative)
output_modeMust be 0 (Continuous) or 1 (Discrete)
log_levelMust be INFO, DEBUG, WARNING, or ERROR

Binding validation:

FieldValidation
idRequired — must match an existing binding
tagMust reference an existing tag ID
normalization_typeMust be 0 (None), 1 (Min-Max), 2 (Symmetric), or 3 (Z-Score)
normalization_sourceMust be 0 (Tag Range) or 1 (Custom)
recovery_hysteresisNumber between 0 and 50

Boolean fields accept: True/False, true/false, 1/0, yes/no.

Foreign key fields (tag, aiopmodel, scan_group, remote_enable_tag, parent) expect integer IDs.

After Import

Once you confirm the import:

  • Models and bindings are created or updated in a single transaction — if anything fails, all changes are rolled back
  • An audit event is recorded (e.g. "Imported 5 models") with your username
  • The model table automatically refreshes to show the updated list
  • Updated models pick up changes on the next inference cycle if they are enabled

Tips

  • Typical workflow for new models — create models via import (or the UI), upload model files to generate bindings, export the bindings, bulk-edit tag assignments and normalization in a spreadsheet, then re-import the bindings.
  • Bulk-edit normalization — export, filter the bindings CSV to input bindings (usage = 0), set normalization_type, normalization_source, and custom range columns, then import just the bindings CSV.
  • Move models between Koios instances — export from one instance, clear the id and slug columns in the models CSV (and the id, slug columns in the bindings CSV), adjust any tag and scan_group IDs to match the target instance, and import on the target. You'll also need to re-upload the model files.
  • Audit trail — every import creates an event visible on the Events page, grouped under a single parent event so you can see what was imported in one action.
  • Read-only columnsid, slug, inputs, outputs, aiopmodel_file, created_at, updated_at, and last_modified_by are ignored on model create. You can leave them in the CSV but they won't overwrite system-managed values.