Skip to main content

GRIT — Grouped Reduced-precision Interchange Type

A Q4_K blob and an MXFP4 blob are both "4-bit weights", but their decodes differ, their layouts differ, and nothing at the file boundary says so. GRIT makes that contract explicit: a 64-byte descriptor that can be checked against the bytes in O(1), fingerprinted, and diffed field-by-field when two artifacts disagree.

Start here: audit files you already have

grit scan requires zero adoption by any framework. Point it at safetensors or GGUF files, or at a directory tree:

grit-scan [--deep] [--json] PATH...

It recovers descriptors from a __grit__ safetensors header key or grit.desc.<tensor> GGUF KV entries (inferring them from well-known ggml block structs otherwise) and reports descriptor-vs-bytes violations, cross-file gid disagreements with field-by-field diffs, grade-drift clusters, and NOTE_ASSUMED escape-hatch exposure.

Exit codes: 0 clean, 1 structural violation, 2 disagreement, 3 warnings only, 4 unparseable.

The explicit contract fields

A GRIT array is a quadruple (Grade, Placement, Planes, Shape):

  • Grade — the complete numeric contract: element format, group sizes, scale formats, zero-point convention, sparsity, rounding and saturation promises. It has one canonical string form and a derived 64-bit id (gid).
  • Placement — the physical layout, carried as a 64-bit value, never a type parameter. New silicon means a new constant, not a new type.
  • Planes — up to four byte buffers: data, scale0, scale1, aux.
  • Shape — rank and extents, carried in the view.

The core guarantee: equal gid and equal plane bytes implies bit-identical decode() on every conformant implementation — and the descriptor check never has undefined behaviour, even on adversarial 64-byte input. gid certifies decode agreement and nothing else: not calibration quality, not provenance, not trustworthiness.

This package

Pure Python, standard library only; numpy is an optional extra used by grit.to_array() and is never imported at module scope. It is one of five independent implementations (C, C++, Rust, Python, TypeScript) that pass a shared 68-entry conformance vector suite generated by the executable reference, and that agree bit-for-bit on cross-language gid values.

The normative specification, the reference implementation, and the vector suite live in the project repository.

Licensed under Apache-2.0.

Metadata

Release files for grit-datatype 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grit-datatype 1.1.0
File Size Uploaded Provenance Actions
grit_datatype-1.1.0.tar.gz 75.3 kB Without provenance Details for grit_datatype-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for grit-datatype 1.1.0
File Interpreter ABI Platform Actions
grit_datatype-1.1.0-py3-none-any.whl Python 3 none any Details for grit_datatype-1.1.0-py3-none-any.whl

Total release size: 136.6 kB

Release files / grit_datatype-1.1.0.tar.gz

Download URL grit_datatype-1.1.0.tar.gz
Size 75.3 kB
Tags Source
SHA-256 checksum
How to use checksums
995fee070bfe0d762262d82245ecabdc019a5b8f5e62566ec65d1d350ded5e37
BLAKE2b-256 checksum
How to use checksums
fd623365616c7f2c5b9627b5542d47100e5692caf3e2dedb054033cfc4d7d9c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / grit_datatype-1.1.0-py3-none-any.whl

Download URL grit_datatype-1.1.0-py3-none-any.whl
Size 61.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b4b374a200b7cf5dd6838c7d97dfdd7f0a2af2e7f0fa2dbcaad66abdc8a3b14
BLAKE2b-256 checksum
How to use checksums
7aeb0886c69f177b52237047e5dc12c9758cc31b704b5eecec627bdb08e7a888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for grit-datatype 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page