quantfit
Quantize an LLM — and check it still refuses what it should. Quantization makes a model cheaper to serve and can quietly strip safety behavior; a 4-bit model that answers what the full-precision model refused is a regression no perplexity number will show you.
quantfit verify-safety --demoProbe set
40 curated prompts: some to refuse, some to answer
Generate
the unquantized baseline and the quantized model
Judge
refusal or compliance, by a local classifier
Two axes
refusal-robustness drift and over-refusal drift
Verdict
bounded by a Wilson 95% CI, never absolute
Safety drift is a vector, not a number
verify-safety generates from both the unquantized baseline and the quantized model over a curated probe set, judges each response with a local classifier, and reports two axes: refusal-robustness drift (did the quant start complying with what should be refused — the dangerous direction) and over-refusal drift (did it start refusing what should be answered — the usability direction). A scalar refusal-delta can read zero while both axes move in opposite directions. Verdicts are bounded, never absolute: a no-detection result bounds the drift, it does not certify safety.
Features
- 01
Method × scheme matrix
AWQ, GPTQ, SmoothQuant, FP8, and RTN through one llm-compressor backend (vLLM-loadable), plus GGUF via llama.cpp. Schemes span W4A16 through NVFP4 and MXFP4.
- 02
Honest capacity, up front
check reads HuggingFace metadata without downloading and sorts the job into fits-VRAM, fits-RAM-via-sequential-onloading, or refuse — naming the real limit. No OOM twenty minutes into a run.
- 03
Built to be checked
Reports follow a written spec (QSR), reproduce decides whether one run reproduces another, and audit holds the documentation to the code — exit code 3 when they drift apart.
- 04
Gate either axis, on your own probes
gate takes a threshold per axis, so over-refusal can block a release as well as lost refusals; a threshold sets the drift the run must be able to detect, not a ceiling on the observed rate. verify-safety can also run a pinned Hugging Face dataset of up to 4,096 prompts in place of the default 40, and reports label it noncanonical rather than borrowing the default set’s detectability.
Commands
26 commands. Full flags and output samples live in the README.
verify-safetydid quantization break refusals? two-axis drift
checkwill it fit? read from HF metadata, no download
planwhat config a heuristic would pick, and why
quantizerun the quantization across the method matrix
verifysmoke-load a quantized artifact; bounded GGUF structure checks
probeper-bit-width quantization sensitivity
inspect-runa paired baseline-versus-quant run through Inspect
inspect-recoverrestore a completed Inspect run’s aggregate offline
probesbundle a private probe population, offline
cold-runthree fresh, uncached native GGUF replicates
gatepre-release CI check, per axis, that refuses to pass on thin evidence
screenrun a target set to QSR spec
screen-summaryper-stratum, per-axis bounds from a saved screen, offline
screen-comparecompare two saved screens over the same targets, offline
resolutionwhat a report can resolve, given the judge’s calibration
repeatabilitydoes a full report agree with its replicates
t0do three same-environment replicates agree
reproducedecide whether one report reproduces another
referencesverify reference artifacts byte for byte
bundleportable aggregate evidence, packed into one verifiable file
evidencefetch approved, immutable public aggregates
audithold the docs to the code — exit 3 on drift
emitrender any drift report as a model card
listthe supported method × scheme matrix
calibratejudge calibration: blinded sheets, labels, judge comparisons
adjudicatea person’s explicit flip-by-flip rulings; nothing confirmed automatically
Evidence
Each capability traces to the measurements behind it. These are the published reports, not a summary of them.
| Capability | What it rests on | Reports |
|---|---|---|
| Quantization erodes alignment | The finding the tool exists to operationalize: alignment behavior degrades under quantization in ways quality metrics do not surface. | TR134 |
| Quality is not a safety proxy | The quality-safety divergence work — and the refusal-threat index behind the judging methodology — established that a good perplexity number tells you nothing about preserved refusals. | TR142 |
What it does not do
The limits the tool states about itself.
- It ships transparent config help, not auto-quantization: you pass --method. Learned routing exists as published research but is explicitly out of scope.
- At over-VRAM sizes use gptq — AWQ’s grid search is transfer-bound under sequential onloading.
- FP4 schemes need Blackwell to serve, though quantfit can produce them anywhere.
- The default probe set is 40 curated prompts; a no-detection result bounds drift rather than certifying safety.