ShinMegamiBoson/lookatmyquant

A quantization compiler that delivers 12× lower KL than Q4_K_M at the same file size

What it solves

Large AI models are too big to run on many devices. Compressing them usually ruins quality, because it treats all parts of the model the same way. LookAtMyQuant solves this by measuring exactly how much damage compression does to each piece of the model, then allocating the available size budget to the pieces that matter most. This lets you put a model that originally needed 53.7 GB into a 7.2 GB file while still solving as many math problems as the original, or shrink a 26.4B-parameter model from 18.89 GB to 12.76 GB while matching the original on every tested benchmark.

How it works

First, the compiler measures each stored component (like a row of weights) by compressing it alone and checking how far the model's outputs drift from the uncompressed original (measured as KL divergence). These measurements feed an allocation step that chooses a compression code – from simple Lloyd–Max quantizers to trellis codes – for each piece so that the whole model fits a target size with the least total damage. For the largest models, the recipe adds a fine-tuning step that distills the model back toward its original behavior, re-quantizing each layer against the original weights. The README also shows that a small "drafter" model can be added to speed up generation: the drafter proposes several next tokens, the main model checks them in one pass, and only matching tokens are kept, making generation 1.5–2× faster on Apple silicon without changing the output.

Who it’s for

Developers and researchers who want to run large language models on laptops, edge devices, or servers with limited memory – especially Apple silicon users, since the project includes a ready-made runtime. It’s also for anyone working on model compression who wants a principled, sensitivity-based alternative to one-size-fits-all quantization.

Highlights

  • Uses measured damage (KL) per component to allocate bits, not just uniform or heuristic schemes.
  • Supports multiple compression formats: trellis codes, hashed block-vector codes, and native NVFP4 passthrough.
  • Includes a complete Apple silicon runtime (lamq command) for generation, chat, and streaming, with optional speculative decoding via a compact "drafter" model.
  • Achieves 100% of the original model’s benchmark performance in a 32.5% smaller file (Inkling-2-Mini 12.8 GB vs 18.89 GB teacher).
  • Open source under the MIT license, with reproducible recipes and cost breakdowns (e.g., $34 of GPU time for the Qwen3.5-4B 1.2 GB build).

Related

  • Project
  • Project
  • Project
  • Project