This document records the loader format decisions for the supported local file boundaries.
LIS supports a narrow safetensors subset:
- local single-file path sources
- 8-byte little-endian header length
- JSON object header with top-level tensor entries
- tensor fields:
dtype,shape, anddata_offsets - ignored
__metadata__object - supported dtypes:
F32,F16,BF16,I32, andU32 - supported shapes: rank 1 through
LIS_TENSOR_MAX_RANK, nonzero dimensions, contiguous byte-size validation through tensor helpers - data offsets relative to the safetensors data section after the JSON header
Unsupported safetensors cases return explicit status values such as LIS_STATUS_FORMAT, LIS_STATUS_UNSUPPORTED_DTYPE, LIS_STATUS_UNSUPPORTED_SHAPE, LIS_STATUS_SHAPE_MISMATCH, or LIS_STATUS_IO.
Tensor names are accepted as simple unescaped JSON strings. Llama 3.x weight-name semantic validation is deferred until model mapping work defines the exact required tensor table.
The precision policy does not change safetensors parsing: F16 and BF16
bytes remain native in loaded tensor views. For HuggingFace-local Llama imports,
the later mapping layer requires every mapped weight tensor to match
config.weight_dtype; mixed per-tensor dtype artifacts are documented
unsupported scope and are not normalized by the loader.
LIS includes a narrow in-memory Llama-style JSON config parser. It maps the
minimal fields needed by lis_model_metadata:
model_typenum_hidden_layershidden_sizeintermediate_sizenum_attention_headsnum_key_value_headshead_dimvocab_sizerope_thetatorch_dtypemax_position_embeddings
The parser accepts model_type values llama and llama3 as the initial Llama-style decoder-only boundary, but only for plain RoPE configs that use rope_theta. Configs containing rope_scaling or a non-default rope_type are rejected with LIS_STATUS_UNSUPPORTED because LIS does not implement those RoPE variants. GPT-2, Mistral, and GPT-OSS config parsing remain unsupported extension paths.
LIS does not implement PyTorch checkpoint loading or broad .pt, .pth, or
.bin compatibility. Those paths are detected as
LIS_MODEL_FORMAT_PYTORCH_UNSUPPORTED and return
LIS_STATUS_UNSUPPORTED_FORMAT.
Future PyTorch-exported compatibility must define a specific export path, tensor naming convention, dtype scope, and comparison tests before implementation. The current implementation contains no PyTorch comparison cases or parity claims.
Save support is deferred. LIS implements no canonical save, safetensors save, or PyTorch-compatible export path.
Future save work must first choose and document one explicit semantic:
- LIS canonical internal format save
- limited safetensors save
- limited PyTorch-compatible export