One tensor

The array inside the file

Every container on this site is a different wrapper around the same idea: one named array, stored so another program can read it back.

Name

A string. A .npy file has one array and no name. A container such as safetensors or GGUF gives every tensor a name, often with dots for the layer it came from.

Dtype

Which kind of number is stored: float32, bfloat16, an integer, or a block of quantized weights. The file’s own name for that dtype is usually different. The dtype table lines them up.

Shape

The length of each dimension, outermost first. A matrix NumPy would call (rows, cols) is written that way here. GGUF lists dimensions in the opposite order, so a reader reverses them.

Bytes

Little-endian, packed with no gaps, one row after another. Narrow types such as 4-bit values share a byte. Quantized block types store a fixed-size block along the innermost dimension.

A container is the file around those tensors: a header, the names, and usually a little metadata. See the containers.

One set of arrays

The same arrays in the specs test vector. A file is listed only when that array was read back out of it.

NameDtypeShapeRead back from
w_f32float324 × 64safetensors, npz, npy, gguf, raw-sidecar
b_f16float168safetensors, npz, gguf, raw-sidecar
e_bf16bfloat162 × 3safetensors, npz, gguf, raw-sidecar
i_i32int323 × 2safetensors, npz, gguf, raw-sidecar, text-csv-tsv-json
s_f32float32[]safetensors, npz, raw-sidecar

Nick Reynolds · @goldnode · nicks.net · rev 0.1