Skip to content

v0.2.0

Latest

Choose a tag to compare

@PaytonWebber PaytonWebber released this 12 Jun 01:06
v0.2.0
ed5b443

Added

  • Zero-copy model loading: the matrix points into the file or embedded bytes when alignment allows (little-endian targets). Load on potion-base-8M drops 36 -> 21 ms (f32), and @embedFile consumers stop paying RSS for a second copy of the matrix.
  • tq4 files carry a tq4_version metadata field; the reader rejects unknown versions.
  • The safetensors parser is fuzzed: a randomized harness runs on every zig build test, plus a zig build test --fuzz entry point.

Changed (breaking)

  • safetensors.parse takes an options argument and Matrix slices are const.
  • Model.loadFromBytes borrows the safetensors bytes, which must outlive the Model.
  • tq4 files written by 0.1.0 are rejected; re-run m2v-quantize --tq4.

Fixed

  • Three parser overflow bugs against crafted files: a wrapped header-length bounds check (crash), wrap-prone tensor offset checks, and an overflowing shape product that could hand out a matrix backed by no data.

Full details in CHANGELOG.md. Requires Zig 0.16.0.