Skip to main content
Install the training extra to use these: pip install "khaos-ml[train]".

khaos.modeling

build

Builds the default architecture of any artifact. Keyword arguments override the defaults. It imports only the artifact’s own domain package.
Raises KeyError for an unknown artifact.

Spec and build_from

Each domain keeps a khaos.<domain>.models.ARCHITECTURES dict of Specs and exposes its own build(artifact, **overrides), which calls build_from.

Architectures

Defaults for every artifact. Trained artifacts record the settings they actually used in manifest.json; for example the chemistry models use the vocabulary size of their tokenizer. For the inputs and outputs of each model, see Model architectures.

Classes by domain

Each khaos.<domain>.models package also exports the model classes, ARCHITECTURES, build and export_artifact.

Normalization wrappers

Trained physics and robotics artifacts wrap the network so serving takes raw values:

khaos.layers

Transformer parts that keep batch size and sequence length dynamic when exported to ONNX. torch.nn.MultiheadAttention bakes the traced sequence length into the graph; these do not.