Auto Training
Auto Training compares models against a fixed task and returns a saved model that the runtime can load by identifier. The experiment nodes pin source tables, fit preprocessing on training rows, compare candidates on validation data, and evaluate the selected model once on an independent test partition.
Use the durable experiment nodes for background training, dataset variants, resource budgets, and optional LLM consultation. The existing cross-validation tuners below remain available for explicit family selection and parameter grids.
For camera and sensor inspections that start with an LLM teacher and later switch to a trained model, see Teacher-to-student inspections below.
The four cross-validation tuning nodes compare model families or sweep one family’s hyperparameters. Each pair supports nominal or ordered targets.
All four load a feature-vector column and a target column from a database, cross-validate every candidate on the same folds, retrain the winner on the full tuning dataset, and return it as a model. Keep a final test set outside that entire loop.
Durable table experiments
Section titled “Durable table experiments”The task nodes share one experiment controller and return an experiment_id immediately. The controller continues training in the background, one experiment at a time, in the training ledger of the machine that runs the workflow. Get Auto Training Result reads the current leaderboard and outputs; Cancel Auto Training and Resume Auto Training preserve the experiment’s remaining budget and saved work.
The wall-time budget is charged from the moment a controller starts working on the experiment. A started or resumed experiment that waits in the queue is not charged, and neither is a cancelled one. Time in which the app is closed during an active run is charged. After a restart, Resume Auto Training continues an experiment that was running. A tenth of the wall budget, at most 5 minutes, is held back for the final audit: trials stop and no new trial starts once only that allowance remains. Resuming a search when no more than the allowance remains requeues nothing. The experiment then stops with wall_time_budget_exhausted, and its best validated candidate, if any, is still selected and audited.
When the background controller fails, or is still blocked by a busy device, job or ledger after five attempts, it cancels the experiment and records a background_worker_failed or background_worker_stopped event; Resume Auto Training continues it.
| Node | Task |
|---|---|
| Auto Train Tabular | Numeric and categorical features for classification, regression, or explicitly ordered classes |
| Auto Train Forecast | Prepared sensor windows, future targets, or temporal classification |
| Auto Train Vision | Image classification, boxes, semantic masks, instance masks, or an explicit fusion recipe |
| Auto Train Anomaly | Sensor reconstruction or image-feature anomaly models |
| Auto Train Agent | The same search with an optional LLM consultant; returns after selection and final evaluation |
| Step Auto Training | Run one candidate and return its validation results |
| Finalize Auto Training | Freeze the validation winner and audit it on the final test partition |
Step Auto Training shares the experiment with the background controller that the task nodes and Resume Auto Training start. That controller runs the remaining candidates and then finalizes the experiment on its own, so a workflow cannot use Step to pace or order a search the task nodes started. While the controller holds the experiment, Step returns it unchanged. When another worker holds the scheduled trial’s job, lease or resources, Step returns at once and records a trial_blocked event.
Start Auto Train Agent with database columns
Section titled “Start Auto Train Agent with database columns”For tabular classification or regression, configure Auto Train Agent through its inputs. Start with a table containing stable, unique row IDs, feature columns, and known, measured target values. For example, a defect dataset might contain id, temperature, vibration, machine_type, and defective.
- Connect Open Database to the Agent’s Database input and execution input.
- Leave Task at Classification, set Target Column to
defective, and leave Row ID Column atid. Choose Regression for a continuous numeric target. Classification labels are inferred from the source table. - Set Numeric Columns to
temperature,vibrationand Categorical Columns tomachine_type. Both inputs accept comma-separated names; at least one must contain a feature. If multiple rows describe the same part or production run, set Group Column to that identity column so related rows stay together. Otherwise, grouping uses the row ID. - Optionally connect a Consultant Model, then run the workflow. The Agent returns Result after model selection and final evaluation. Without a consultant, the deterministic search still runs.
The default split targets 70% training, 15% validation, and 15% test data, with seed 42. The source is pinned before reading. Median imputation, standardization, and categorical encoding are fitted on training rows only. The default search allows eight candidates, with limits of 12 trials, 20 minutes of wall time, and 10 minutes of training. An attached consultant can make up to four calls.
Use Advanced Configuration for custom budgets, split policies, quality goals, ordered classes, vision, forecasting, or other full-request settings. This optional input replaces the direct inputs in full when supplied. It retains the former Configuration input’s schema and connections, so existing workflows keep their settings.
Configure a durable experiment
Section titled “Configure a durable experiment”The task-specific nodes accept a database connection, a task specification, stable row IDs, feature and target mappings, and a split policy through their configuration. Use a group such as a part, production run, or overlapping sensor window to keep related rows in one partition. Temporal splits use timestamp boundaries, an embargo, and the task’s prediction horizon. A source is pinned to its exact branch and version before it is read; incomplete reads and duplicate row IDs fail.
Tabular mappings accept explicit numeric and categorical columns. Numeric imputation, standardization, and categorical vocabulary are fitted only on training rows and saved in the model’s preprocessing manifest. Missing and previously unseen categories have distinct encoded values. Targets, group IDs, timestamps, and outcome columns cannot be selected as tabular features. Use tensor or serialized-sample mappings for images, sequences, detection annotations, and per-row label provenance. Window Features constructs causal tabular statistics; sequence tensors and image decoding still require their explicit preprocessing nodes.
By default, preparation creates separate experiment tables for training, validation, and test rows. They hold the mapped source columns and generated named columns alongside model inputs, source lineage, and a preprocessing digest, and return pinned references. Source columns that the mapping does not read are not copied; to read them, join the tables’ sample_id, which holds the mapped row ID, with the source table. Set tables.create_tables to false to keep only the durable dataset snapshots. Updating an existing table requires both allowed_destination and its matching expected_destination; the controller rejects a changed destination. Feature proposals preserve every row’s partition, target, and provenance.
The search tries native baselines and bounded Burn recipes appropriate to the task. Tabular classification includes Gaussian Naive Bayes, decision trees, and logistic regression. ordered_target: true uses the declared label order, replaces those three with ordinal ridge and ordinal logistic models, and defaults to minimizing mean_rank_error. Temporal candidates include LSTM, GRU, CNN1D, and TCN. Generated Burn candidates use seeded configuration sampling and successive halving: surviving configurations resume their weights and optimizer state at larger epoch budgets. Classical candidates complete their configured fit. Classical solver calls check cancellation and time limits before and after fitting, so an active solver call must return before cancellation takes effect.
Architectures needing additional information, such as an image/sensor fusion layout or EfficientAD teacher weights, can be supplied through initial_candidates. Visual feature models such as PatchCore and PaDiM require compatible feature tensors. The trainer does not infer a missing input layout or download pretrained assets.
Set the quality goal separately from the model’s decision threshold. For example, this classification goal requires at least 32 audited samples and 95% accuracy:
{ "task": { "kind": "classification" }, "primary_metric": "accuracy", "direction": "maximize", "minimum_audited_samples": 32, "bounds": [ { "name": "accuracy", "minimum": 0.95, "maximum": null } ]}The controller measures predictions itself. Validation and final-test labels must be reviewed or measured; teacher labels can contribute training examples. Workers receive a snapshot without test rows. The final candidate is frozen before its test evidence is opened, and an agent cannot change the target or select another candidate after seeing the result. A model that misses the requested bounds is still returned with goal_met: false and unmet_constraints.
Auto Train Agent receives the training profile, allowed feature columns, and measured validation results. Its typed actions are run_next, train_burn, select_features, engineer_features, and finish. Feature proposals can combine the authorized operations below. The agent cannot edit labels, provenance, splits, budgets, or scores. Failed or rejected consultations leave deterministic search available. Each call first reserves one token per prompt byte, plus the completion allowance and a 512-token margin, priced at the operator’s token_price_ceiling_micros; set that ceiling for the provider’s billing currency and pricing. After a reply, the reservation is replaced with the provider-reported token count at the same price, and that usage is also returned in Result. A call without reported usage, such as one that timed out, keeps its full reservation. A call is skipped without a charge when the search window closes within 10 seconds.
The Agent fires Done only after the experiment is settled. While another worker holds the experiment’s scheduled trial, device reservation or lock, the Agent waits for it. If the experiment makes no progress for its wall-time budget, the Agent fails with an error that names the experiment.
Results include the best trial and model artifact IDs, native weights reference, fitted preprocessing, source versions, created or updated tables, dataset snapshots, validation leaderboard, final-test metrics, and budget use. Final prediction evidence can be materialized as a separate table when the Agent finishes or Get Auto Training Result retrieves a completed background run. The winner is then published as files that runtimes without the ledger can run. Predict Auto Model accepts raw rows, applies the selected trial’s saved preprocessing, and loads its artifact from the ledger, or from the published files where no ledger holds the experiment. Export Auto Model writes native weights and a version 2 manifest to the supplied paths; for a manifest named model.json, the fitted preprocessing goes to model.preprocessing.json beside it.
Experiments train only where a training ledger exists: in the desktop app, except for online apps without a hub connection, and on offline device placements. A process supervisor on that machine can continue an experiment with flow-like-auto-trainer --repository PATH --experiment ID, where PATH is the ledger’s jobs.sqlite; add --resume for cancelled work, --step for one trial, or --result to read its artifacts. Build the binary with flow-like-catalog-ml/training-auto for automatic GPU selection or training-cpu for CPU execution. The node’s optional experiment_id continues Agent consultation against the same saved experiment.
Feature engineering
Section titled “Feature engineering”Set feature_plan on an Auto Training request, or use these nodes to prepare a dataset directly:
| Node | Operation |
|---|---|
| Derive Columns | Named arithmetic expressions, safe division, logarithms, square roots, clipping, and missing-value fallback |
| Window Features | Grouped lags, deltas, rates, and rolling mean, standard deviation, RMS, minimum, or maximum |
| Join Sources | Exact-key or backward as-of joins against declared source aliases |
| Fit Preprocessing | Fit imputation, categorical encoding, optional standardization, and optional PCA on training rows |
| Materialize Dataset | Write prepared train, validation, and test partitions with their named columns and lineage |
A FeaturePlan contains ordered pipeline.steps, selected numeric_columns and categorical_columns, imputation, standardize, optional pca_components, and resource limits. Expressions are typed Rust operations. They do not execute arbitrary SQL, DataFusion expressions, or scripts. New output names must be unique, and expressions cannot read protected target or identity columns.
Declare related tables through feature_sources, each with an alias, source, and allowed_columns. Sources are pinned before their selected values are saved in the fitted pipeline. Duplicate exact keys and duplicate as-of key/timestamp pairs fail. As-of joins select a preceding timestamp, with optional tolerance and availability time; joins preserve row count.
Splits are fixed before transformations run. Window history resets at train, validation, and test boundaries. Imputation (median, mean, or constant), scaling, category vocabulary, and PCA use training rows only. PCA supports up to 128 input features and 32 components and rejects components beyond the observed rank.
Predict Auto Model replays the saved pipeline. Set stateful_features: true and pass the returned feature_state into the next call to retain causal window history. Each group’s timestamps must strictly increase. Without state, each batch starts with empty history. Row, byte, expression, join, and history limits also apply during inference. When the state reaches its group, history-row or byte limit, the groups with the oldest last timestamp are dropped and restart with empty history. Set the feature plan’s limits for the number of entities that are active at once.
Continuous learning projects
Section titled “Continuous learning projects”Create Learning Project saves a training request, review policy, aggregate budget, and deployment identity. A workflow timer or event must invoke Step Learning Project or Learning Project Agent to advance it. The Agent adds optional feature and model consultation; saving a project alone does not schedule execution.
Set Learning Project Agent’s Project ID to the saved identifier from Create Learning Project, then optionally connect a Consultant Model and Instructions. The Agent uses the project’s saved dataset and budgets with default limits of four consultation calls per experiment. Create Learning Project still defines the dataset, training settings, and project budgets. Use Advanced Configuration to supply a project identifier and custom consultation limits together; it overrides Project ID and retains existing configuration connections.
Feed Observe Learning Samples stable sample/group IDs, capture times, model predictions, and optional embeddings and declared operating slices. Select Samples for Review prioritizes uncertainty, teacher disagreement, diversity, and rare predicted classes. Review Learning Sample records an independent reviewed annotation or measured outcome with its availability time and increasing revision. Analyze Model Errors reports classification errors by class and declared slice; it does not diagnose detection or segmentation failure regions. Consultant error summaries use training or validation observations and exclude independent audit samples and groups.
Put the raw source row in each observation’s sample field. Canary replay requires the original mapped columns, matching identity/group/time, and a timestamp mapping or serialized sample; with a positive canary_fraction, Observe Learning Samples rejects a batch in which an observation lacks them. Window pipelines also require raw rows for preceding observations. New training examples must be present in the configured source table; observation collection does not insert them there. The next cycle reopens the latest source version, pins it, and overlays available reviews.
Retraining requires enough new reviews, an available budget, and the configured cooldown. Embedding drift, observed classification error, and Notify Learning Product Change also contribute reasons. Each cycle excludes previously sealed audit groups and keeps previously trained groups out of its new test partition. Candidate and champion predictions use their own saved preprocessing on the same fresh audit cohort.
For a time split, optional rolling_time_split on project creation supplies validation_duration_ms and test_duration_ms. Each cycle fixes its boundaries relative to its reservation time: validation ends one test duration earlier, and training ends one validation duration before that. The existing embargo and prediction horizon still apply. Omitting this option preserves the original fixed cutoffs.
Every learning project needs explicit quality bounds in training.goals.bounds; Create Learning Project fails without them, with or without automatic_promotion. Promote Learning Model checks those bounds, audited sample counts, and minimum_improvement. With a positive canary_fraction and an existing champion, Route Learning Project assigns deterministic candidate traffic. Full promotion then requires fresh reviewed canary samples and actual predictions from both models. Supplied observation labels do not substitute for those predictions.
Revising a review after its canary predictions were recorded invalidates that audit evidence. On the next audit or promotion attempt, the project rejects the candidate, retains the champion, and records the reason. Later training cycles can continue with fresh evidence.
Get Learning Project exposes state, blocking reasons, cycles, and spending. Reservations, experiments, and completed predictions are kept in the training ledger and survive restarts; later ticks resume saved work. Only the champion is published; the experiments of a learning cycle are not. Pause Learning Project suspends training and routes decisions to the teacher, Resume Learning Project continues the saved project, and Rollback Learning Model restores the prior deployment. Reject Learning Candidate discards a shadow or canary candidate without promoting it; the champion keeps serving and the next cycle can start. Aggregate cycle, training, consultation, storage, and observation budgets bound the loop.
The four tuning nodes
Section titled “The four tuning nodes”| Node | Use it for | Target type |
|---|---|---|
| Auto Classifier | Comparing classifier families, ranked by accuracy or macro-F1 | Unordered classes |
| Auto Ordinal | Comparing ordinal families, ranked by an ordinal metric | Ordered levels |
| Grid Search | Exhaustive hyperparameter search for one classifier family | Unordered classes |
| Ordinal Grid Search | Exhaustive hyperparameter search for one ordinal family | Ordered levels |
The Auto node’s Best Model Type output and the matching Grid Search Model Type input use the same model-kind strings, so the pins connect directly for supported families.
What the Auto nodes sweep
Section titled “What the Auto nodes sweep”| Node | Families tried | Off by default |
|---|---|---|
| Auto Classifier | Gaussian Naive Bayes, Decision Tree (three depths), Logistic Regression (three penalties), Random Forest, one-vs-all SVM | Nothing; SVM, Logistic Regression and Random Forest each have an include toggle |
| Auto Ordinal | Proportional Odds and Ordered Probit, All-Threshold under a logistic and a hinge margin, Ordinal Ridge (three penalties), Continuation Ratio, Adjacent Category | The neural family (CORAL and CORN heads) |
Neither Auto node covers everything in the catalog. AdaBoost, KNN, Multinomial Naive Bayes and Frank & Hall are not swept by an Auto node, and neither Grid Search node can tune them either, so reach for the training node directly if you want to try them. One-Class SVM is novelty detection rather than a classifier over a target column, so no tuner covers it at all.
Why ordered targets need their own tuners
Section titled “Why ordered targets need their own tuners”Auto Classifier and Grid Search resolve the target in a way that discards the level order: rank ids are assigned in whatever order the labels appear, and both rank candidates by accuracy (Auto Classifier also offers macro-F1). Under accuracy, predicting level 1 when the truth was level 5 costs exactly what predicting level 4 costs. A distance-blind objective picks the wrong model on an ordered target, and nothing in the resulting leaderboard reveals it. The scores look entirely plausible.
The ordinal tuners keep the ordered contract end to end. The level set is resolved once, before the folds are cut, and handed to every candidate, so a level a fold happens to miss cannot renumber the ranks for that fold. Ranking then uses a metric that knows how far a miss was.
Both ordinal tuners take a Class Order pin: comma-separated labels from lowest to highest. Leave it empty when the labels are numeric and numeric order is what you want. Non-numeric labels have no inferable order, so the search fails rather than guessing one. Both also publish a Levels output stating the resolved order and whether it came from your list (Explicit) or from reading the labels as numbers (Numeric). Check that output first when a leaderboard looks upside down.
Every ordinal candidate is a gradient or a least-squares fit on the raw columns. Scale the features with Fit Feature Scaler and Apply Transform before writing the column the tuner reads. Unscaled columns change which family and which hyperparameters win, not only how fast they converge.
Choosing the metric
Section titled “Choosing the metric”Auto Classifier ranks by accuracy or macro_f1. Grid Search always ranks by accuracy. If you selected the family under macro-F1 because the classes are imbalanced, the tuning step will optimize a different objective.
Both ordinal tuners offer the same six metrics:
| Metric | What it answers | Direction |
|---|---|---|
Quadratic Kappa | Chance-corrected agreement, penalising a two-level miss four times as hard as a one-level miss. The standard headline metric | Higher is better |
Linear Kappa | The same, with every step along the scale costing the same. Use it when one level is one unit of loss | Higher is better |
Mean Rank Error | Average number of levels a prediction is off by | Lower is better |
Macro Rank Error | The same, averaged per true level so each level gets one vote. This is the metric that moves when a model has collapsed onto the majority level | Lower is better |
Kendall Tau-b | Does the model order the rows correctly, ties corrected. Ignores calibration entirely | Higher is better |
Spearman | The same question via rank correlation on midranks | Higher is better |
Two of the six are error metrics. Ranking one the wrong way round crowns the worst candidate in the sweep and leaves a result that reads as normal, so the nodes never publish a score without its direction: Auto Ordinal sets higher_is_better in its Results struct, and Ordinal Grid Search additionally exposes it as a dedicated Higher Is Better output pin next to Best Score. Branch on that pin rather than assuming a larger number is better.
The two rank-association metrics answer a different question from the rest. A model whose predictions are all shifted by one level scores a perfect 1.0 under Kendall tau-b and Spearman. Use them when the ranking is what the workflow consumes, and a kappa or an error metric when the predicted level itself is.
Reading the leaderboard
Section titled “Reading the leaderboard”Auto Ordinal returns the fullest result. Each leaderboard entry carries:
| Field | Meaning |
|---|---|
model_type | The model kind, using the strings expected by Grid Search |
variant | The configuration in words, for example Support Vector Ordinal Regression (all-threshold loss, hinge margin). Several variants can share one model type |
params | Only the hyperparameters the node set explicitly; anything absent stayed at the estimator’s own default |
cv_score | Mean score across the folds, in the units of the chosen metric |
train_time_secs | Seconds spent fitting and scoring this configuration across all folds |
rank | Position, 1 being best under the metric and its direction |
Alongside the leaderboard, the ordinal nodes return a skipped list. A configuration that fails to fit on any fold is dropped from the ranking with a warning in the run log and its reason recorded, rather than ending the run. That matters because some failures are structural rather than accidental: Continuation Ratio refuses to fit when a fold omits a middle level, and a CORN head fails on a fold that omits a level nothing reaches, while every other family on the same folds is healthy. Only when every configuration fails does the node return an error. Ordinal Grid Search lists the reasons in that error; Auto Ordinal only does so when nothing ever completed a fold. When configurations failed after an earlier one had scored, it errors with a bare Leaderboard is empty after ranking and the reasons are left in the run-log warnings.
Auto Classifier and Grid Search have no equivalent. A fit failure there aborts the whole run.
Grid Search and Ordinal Grid Search report per-combination entries with mean_score, std_score and the individual fold_scores. Read the spread, not only the mean: two combinations whose means differ by less than their fold-to-fold standard deviation are not meaningfully separated, and picking between them is picking noise.
Budget the search
Section titled “Budget the search”Total cost is roughly (candidates x folds) model fits, plus one refit of the winner on the full dataset. Both Auto nodes expand each family into several configurations. Auto Classifier sweeps three tree depths and three logistic penalties; Auto Ordinal sweeps three ridge penalties. The default Auto Ordinal sweep is nine configurations, eleven with the neural family on.
Auto Ordinal’s neural family is off by default, and the default is the recommendation. A network is refitted from scratch on every fold and typically dominates the runtime of the entire sweep. Switch it on when you suspect the levels are not separated by a single monotone direction in the features; the hidden layer is its whole contribution. With no hidden layer, CORAL is exactly the all-threshold model and CORN is exactly Continuation Ratio, so when a linear family still wins, prefer it.
Reproducibility differs between the two pairs:
| Node | Fold shuffle |
|---|---|
| Auto Ordinal, Ordinal Grid Search | Seeded through a Seed pin, default 42. The same seed reproduces the same folds and therefore the same leaderboard |
| Auto Classifier, Grid Search | Unseeded. Re-running can reorder candidates that were within noise of each other |
Change the seed on an ordinal tuner to check whether a narrow win survives a different split. If it does not, the win was the split. Auto Ordinal’s neural candidates also use a fixed weight-initialization seed, and the winner’s refit reuses it, so the model handed out is the one that was scored.
Random Forest and AdaBoost are not bit-reproducible across processes even where a seed is fixed: linfa breaks ties in hash-map order, and the seed fixes the sampling, not the tie-breaks.
Parameter grids
Section titled “Parameter grids”Both Grid Search nodes take a Parameter Grid pin: a list of {name, values} entries whose full cartesian product is the sweep. The pin is seeded once with the default grid for whichever model type was selected when the node was placed, and is deliberately never rewritten afterwards, so a hand-edited grid is never clobbered.
Two consequences follow:
- Leaving the grid empty uses the default grid for the currently selected model type. This is what keeps the node correct after
Model Typeis switched. - An entry the selected family does not consume is rejected with an error, not ignored. An ignored entry would make the sweep fit the same configuration repeatedly and report identical scores as a tuning result.
Accepted parameter names per family:
| Node | Model type | Accepted parameters |
|---|---|---|
| Grid Search | DecisionTree | max_depth, min_weight_split |
| Grid Search | LogisticRegression | alpha |
| Grid Search | RandomForest | ensemble_size, max_depth, min_weight_split, bootstrap_proportion, feature_proportion |
| Grid Search | GaussianNaiveBayes, SVMMultiClass | None; clear the grid and they run as a single configuration |
| Ordinal Grid Search | OrdinalLogistic | alpha, link, loss, margin, learning_rate, max_iterations |
| Ordinal Grid Search | OrdinalRidge | alpha |
| Ordinal Grid Search | OrdinalContinuationRatio | alpha, link, learning_rate |
| Ordinal Grid Search | OrdinalAdjacentCategory | alpha, learning_rate |
| Ordinal Grid Search | OrdinalNeural | alpha, head, activation, hidden_layers, learning_rate, max_iterations, seed |
Keep grids small. Every added value multiplies into the product, and every resulting combination is refitted once per fold.
Keep the test set out of selection
Section titled “Keep the test set out of selection”Tuning is model selection, and model selection consumes evaluation data. Keep a final test set out of the tuning loop entirely. Split it off with Split Dataset or Stratified Split before the tuner ever sees the rows. Cross-validation inside the tuner selects the model; the held-out set is what reports how it performs.
Record with the result:
- candidate families or parameter ranges;
- the selected metric and its direction;
- the seed, where the node has one;
- the split definition;
- the winning configuration and its score;
- the training data version.
Evaluate the winner on the held-out set with the nodes that match the task: Accuracy and Confusion Matrix for classification, Ordinal Metrics for ordered targets. Then persist the model with Save Model and serve it through Predict.
Tuning checklist
Section titled “Tuning checklist”- Target type decided: ordered levels use the ordinal tuners, not the classifier ones
- Features scaled before the column the tuner reads
-
Class Ordersupplied for non-numeric ordered labels, and theLevelsoutput checked - Metric chosen deliberately, and its direction read from the node rather than assumed
- Final test set held out of the tuning loop
- Fold spread reviewed, not just the mean score
- Skipped configurations and their reasons reviewed
- Seed, metric, split, winning configuration and data version recorded
- Winner re-evaluated on the held-out set before it is saved
Next steps
Section titled “Next steps”Teacher-to-student inspections
Section titled “Teacher-to-student inspections”An inspection can use a teacher model while it collects labelled examples, train a smaller student in the background, compare both on independent evidence, and send subsequent decisions to the student. Teacher labels are training data. Agreement with the teacher is reported separately from accuracy against reviewed labels or observed outcomes.
Automatic device selection tries CUDA, ROCm, WGPU, then CPU. It skips backends absent from the installed build and tests a forward calculation and its gradient before selecting a device. Missing drivers or a failed probe advance to the next backend. WGPU uses the platform’s graphics API, including Metal on macOS. Native classical models run on CPU.
Use training-auto to include the backends supported by the build target. Native desktop builds and standalone releases enable it by default; executors do not train (see Build features). training-cpu supports smaller custom builds that omit those automatic product bundles; training-wgpu, training-cuda, and training-rocm select individual GPU features. Feature selection happens when building the application. Runtime selection uses the hardware and drivers on the machine running it. Selecting CPU in a standard desktop build leaves its compiled GPU support available for other workflows.
The standard Windows MSVC and Linux GNU x86_64 builds include all four backends. macOS and ARM64 Windows/Linux builds include WGPU and CPU, as do Windows GNU and Linux musl builds. Other targets keep CPU support. Automatic selection skips WGPU software adapters so machines without a usable GPU use the native CPU backend.
Compute configuration defaults to backend: "auto", device index 0, and CPU fallback enabled. Probe Training Device accepts {"backend":"auto"} and reports the concrete backend selected. To pin a device, supply its backend and set allow_cpu_fallback: false. With fallback enabled, an explicit GPU request tries that backend, then the remaining lower-priority backends, ending with CPU. Saved configurations that explicitly select CPU continue using CPU.
Lifecycle nodes keep their samples, jobs, immutable model blobs and deployments in the same training ledger as the experiments. Training nodes return an error on runtimes without a ledger; promoted students still run there from their published files. The standalone flow-like-ml-worker binary can run saved jobs under a process supervisor; pass the ledger’s jobs.sqlite as --repository. Board shadow/replay execution cannot mutate that ledger. Use the explicit comparison branch of a live inspection workflow to record candidate predictions.
Build the inspection loop
Section titled “Build the inspection loop”- Build Inspection Spec turns a description into a task, label order and input shape. Plan Inspection Training chooses a supported Burn recipe. Review dimensions and labels against the actual source. A changed specification creates a separate training stream. Routing then returns to the teacher, and promoting a student of the new stream needs a new deployment ID.
- Read camera frames or sensor values. Use Preprocess Inspection Image, Make Inspection Sample, Sensor Window, or Build Visual Sequence to attach tensor shape, timestamps, source identity and a split group. Frames from the same part, production run or overlapping window must share a group.
- Teacher Label evaluates the evidence in the supplied multimodal history. Review Annotation records corrections. For future events, Attach Observed Outcome attaches a measured target only after its observation interval has ended.
- Record Training Sample stores an immutable annotation revision. Supply the time the label became available, and reuse it on retries. Train After N Samples or a specific trainer starts a job after enough new accepted samples arrive and the training partition has enough examples.
- Route Inspection sends decisions to the teacher during collection. Once a candidate exists, its shadow output also runs the candidate for comparison. Training Job Status, Cancel Training, Resume Training, and Recover Training Jobs expose the durable job state.
- Record Model Comparison stores sample-aligned predictions. Evaluate Student handles classification; Evaluate Inspection Task handles task-specific evidence. Training and validation groups do not count as independent audited evidence.
- Promote Student or Promote by Audited Metrics checks minimum sample counts and quality bounds before atomically changing the active artifact. Route Inspection then activates only the student decision branch.
- Use Distribution Drift and Loss Drift to monitor changes. Pause/Resume Student Routing sends decisions back to the teacher, including when no previous student exists. Rollback Student restores the previous deployment. A failed promotion leaves the teacher in control while the next batch supplies more training data.
The confidence cutoff for a single prediction, the number of new examples needed to train, and the quality required for promotion are separate settings. Apply Decision Threshold, Student Confidence Gate, and Select Decision Threshold cover prediction decisions. Fit calibration and choose thresholds on validation data; reserve reviewed test groups for promotion.
Available student families
Section titled “Available student families”| Data and task | Native implementation |
|---|---|
| Engineered sensor features | MLP, histogram gradient boosted trees, Isolation Forest |
| Temporal classification or forecasting | LSTM, GRU, causal TCN, 1D CNN |
| Reconstruction anomalies | Dense, convolutional sequence and LSTM autoencoders |
| Image classification | ResNet-18, MobileNetV2, EfficientNet, DINOv2 Small/Base with a trained classifier |
| Object detection | YOLOX, RT-DETRv2 ResNet-18/50, RF-DETR, D-FINE Nano |
| Semantic segmentation | U-Net |
| Instance segmentation | Mask R-CNN with a compact residual backbone, region proposals, ROIAlign and mask loss |
| Visual anomalies | PatchCore memory bank, PaDiM spatial Gaussians, EfficientAD |
| Image sequences | CNN-LSTM |
| Images plus sensor channels | Image/sensor fusion network |
Extract Image Features and Feature Map to Patches connect a trained image backbone to PatchCore or PaDiM. EfficientAD requires compatible pretrained PDN-small teacher weights. Its training and calibration sets contain normal images. The imported teacher remains frozen. Mask R-CNN’s compact backbone does not load arbitrary ResNet-50/FPN checkpoints.
The native histogram booster supports squared-error regression and binary logistic classification. It does not import XGBoost model files.
A complete Configuration value for Train LSTM, here a temporal classifier for windows of 64 readings from six channels, looks like this:
{ "inspection": { "stream_id": "press-vibration", "spec": { "id": "press-vibration", "description": "Classify press cycles from six vibration channels", "task": "sensor_classification", "labels": ["ok", "defect"], "input_shape": [64, 6], "prediction_horizon_ms": null, "minimum_examples": 200, "minimum_examples_per_class": 20 } }, "after_new_samples": 50, "config": { "recipe": { "architecture": "lstm", "input_features": 6, "hidden": 32, "outputs": 2, "objective": "classification" }, "backend": { "backend": "auto" }, "epochs": 30, "batch_size": 32, "learning_rate": 0.001, "seed": 42, "gradient_clip": 5.0 }, "split": { "kind": "group", "train_fraction": 0.7, "validation_fraction": 0.15, "seed": 42 }, "worker_limits": { "memory_budget_bytes": 2147483648, "maximum_artifact_bytes": 1073741824, "maximum_checkpoint_bytes": 2147483648, "maximum_duration_ms": 3600000, "lease_duration_ms": 30000 }}The inspection’s sample shape, input_shape, is [window_length, 6]. The trainer supplies the batch dimension. The recipe’s input_features must equal the last dimension, and outputs the number of labels. Keep preprocessing identical during training and inference, and save its steps in the optional preprocessing field. The optional compute field selects the execution backend and replaces config.backend; it defaults to automatic selection.
Start vision training from pretrained weights
Section titled “Start vision training from pretrained weights”Import Pretrained Vision Weights reads compatible float32 weights from SafeTensors or a supported PyTorch ZIP checkpoint entirely in Rust. Supply the file through an app-scoped FlowPath, select its architecture, and record its source, revision, code license and weight license. An optional expected_sha256 verifies the downloaded file. The importer checks tensor names, shapes and data types; it does not execute Python or pickle code. It returns a project-scoped source ID. List Pretrained Vision Weights also lists compatible models trained earlier in that project.
| Import model | Supported upstream architecture | RGB preparation |
|---|---|---|
torchvision_res_net18 | Canonical torchvision ResNet-18, 64 base channels | ImageNet normalization |
dino_v2 | Standard DINOv2 Small/Base, patch size 14, without register tokens | ImageNet normalization; dimensions divisible by 14 |
rtdetr_v2 | RT-DETRv2 ResNet-18/50-vd with bilinear deformable attention | Values in [0, 1]; dimensions divisible by 32 |
rf_detr | Nano, Small, Medium, Base and Large2026 detection variants | ImageNet normalization; use the selected variant’s image dimensions |
dfine_nano | D-FINE Nano with HGNetv2-B0 | Values in [0, 1]; dimensions divisible by 32 |
sam2 | SAM 2.1 Hiera Tiny, image prompts and masks | ImageNet normalization at 1024 × 1024 |
Preprocess Inspection Image converts RGB bytes to [0, 1] before applying the supplied mean and standard deviation. For ImageNet normalization, use mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225]. For unnormalized [0, 1] input, use mean [0, 0, 0] and standard deviation [1, 1, 1]. Apply the same preparation before recording training samples and before inference. Imported source metadata includes the recommended preparation; importing weights does not transform existing tensors.
Set the trainer’s pretrained field to the returned source ID:
{ "pretrained": { "source_id": "pretrained:your-source-id", "replace_head": true, "freeze_backbone": true }}The target recipe must retain the source architecture. Head replacement allows a new class count or label order. Retaining a head requires the original label order. Fine-tuning starts a new optimizer and dataset history; resuming an interrupted job restores that job’s optimizer and cursor. DINOv2 imports contain a feature backbone and require training a new classifier before classification. Existing native ResNet-18, MobileNetV2 and EfficientNet artifacts can also initialize a new classifier. Training from such an artifact fails when it, or any model it was initialized from, trained on data in the new run’s validation groups, or trained or validated on data in its test groups. Data is matched by content digest and, within the same stream, by group ID. Initialize from imported weights instead, or keep that data in training.
Extract Pretrained Image Features accepts a project source ID and either a single CHW image tensor from Preprocess Inspection Image or an NCHW batch. Use it with DINOv2 or a supported classifier backbone, then pass the spatial feature maps through Feature Map to Patches for PatchCore or PaDiM. Feature extraction does not require training a classifier or create evaluation evidence.
Auto Train Vision and Auto Train Agent accept the same pretrained field. The controller adds a compatible fine-tuning candidate alongside its baselines; a source trained in the project gets the lineage check above. The final audit also fails when a test sample lies in a group holding data that the winner or its lineage trained or validated on. The consultant sees only source IDs available to that project. Imported weights do not count as training results or evaluation evidence.
RT-DETRv2 and D-FINE fine-tuning use matching, classification and box losses, including auxiliary decoder predictions. They omit upstream denoising augmentation; D-FINE also omits the upstream fine-grained localization and distribution-distillation losses. RF-DETR retains its grouped training queries and IoU-aware classification loss. Detector predictions rank query/class pairs without NMS.
Prompt and fine-tune SAM 2
Section titled “Prompt and fine-tune SAM 2”Segment with SAM 2 takes an imported source ID, a prepared CHW image or NCHW batch, and one prompt per image. Prompts can contain foreground/background points, a bounding box or previous mask logits. Point and box coordinates refer to the resized 1024 × 1024 image. The result contains four 256 × 256 mask-logit maps, predicted IoU scores and an object score. Token 0 is the single-mask output; tokens 1 through 3 are alternative masks. Threshold logits at zero to obtain foreground masks, then resize masks to the original image coordinates.
Fine-tune SAM 2 accepts image/prompt pairs and reviewed binary masks shaped [N, 1, 256, 256]. It freezes the image encoder by default and trains the prompt and mask decoder with focal, Dice, IoU and object losses. It returns a new project source and training report. This is an image annotation workflow with an explicit training call. It does not provide video tracking or enter SAM into the unprompted classifier/detector experiment search.
SAM checks its estimated model, data and working memory against compute.memory_limit_bytes before loading weights. Fine-tuning usually needs a higher limit than the default 2 GiB, particularly when the image encoder is unfrozen. A rejected request reports the required estimate.
Code and checkpoint licenses
Section titled “Code and checkpoint licenses”The upstream code for RT-DETR, D-FINE, standard DINOv2 and SAM 2 uses Apache-2.0. RF-DETR support covers the Apache-designated detection variants; RF-DETR Plus variants and the deprecated original Large architecture are excluded. DINOv2 XRay and CELL models are also excluded.
Record the terms for the exact checkpoint separately from its implementation license. D-FINE’s Objects365-derived checkpoints have additional dataset restrictions; the COCO Nano checkpoint is the supported import architecture. The stored license fields retain the supplied provenance and do not establish rights to a dataset or third-party checkpoint.
Camera, sensor and teacher adapters
Section titled “Camera, sensor and teacher adapters”Read Modbus Sensor supports Modbus TCP registers and discrete values. Decode Sensor Registers makes byte order, word order and numeric representation explicit. Read OPC UA Sensor ships in standard execution builds and requires a trusted PKI store in the executor’s app storage. The node reads anonymously; the persistent OPC UA client also supports credentials on encrypted channels. These nodes belong to the industrial catalog and retain their existing node IDs. Capture GenICam Frame requires sensor-genicam and captures GigE Vision frames. Its image conversion supports Mono8, RGB8 and BGR8. Other transport and pixel formats require an adapter.
FFT, STFT, band energy, signal statistics and timestamped resampling run in Rust. Resampling has an explicit maximum gap. Align Modalities uses only sensor readings available at the image timestamp.
The ONNX catalog includes GroundingDINO detection, a SAM image encoder, and SAM prompt segmentation adapters. Supply compatible ONNX sessions, the expected preprocessing and, for GroundingDINO, tokenized inputs with class-token positions. These adapters do not bundle or download pretrained weights.
Persistence and export
Section titled “Persistence and export”A model artifact records its dataset digest, architecture, label order and preprocessing. Native checkpoints also retain optimizer and sampler state for resume. Training jobs use leases, cancellation and resource reservations; model promotion uses an expected deployment generation to reject competing updates. Promotion, rollback and routing changes also publish the active model, and Export Model writes any ledger model to a folder of your choice.
Enable training-onnx-export for Export Student to ONNX. Export uses fixed input dimensions and reports output semantics. DINOv2, RT-DETRv2, RF-DETR, D-FINE and Mask R-CNN are refused, and other graphs fail explicitly when the exporter lacks one of their operators, as LSTM does. Native inference remains available for them. Automated tests export only an MLP and do not compare ONNX outputs with native predictions, so compare an exported model’s outputs with native inference before deploying it.
The cross-platform CI job exercises CPU learning, checkpoint resume, lifecycle races and protocol emulators on Linux, Windows and macOS. Physical camera/PLC interoperability and application accuracy still depend on the installed equipment and the inspection dataset.
Training history and published models
Section titled “Training history and published models”Training keeps its state in a training ledger: a SQLite database, jobs.sqlite, with immutable model blobs in jobs.artifacts/ and lock files in .training-locks/. The ledger stays on the machine that trains. Models that other runtimes should run are published as ordinary files under the app’s storage/models folder, which syncs, ships to devices and travels in archives like any other app file. Models trained on a user’s own tables go to models in that user’s User Storage instead. Flows reach storage/models through the Storage Dir node; the Storage view lists the upload folder and does not show it.
Device-local training ledgers
Section titled “Device-local training ledgers”Every app has a shared ledger and one private ledger per user. They live in the app storage of the machine that trains, next to the apps rather than inside them:
| Runtime | Shared ledger | A user’s private ledger |
|---|---|---|
| Desktop | <projects>/training-ledgers/apps/<app>/project/jobs.sqlite | <projects>/training-ledgers/apps/<app>/users/<user>/jobs.sqlite |
| Offline device placement | <store>/training-ledgers/apps/<project>/project/jobs.sqlite | <store>/training-ledgers/apps/<project>/users/local/jobs.sqlite |
<projects> is the desktop’s project folder, by default flow-like/projects in the system data folder, for example ~/Library/Application Support/flow-like/projects on macOS. <store> is placement-data/<placement>/current/store in the device agent’s state folder; it survives new revisions and stays on disk when the placement is removed. <app> and <project> are the app ID. <user> is the account ID of the run, or local for a run without one; offline device placements always run as local. An ID of at most 80 ASCII letters, digits, ., - and _ that neither starts nor ends with . or _ is used as is. In any other ID, other characters become _, and a 12-character hash of the ID is appended.
Apps that trained before this layout keep their shared ledger at apps/<app>/storage/inspection/jobs.sqlite and go on using it in place. The shared scope uses the new project/jobs.sqlite when it exists, otherwise that older ledger when it exists, and otherwise the new path. The older ledger is never moved; it is deleted only together with its app. Device placements set up before this change may hold a copy of it, which they also keep using in place.
Lookups never create a ledger. Only nodes that record new data do: Record Training Sample, Train After N Samples and the Train nodes, starting Auto Training, Create Learning Project, Import Pretrained Vision Weights and Import Model. On a device without a ledger for the stream, Training Job Status, Cancel Training, Resume Training, Get Model Artifact, Record Model Comparison, Evaluate Student, Evaluate Inspection Task, Promote Student, Promote by Audited Metrics, Rollback Student and Pause/Resume Student Routing fail with an error that names the stream. Recover Training Jobs returns an empty list there, and so does List Pretrained Vision Weights without a shared ledger. The ledger is never synced, archived, forked or copied to a device. To move it, use Export Training Ledger and Import Training Ledger.
The command-line tools take the ledger’s database, for example flow-like-auto-trainer --repository "<projects>/training-ledgers/apps/<app>/project/jobs.sqlite" --experiment <id>. Pass the users/<user> ledger for a private experiment, and <projects>/apps/<app>/storage/inspection/jobs.sqlite for an app that still uses its older ledger.
Deleting an app in the desktop app, including from Settings › Local storage, first stops the app’s background training for up to 30 seconds, then removes its whole training-ledgers/apps/<app> folder; new training for the app stays refused until that delete has finished. Local storage counts the ledgers in the app’s size, and a blob hard-linked into several ledgers counts once. When training is still running after the 30 seconds, the ledgers stay, including an older ledger inside the app folder, and a warning is logged. Local storage then lists them as training ledgers left by a deleted app, which you can delete there later.
Private ledgers
Section titled “Private ledgers”A workflow that trains on a user’s own tables trains in that user’s private ledger. An experiment or learning project uses the shared ledger only when its main source and every feature source are tables of the project database. A table from the executing user’s database, or a source that matches neither database, selects the private ledger, so unclear sources stay private. A learning cycle that runs on an existing stream keeps its project’s ledger.
Private records have their own IDs. Experiment streams start with user:auto: and learning streams with user:learning:, followed by a UUID, and their project is <app>:<board>:user. New experiments record the choice in request.context.ledger_scope and new learning projects in request.source.ledger_scope (app or user). Inspection nodes route only these generated IDs to the private ledger; a hand-written stream such as user:camera stays shared. Nodes that take an experiment, learning project or pretrained source ID, as well as Student Model Inference and Extract Image Features, search the shared ledger, then an older in-place ledger, then the executing user’s private ledger. Nodes that take an artifact ID together with an inspection stream, such as Get Model Artifact and Export Model, use that stream’s ledger.
A private experiment cannot write into the shared project database. It refuses tables.create_tables when its main source is a project table, and any allowed_destination in the project database. When the project database cannot be identified, a table it cannot classify counts as a project table. The error is:
This experiment trains on private (user-scoped) data, so it cannot write tables into the shared project database; set tables.create_tables to false or train from a user-scoped main table.
When a private experiment or learning cycle starts, it copies the pretrained sources it can use from the shared ledger into the private one, under the same IDs: the requested pretrained.source_id, the source of the rows’ feature extractor, and the 16 most recent Burn sources of the board’s shared project, <app>:<board>, which the LLM consultant may name. A different blob under an existing ID fails the start for the requested source; for the other sources, the copy is skipped and a warning is logged. The copy of a shared training artifact keeps the content digests of its whole initialization lineage, so fine-tuning from it in the private ledger is held to the same lineage check.
Published models
Section titled “Published models”The training machine publishes these models:
| Model | Published when | Pointer |
|---|---|---|
| The winner of a standalone Auto Train experiment, also when it missed its goals | Once its final-test metrics exist: Finalize Auto Training, Auto Train Agent and Step Auto Training publish it, and Get Auto Training Result, Cancel Auto Training and Resume Auto Training check it once per run | models/experiments/<experiment>.json |
| A learning project’s champion | Create Learning Project, Get Learning Project, Step Learning Project (not while the project is paused), Learning Project Agent, Promote Learning Model, Rollback Learning Model, Pause Learning Project and Resume Learning Project | models/learning/<project>.json |
| A lifecycle deployment’s active student | Promote Student, Promote by Audited Metrics, Rollback Student and Pause/Resume Student Routing; Get Active Student repairs it | models/deployments/<deployment>.json |
| A fine-tuned SAM 2 source | Fine-tune SAM 2 succeeds | None; the storage of the ledger that holds its base source, which Fine-tune SAM 2 finds in the shared, older in-place or private ledger |
| The feature extractor a model’s embeddings came from | Together with that model, when a training ledger of this app holds the extractor and it fits the size caps. Publication to app storage never copies an extractor that only a user’s private ledger holds; Export Model and Export Auto Model may include it. Otherwise the model is published without it and a warning is logged | None |
The experiment of a learning cycle is not published; only its project’s champion is. Each model gets a folder, models/artifacts/<id>/, and a pointer names the current model of its experiment, project or deployment. A paused pointer, or a champion pointer that names no model, routes to the teacher: Route Learning Project and Route Inspection return the teacher route, and learning_champion and deployment sources of the prediction nodes below refuse to load a model.
Models of the shared ledger go to the app’s storage/models. Models of a private ledger go to models/ in the user’s User Storage of the app, which other members cannot read. A lifecycle deployment of an experiment’s or learning project’s stream follows that record’s scope. Records created before this change carry no scope; they are classified each time they are published, and the result is not stored. A model goes to app storage when every source is in the project database, and to the executing user’s storage when any source is in that user’s database and none is unknown. Otherwise nothing is written, and an experiment records model_publish_skipped with source_scope_unclassifiable.
Each publish writes the weights, then preprocessing.json, then the extractor’s folder, then manifest.json, then the pointer. It confirms each upload’s size, and its ETag where the store reports one, before writing the next file, and readers verify every sha256. Publishing never fails the node that triggered it:
- An experiment records a
model_published,model_publish_failedormodel_publish_skippedevent. - A learning project adds
champion_model_not_published: <error>tonext_actions.blockingwhen publishing fails, and logs a warning when its champion is skipped. - Deployments and SAM 2 sources log a warning.
Weights above 512 MiB are not published (weights_exceed_serving_cap), and neither are manifests above 1 MiB (manifest_too_large) or preprocessing files above their cap (preprocessing_too_large). When the folder of a champion or active student is skipped this way, its pointer is still written and routes to the teacher: a champion pointer gets a null artifact_id, and a deployment pointer is marked paused. The publication is still reported as skipped. A deployment pointer whose JSON would exceed 64 KiB is not written (pointer_too_large).
Promotions, rollbacks, pauses, resumes, finished cycles and finalized experiments always publish their new state. Get Auto Training Result, Cancel Auto Training, Resume Auto Training, Get Learning Project and Get Active Student check the published copy once per run; Get Active Student does so only on a device whose ledger holds the stream. They rewrite weights and preprocessing files that are missing or have the wrong size, a manifest that is missing, names other weights or lacks the planned preprocessing reference, and a pointer whose content differs from the ledger. A check returns at once while the same record is being published elsewhere in the process. Prediction nodes only read published files. The background worker runs outside any workflow, so an experiment it finishes is published by the next Get Auto Training Result, Cancel, Resume, Step or Finalize Auto Training node, or Auto Train Agent, that runs on it; Predict Auto Model does not publish. Read the result before taking a device snapshot.
Desktop runs of online apps write published models directly to cloud storage and then keep a local copy; they also refill missing local copies when nothing else changed. These writes never enter the offline queue: without a connection they fail, and the next of the checking nodes above that runs online repairs them. Export Model and Export Auto Model use the same writer, so they also fail while offline when they write into the app’s cloud storage.
File formats and retention
Section titled “File formats and retention”A model root holds:
storage/models/├── artifacts/<id>/weights.bin written once├── artifacts/<id>/preprocessing.json written once, optional├── artifacts/<id>/manifest.json written once, last├── experiments/<experiment>.json├── learning/<project>.json└── deployments/<deployment>.jsonIDs become folder and file names the same way app and user IDs do in ledger paths, so a pretrained source pretrained:<uuid> gets the folder pretrained_<uuid>-<hash>. Artifact folders also hold fine-tuned SAM 2 sources and feature extractors, which are pretrained sources or training artifacts.
manifest.json describes one model and is at most 1 MiB. Exactly one of artifact and pretrained_source is set, each the ledger’s full record, and weights.sha256 equals that record’s blob digest. A pretrained source record has id, project_id, source_kind, blob, manifest, origin and created_at_ms:
{ "format_version": 2, "artifact": { "id": "…", "job_id": "…", "stream": { "project_id": "…", "stream_id": "…", "inspection_version": "…" }, "snapshot_id": "…", "dataset_digest": "…", "blob": { "sha256": "…", "bytes": 1, "path": "….blob" }, "manifest": { "engine": "…", "preprocessing_manifest": { "$published": "preprocessing.json" } }, "created_at_ms": 0 }, "pretrained_source": null, "weights": { "file": "weights.bin", "sha256": "<hex64>", "bytes": 1 }, "preprocessing": { "file": "preprocessing.json", "sha256": "<hex64>", "bytes": 1, "maximum_bytes": 67108864 }, "task": { "kind": "anomaly", "threshold": 0.5 }, "calibration": { "scale": 0.8, "threshold": 0.5 }, "goal_met": false, "validation_metrics": {}, "final_test_metrics": {}, "source_table_versions": [], "dependencies": { "feature_extractor": { "source_id": "pretrained:…", "blob_sha256": "<hex64>" } }, "provenance": { "publisher": "auto", "ledger": "app", "storage": "app", "experiment_id": "…", "selected_trial_id": "…", "learning_project_id": null, "cycle_id": null, "deployment_id": null, "deployment_generation": null, "published_at_ms": 0 }}weights.fileandpreprocessing.fileare plain file names in the manifest’s folder.weights.fileis null only when Export Auto Model wrote the weights into another folder.task,goal_met, the metrics and the fitted table preprocessing come from the experiment that trained the model; for a learning project’s model, the cycle experiment that produced it, so its champion and deployment manifests match. Without one, a champion carries only its project’stask, and a lifecycle student of a manually named stream or a feature extractor carries none of them.calibrationis set for anomaly models that an experiment trained:scaleis the selected trial’sanomaly_scale, or 1.0 when it has none, andthresholdis the task’s threshold.- The artifact’s preprocessing manifest moves to
preprocessing.jsonand leaves the marker{"$published": "preprocessing.json"}; loaders restore it. provenance.publisherisautofor automatic publication andexportfor Export Model and Export Auto Model. A folder written as another model’s feature extractor also has"dependency": true.- Version 1 manifests, written by Export Auto Model before this change, still load through a
filessource.
preprocessing.json holds the fitted table preprocessing in preprocessing, or the artifact’s preprocessing manifest when there is no table preprocessing. artifact_preprocessing_manifest holds the artifact’s preprocessing manifest only when it differs from preprocessing:
{ "format_version": 1, "preprocessing": { "kind": "tabular" }, "artifact_preprocessing_manifest": null }Its cap is twice the feature pipeline’s limits.maximum_bytes plus 1 MiB; the limit, 64 MiB unless an engineered pipeline sets another, is recorded as maximum_bytes. At load time the file must also fit in a quarter of the default 2 GiB compute memory limit, after that limit is clamped to the host.
Pointers are at most 64 KiB. An experiment pointer names the winner:
{ "format_version": 1, "experiment_id": "…", "artifact_id": "…", "sha256": "…", "bytes": 1, "goal_met": true, "storage": "app", "published_at_ms": 0 }A champion pointer is ordered by (deployment_generation, project_generation):
{ "format_version": 1, "project_id": "…", "deployment_id": "deployment:learning:…", "deployment_generation": 3, "project_generation": 12, "artifact_id": "…", "sha256": "…", "paused": false, "cycle_id": "…", "retained": ["older-1", "older-2"], "storage": "app", "published_at_ms": 0 }A deployment pointer is ordered by generation and carries the full deployment:
{ "format_version": 1, "deployment_id": "…", "generation": 5, "active_artifact_id": "…", "paused": false, "stream": { "project_id": "…", "stream_id": "…", "inspection_version": "…" }, "sha256": "…", "deployment": {}, "retained": ["…"], "storage": "app", "published_at_ms": 0 }Publication never replaces a pointer of greater order, so a device keeps a newer champion or deployment it received. It writes the ledger’s pointer over one of equal or lower order whose content differs. Device refreshes replace a pointer only with one of strictly greater order.
Champion and deployment pointers list up to three previous models in retained, newest first. When a pointer changes, a model that is neither current nor retained is deleted from that root if automatic publication wrote it and no other pointer or kept manifest names it. Its manifest goes first, then its other files, then its dependencies under the same rule. Roots with more than 1,000 pointer files skip this cleanup with a warning. Within one process, pruning and pointer writes in a root run one at a time, and a pointer write first checks that the folders it names still exist; pruning by another process or device on the same cloud root is not coordinated with it. Experiment winners and Export Model folders are never deleted. A device refresh deletes nothing, but a later publication on the device can delete refreshed folders under the same rule. Rolling back to a deleted model publishes it again from the ledger.
Run models without a ledger
Section titled “Run models without a ledger”Prediction nodes use the ledger when it holds the record for the expected project; a record of another project counts as missing. For learning projects and lifecycle deployments, a pointer of strictly greater order in this device’s local storage of the record’s scope wins over the ledger, so a device follows a newer champion it received. Shadow runs and runtimes without a local ledger read only published files, and Predict Published Model and Extract Published Image Features always do. Without a ledger or record, the nodes read the published files:
| Node | Without a ledger |
|---|---|
| Predict Auto Model | The experiment pointer in app storage, then in the user’s storage. Anomaly calibration comes from the manifest |
| Student Model Inference, Extract Image Features | models/artifacts/<artifact>/: in the user’s storage for a private stream, in app storage and then the user’s storage for a stream that Auto Train or a learning project created, otherwise in app storage. The manifest’s stream ID and inspection version must match |
| Extract Pretrained Image Features | models/artifacts/<source>/: a pretrained source, a Burn artifact or another model’s extractor. The returned extractor names the one that computed the features, which is the model’s recorded extractor when it has one |
| Route Learning Project | The champion pointer: route kind champion, or teacher when the pointer is paused or names no model. No canary or shadow route |
| Route Inspection | The deployment pointer: mode student_only on the Student pin, or teacher_only on the Teacher pin when the pointer is paused, missing or serves another stream. No shadow candidate |
| Get Active Student | The deployment pointer’s deployment when its stream matches |
| Segment with SAM 2 | The published fine-tuned source |
A loader checks each file’s size with a HEAD request before downloading it, checks the size the download reports again before reading its body, and checks the sha256 of the weights and preprocessing files after reading them. The weights, SAM 2 weights included, must fit in 512 MiB and in a quarter of the request’s compute.memory_limit_bytes, after that limit is clamped to the host. A model’s feature extractor resolves from models/artifacts/<source>/ of the same root, or from dependencies/<source>/ beside an exported manifest, and its ID and blob digest must match. Loaded trained models are cached per process; a cached model still answers only callers whose own copy of its weights is readable and unchanged. Pretrained and SAM 2 sources are downloaded and verified on every call.
Six nodes work with published models and moved history:
| Node | FlowScript | Purpose |
|---|---|---|
| Predict Published Model | inspection::predictPublishedModel | Runs a published model. With preprocessing in its manifest, rows are raw table rows as for Predict Auto Model; otherwise each row is a TensorData, and a batch dimension is added when its shape equals the input shape |
| Extract Published Image Features | inspection::publishedImageFeatures | Computes feature maps with the model’s recorded extractor, a Burn pretrained source itself or a Burn classifier’s backbone, and outputs the extractor for PatchCore and PaDiM |
| Export Model | inspection::exportModel | Writes an experiment winner, champion, artifact or pretrained source from the ledger as a version 2 folder with dependencies/<id>/ to any FlowPath, including app storage for a private model |
| Import Model | inspection::importModel | Registers a published burn or sam2 model as a pretrained source in the shared ledger, or the private one with private: true |
| Export Training Ledger | inspection::exportTrainingLedger | Writes a consistent snapshot of the shared ledger, or the private one with private: true, to a folder |
| Import Training Ledger | inspection::importTrainingLedger | Installs such a snapshot for the same app on a device that has no ledger of that scope yet |
The two prediction nodes and Import Model take a model source with a kind. files takes a manifest path, for example built from Storage Dir and models/artifacts/<folder>/manifest.json, plus a weights path when the manifest names no weights file in its own folder, as in version 1 exports, which carry no anomaly calibration. experiment takes experiment_id, learning_champion takes project_id, deployment takes deployment_id, and artifact takes artifact_id, which can also name a pretrained source. These four accept an optional storage of app or user; without it, they search app storage and then the user’s storage, and an error lists every path tried. The four export and import nodes need a training build and a live run on a device that keeps local ledgers. Export Model and Export Training Ledger also need an existing ledger that holds what they export.
Move models and training history
Section titled “Move models and training history”storage/models is ordinary app storage. It syncs for online apps, travels in app archives and device snapshots, and is copied by forks that include data. Forks without data drop it, because published models derive from data; such a fork retrains or imports its models. A user’s models folder in User Storage syncs for online apps but is not part of app archives, and a device snapshot carries only the selected user’s folder. The training ledger, including an older one under storage/inspection, is left out of archives, duplicates, device snapshots and forks. Importing an archive made before this change skips its ledger entries and logs a warning.
Export Training Ledger writes jobs.sqlite, the blobs as jobs.artifacts/<sha256>.blob and, last, ledger.json:
{ "format_version": 1, "scope": "app", "app_id": "…", "project_ids": ["app:board"], "database": { "file": "jobs.sqlite", "sha256": "…", "bytes": 1 }, "blobs": [{ "file": "jobs.artifacts/<sha256>.blob", "sha256": "…", "bytes": 1 }], "exported_at_ms": 0 }The export stages its snapshot beside the ledger under training-ledgers/apps/<app>/, never inside app storage. It refuses a destination that is, contains or lies inside a training ledger folder of this device, and a destination that already holds a jobs.sqlite without a ledger.json beside it.
Import Training Ledger reads such a folder when its database and blobs together fit in maximum_bytes, 2 GiB by default and at most 16 GiB. Every project in it must belong to this app and to the chosen scope: a private snapshot holds only …:user projects and a shared one none. The import checks every size and sha256 and the database’s integrity, then installs it in the training-ledgers layout without replacing anything. Before downloading the database or blobs, it refuses when the target scope already has a jobs.sqlite, even an empty one, its -journal, -wal or -shm file, or jobs.artifacts, and names that path; for the shared scope it also refuses while the app still has an older in-place ledger. On a new machine, import before any node that records data runs there, because those nodes create the ledger.
Import Model moves a single model instead. It registers a published burn or sam2 model, for example one exported from another app, as a pretrained source for fine-tuning, feature extraction and SAM 2. Other engines are refused. Without private: true, it refuses a model read from the executing user’s storage, and a model whose manifest records a private ledger unless the source names app storage explicitly: storage set to app, or a files manifest in app storage. Its weights may have up to maximum_bytes, 512 MiB by default and at most 2 GiB. The new source gets its own pretrained:<uuid> ID, and the published model’s ID is kept in origin.published.id.
Offline device placements receive storage/models, and the selected user’s models in users/local, when they are first set up. Each later revision adds the model folders and experiment pointers the device lacks. It replaces a learning or deployment pointer only with one of strictly greater order, so models the device trained itself stay in charge. Folders are verified against their manifests first, a pointer is applied only when its model is on the device, and nothing is deleted. Online device placements read models through their cloud access and cache the files of model folders as immutable.
Where each runtime trains and predicts
Section titled “Where each runtime trains and predicts”| Runtime | Trains | Publishes to | Predicts from |
|---|---|---|---|
| Desktop, offline app | Yes | App and user storage on this computer | The ledger, otherwise published files |
| Desktop, online app with a hub connection | Yes, with the ledgers on this computer | Cloud storage, then a local copy | The ledger, otherwise published files |
| Desktop, online app without a hub connection | No | – | Published files in the local cache |
| Offline device placement | Yes | The placement’s storage | The ledger, otherwise published files |
| Online device placement | No | – | Published files through the placement’s cloud access |
| AWS Lambda and ECS, Kubernetes, local and Docker Compose executors | No | – | Published files, with Burn on the CPU |
| Azure and GCP executors, mobile apps | No | – | Nothing in this version; the nodes are hidden |
Training nodes need a live run with local app storage; shadow and replay runs never write a ledger. Elsewhere they fail with a message that names the runtimes that train and the nodes that still run published models. Prediction nodes in a build without ML inference fail with a message that names the builds that include it.
Executors serve models within their container’s memory. Inference clamps compute.memory_limit_bytes to three quarters of the limit detected from cgroup v2 memory.max, cgroup v1 memory.limit_in_bytes or, on AWS Lambda, AWS_LAMBDA_FUNCTION_MEMORY_SIZE. A process caches at most eight loaded trained models, reserving four times each model’s size within half the detected memory, or 4 GiB when no limit is detected. Burn, EfficientAD and SAM 2 unpack model files into /tmp, which is 512 MB on Lambda by default, so give functions that run models above about 200 MB more ephemeral storage. SAM 2 is slow on executor CPUs.
Build features
Section titled “Build features”flow-like-catalog-ml has two features for this. inference loads published models with Burn on the CPU and needs no ledger. training adds the ledger, training and publication, and includes inference. In flow-like-catalog, ml-inference enables inference together with the node metadata, and training-cpu and training-auto include it. The server-local-ml, executor-local-ml and local-runtime-ml bundles use ml-inference without GPU crates, so the AWS, Kubernetes, local and Docker Compose executors predict but never train. The server bundle of the Azure and GCP executors and the mobile bundles include neither. Desktop builds and standalone releases include training-auto. The AI/ML/Export nodes, and Predict Published Model and Extract Published Image Features in AI/ML/Inference, appear wherever the training metadata does; Export Student to ONNX also needs training-onnx-export. The other AI/ML/Inference nodes are pure and appear in every build with the ML catalog.