Skip to main content

Module pack

Module pack 

Source
Expand description

Single-file artifact format for modelc.

Format layout (version 2):

  • Magic: “MODELC” (6 bytes)
  • Version: u32 LE (4 bytes)
  • Flags: u32 LE (4 bytes) — bit 0 = zstd compressed data blob
  • Header length: u64 LE (8 bytes)
  • Header JSON (header_length bytes)
  • Tensor data blob (concatenated raw or zstd-compressed bytes)

Structs§

ArtifactHeader
ArtifactTensor

Functions§

export_to_safetensors
Export a .modelc artifact to a Safetensors file.
pack
Pack a Model into a .modelc artifact file with optional compression.
read_header
Read only the JSON header from a .modelc artifact without loading tensor data.
unpack
Unpack a .modelc artifact file into a Model.
verify
Verify a .modelc artifact file integrity without fully unpacking tensors.