Skip to main content

Module loader

Module loader 

Source
Expand description

IMF v1 zip loading: manifest parse + sha256 member verification (interscript-models/runtime/src/interscript_ml/loader.py parity, SPEC.md §3).

Conformance points implemented here:

  • C3 — every .onnx member is verified against the manifest sha256 map on load; members not covered by the manifest MUST NOT load.
  • §3 — rejects any other format, any tokenizer other than bytes, and missing required members (metadata.yaml, encoder.onnx, decoder.onnx).
  • Zip-level integrity is never trusted (the manifest decides).

Structs§

ArtifactGraphs
A loaded, checksum-verified artifact: the manifest plus the verified ONNX graphs keyed by member name.
Manifest
metadata.yaml as parsed from the artifact (Manifest dataclass parity).

Enums§

DecoderMode
decoder: plain | kv — kv iff decoder-kv.onnx is present.

Functions§

load_manifest
Parse metadata.yaml from the artifact zip and enforce the §3 format contract (load_manifest parity).
sha256_file
Whole-artifact sha256 (streaming; SPEC.md C2 — cache hits are re-verified, never trusted blindly).
verify_and_read
Load and verify every .onnx member of an IMF v1 zip.