Skip to main content
An artifact is a directory the runtime can load. Training produces it and export_artifact writes the part the runtime needs.

Directory layout

khaos.manifest.Manifest

A dataclass describing an artifact. The meta of a trained artifact carries what is needed to use it. For example, chem_logp stores target_mean and target_std (multiply the output by the standard deviation and add the mean), the SMILES tokenizer_vocab, and the maximum length. robo_failure_detection stores its calibrated alarm_threshold.

khaos.export.export_artifact

Exports a PyTorch model to out_dir as model.onnx plus manifest.json, and returns the directory.
torch.nn.Module
required
A model from khaos.<domain>.models, or any module that declares the attributes below.
str
required
The artifact name. The domain is looked up in khaos.registry.ARTIFACTS.
str
default:"v1"
Release label written to the manifest.
dict
Extra entries merged into manifest.meta.
int
default:"17"
ONNX opset used for the export.
The export reads these attributes from the model: The manifest always records architecture, inputs and outputs in meta.
See Bringing your own weights for the full training handoff.