Skip to main content

khaos.load

Resolves an artifact and returns its pipeline.
str
required
A registered artifact name such as pde_darcy_flow_2d, or the path to a local artifact directory containing a manifest.json.
bool
default:"True"
Download the artifact from the Hugging Face Hub when it is not in the local cache. With False, a missing artifact raises FileNotFoundError.

khaos.registry

The repositories are public and need no token, for example fletxcher/khaos-chem_logp. Each holds model.onnx, manifest.json, the model card and, for text models, a tokenizer/ folder.

khaos.pipeline

BasePipeline

A loaded artifact. Call it on raw input to get a result.

OnnxPipeline

A BasePipeline backed by an ONNX Runtime session.

Input and result for each artifact

Every artifact is a registered OnnxPipeline: call it on the input below. Normalization is inside the model, so raw physical or sensor values are fine. Over HTTP the same input goes in the input field as JSON, with arrays as nested lists. A list of SMILES returns a list of results. Input that does not fit raises ValueError (HTTP 422). The chemistry pipelines need khaos-ml[chem], the finance and entity-dedupe ones need transformers, and a mesh file path needs khaos-ml[3d].

Writing your own pipeline

A custom pipeline looks like this:

ModalityProcessor

An abstract class with a single preprocess(raw) method, for turning raw domain input into model-ready tensors. Domain adapters implement it.