quantprobe 1.14.1__tar.gz → 1.17.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantprobe-1.14.1/quantprobe.egg-info → quantprobe-1.17.0}/PKG-INFO +2 -2
- {quantprobe-1.14.1 → quantprobe-1.17.0}/README.md +163 -163
- {quantprobe-1.14.1 → quantprobe-1.17.0}/pyproject.toml +31 -31
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/__init__.py +11 -11
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/optimize.py +156 -154
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/plan.py +169 -30
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/spec.py +153 -141
- {quantprobe-1.14.1 → quantprobe-1.17.0/quantprobe.egg-info}/PKG-INFO +2 -2
- {quantprobe-1.14.1 → quantprobe-1.17.0}/LICENSE +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/__main__.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/auto.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/cli.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/dashboard.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/detect.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/fetch.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/probe.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/recipes/mistral-7b.json +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/recipes/qwen2.5-7b.json +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/recipes/qwen3-30b.json +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/recipes/qwen3.5-35b.json +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/recipes.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/runtime.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe/target.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe.egg-info/SOURCES.txt +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe.egg-info/dependency_links.txt +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe.egg-info/entry_points.txt +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe.egg-info/requires.txt +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/quantprobe.egg-info/top_level.txt +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/setup.cfg +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/tests/test_engine.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/tests/test_evaluator.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/tests/test_pipeline.py +0 -0
- {quantprobe-1.14.1 → quantprobe-1.17.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantprobe
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17.0
|
|
4
4
|
Summary: Probe-then-quantize for LLMs: measure a model's fragility curve, plan bit/tier placement by the tiered decode law, and emit ready-to-run llama.cpp recipes.
|
|
5
5
|
Author: Federico Sciuca
|
|
6
6
|
License: MIT
|
|
@@ -118,7 +118,7 @@ Copyability is the whole mechanism: code answers repeat their input, prose inven
|
|
|
118
118
|
## When quantprobe won't help you
|
|
119
119
|
|
|
120
120
|
- **Your model already fits comfortably in VRAM at 4 bits or more.** Community quants are near-lossless there, and — measured — quantizing further buys almost no speed once a model is resident: the same 7B at Q2_K vs Q4_K_M is 36% smaller and **4% slower**. Quantize to make a model *fit*; once it fits, stop.
|
|
121
|
-
- **You want a tight number for a model that fits entirely in VRAM.** This is the placement the law knows least well
|
|
121
|
+
- **You want a tight number for a model that fits entirely in VRAM.** This is the placement the law knows least well, and the ±25% band above does **not** apply to it. We do not have a point prediction for it, and we would rather say so than quote a number wearing a band too wide to mean anything. What we can state is **one-sided and exception-free**: across 8 models and 13 benchmarks, real speed was **≥ 0.90× the printed number every single time**, and in 12 of the 13 it was strictly higher — typically 1.1×–1.8×. That is a falsifiable claim with the same logical form as our ±25% band, just asymmetric: one measurement below 0.90× kills it. We have refuted six candidate explanations for the gap, including our own favourites: it is not fixed overhead, not GPU clock state, not bytes-per-token, not monotone in bit-width, not a per-format constant, and not a bytes-weighted mixture of the actual tensor types. Within a single architecture it moves cleanly with the dominant tensor type; across architectures it does not transfer. We would rather publish that than move a constant on thin evidence. **This is the single most useful thing you can send us:** `quantprobe bench --contribute` on a GPU-resident model turns your machine into the datapoint that fixes it.
|
|
122
122
|
- **You need task-level eval scores** (MMLU, HellaSwag). quantprobe measures perplexity and KL divergence only.
|
|
123
123
|
- **Your architecture isn't in the fragility atlas** (four families so far). The probe still works on your model; the published priors just won't apply. *Open an issue with your result — those are the most valuable datapoints.*
|
|
124
124
|
- **You want multi-token prediction modeled in the planner.** It isn't. Measured, the effect runs from **+17% (dense, GPU-resident) to −24% (MoE, experts in RAM)** — there's no single multiplier to apply. [Full 2×2 →](preregistrations/2026-07-24-law6-speculation-economics.md)
|
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
# quantprobe
|
|
2
|
-
|
|
3
|
-
Predicts how fast an LLM will run on your machine — **before you download it** — then hands you the exact llama.cpp command. If nothing fits well enough, it builds a quantization tuned to your specific model and hardware.
|
|
4
|
-
|
|
5
|
-
[**Quickstart**](#quickstart) · [**Browser version**](https://federicots.github.io/quantprobe/) · [**Commands**](#commands) · [**The laws**](LAWS.md) · [**When it won't help**](#when-quantprobe-wont-help-you)
|
|
6
|
-
|
|
7
|
-
    [](https://x.com/federico_sciuca)
|
|
8
|
-
|
|
9
|
-
## Quickstart
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pip install quantprobe
|
|
13
|
-
quantprobe plan --model qwen3-30b --bits 2.95
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
[quantprobe] no hardware flags: auto-detected this machine (vram 6GB@192 | ram 16GB@48 | disk 0.5 GB/s).
|
|
18
|
-
|
|
19
|
-
quantprobe plan - Qwen3-30B-A3B @ 2.95-bit on THIS machine [auto-detected]
|
|
20
|
-
model 12.4 GB | active 1.67 GB/token | est. quality cost x1.05 (depth-aware recipe)
|
|
21
|
-
|
|
22
|
-
* 18.9 tok/s split experts: 21%->VRAM, rest->RAM
|
|
23
|
-
18.4 tok/s stream from disk (VRAM+RAM expert cache) [needs an expert-caching runtime]
|
|
24
|
-
16.6 tok/s hybrid: attention->VRAM, experts->RAM [RAM boundary - needs --no-mmap]
|
|
25
|
-
3.0 tok/s stream from disk (cold experts) [exceeds RAM - capacity demo]
|
|
26
|
-
|
|
27
|
-
run it: llama-server -m model.gguf -ngl 99 -ot "blk\.(10|11|…|47)\.ffn_.*_exps\.=CPU" --no-mmap
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Downloads nothing. Takes a second.** No hardware flags needed — it reads your machine. `--model` and `--bits` just say what you're considering; point it at a file you already have with `--gguf model.gguf` instead.
|
|
31
|
-
|
|
32
|
-
Want it to do the whole thing for you?
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
quantprobe auto
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Detects your machine, asks which model you want, picks the best quant for it, downloads it, and launches. No flags to learn.
|
|
39
|
-
|
|
40
|
-
## What it does
|
|
41
|
-
|
|
42
|
-
- **Predicts tok/s before you download** — across every placement (all-VRAM, hybrid, expert-split, CPU, disk-stream) and picks the winner.
|
|
43
|
-
- **Emits the exact command**, including the `-ot` regex most guides get wrong.
|
|
44
|
-
- **Finds free speed in what you already have** — [partial expert offload](#free-speed-you-probably-already-have) and [prompt-lookup speculation](#free-speed-part-two-if-you-write-code) need no new download.
|
|
45
|
-
- **Measures which layers of *your* model break** under compression, then builds a quant that protects them.
|
|
46
|
-
- **Tells you when to stop** — it declines the expensive path on machines that don't need it.
|
|
47
|
-
- Runs on stock [llama.cpp](https://github.com/ggml-org/llama.cpp). No custom runtime, nothing to build.
|
|
48
|
-
|
|
49
|
-
## Fast vs Custom
|
|
50
|
-
|
|
51
|
-
| | **Fast** — `quantprobe auto qwen3-30b` | **Custom** — `quantprobe auto qwen3-30b --custom` |
|
|
52
|
-
|---|---|---|
|
|
53
|
-
| what it does | picks the best existing quant for *your* machine, downloads it | measures which layers of *your* model break under compression, then builds a version tailored to it |
|
|
54
|
-
| time | minutes (mostly download) | **~50 min for a 7B, ~10 h for a 35B** — it tells you before starting |
|
|
55
|
-
| disk | one file | source + working files, 3–4× bigger |
|
|
56
|
-
| **speed** | full | **identical** — speed comes from placement, not from the build |
|
|
57
|
-
| **quality** | whatever the community published | **−9% perplexity at the same file size** |
|
|
58
|
-
|
|
59
|
-
**Most people want Fast.** Above ~3 bits per weight, community quants are already near-lossless — so `--custom` refuses to run on machines that don't need it and says why. Reach for Custom when you're squeezing a model that barely fits (under ~3 bits, where ordinary compression falls off a cliff), when you have a fine-tune nobody has published, or when you need maximum quality at a fixed size.
|
|
60
|
-
|
|
61
|
-
## Free speed you probably already have
|
|
62
|
-
|
|
63
|
-
Most guides put *all* of a mixture-of-experts model's experts in system RAM and leave your graphics card half empty. Keeping the first N expert layers on the GPU instead — same file, different flags:
|
|
64
|
-
|
|
65
|
-
| | all experts → RAM | **partial offload** |
|
|
66
|
-
|---|---|---|
|
|
67
|
-
| generation | 18.35 tok/s | **20.62 tok/s** (+12.4%) |
|
|
68
|
-
| prompt reading | 88 tok/s | **~238 tok/s** (2–3×) |
|
|
69
|
-
|
|
70
|
-
`plan` and `run` compute the cutoff from your *free* VRAM and emit the flags.
|
|
71
|
-
|
|
72
|
-
## Free speed, part two: if you write code
|
|
73
|
-
|
|
74
|
-
`--spec-type ngram-simple` drafts tokens by finding repeated spans in your own context, then verifies them — output is **identical**, it's one flag, nothing is downloaded.
|
|
75
|
-
|
|
76
|
-
| workload | off | ngram on | effect |
|
|
77
|
-
|---|---|---|---|
|
|
78
|
-
| **code** (edit a file, answer restates its input) | 17.72 | **37.17** | **2.10× — decode doubles** |
|
|
79
|
-
| prose (open-ended continuation) | 18.46 | 18.56 | 1.01× — nothing |
|
|
80
|
-
| code, but **MoE with experts in RAM** | 18.18 | 18.81 | 1.03× — the union tax eats it |
|
|
81
|
-
|
|
82
|
-
Copyability is the whole mechanism: code answers repeat their input, prose invents. Turn it on for coding work on a **dense** model; skip it otherwise.
|
|
83
|
-
|
|
84
|
-
## Measured results
|
|
85
|
-
|
|
86
|
-
| result | number |
|
|
87
|
-
|---|---|
|
|
88
|
-
| Qwen3-30B-A3B on a 2016 desktop | **19.3 tok/s** |
|
|
89
|
-
| Same model, partial expert offload | **20.62 tok/s** (+12.4%, free) |
|
|
90
|
-
| Same bytes, different layers protected (Gemma 4 12B) | **byte-identical files, 2.25 ppl apart** |
|
|
91
|
-
| Gemma 4 12B depth-aware 2-bit | 1.91× → **1.45×** quality cost, ~4.5 GB resident |
|
|
92
|
-
| GLM-4.5-Air **110B** from a SATA drive, 16 GB RAM | **0.19 tok/s** (capacity demo, not usable inference) |
|
|
93
|
-
| RAM overclock (XMP, 2133→3000) | dense **+52%** |
|
|
94
|
-
|
|
95
|
-
<p align="center"><img src="weights/data/validation_19tok/live_run_20tps.png" width="880" alt="One frame: Task Manager showing 16 GB DDR4-3000 and the GTX 1060 6GB beside llama.cpp chatting Qwen3-30B-A3B live at 20.4 tok/s generation"></p>
|
|
96
|
-
<p align="center"><em>One frame, no cuts: Qwen3-30B-A3B at <b>20.4 tok/s</b> on a 2016 desktop — GTX 1060 6 GB · 16 GB DDR4 · SATA SSD. Raw logs + GGUF SHA256: <a href="weights/data/validation_19tok/EVIDENCE.txt">EVIDENCE.txt</a>.</em></p>
|
|
97
|
-
|
|
98
|
-
**Every number above was written down as a prediction, published, and only then measured** — including the ones that missed. [All predictions and their verdicts →](preregistrations/) · [the four laws behind them →](LAWS.md)
|
|
99
|
-
|
|
100
|
-
## When quantprobe won't help you
|
|
101
|
-
|
|
102
|
-
- **Your model already fits comfortably in VRAM at 4 bits or more.** Community quants are near-lossless there, and — measured — quantizing further buys almost no speed once a model is resident: the same 7B at Q2_K vs Q4_K_M is 36% smaller and **4% slower**. Quantize to make a model *fit*; once it fits, stop.
|
|
103
|
-
- **You want a tight number for a model that fits entirely in VRAM.** This is the placement the law knows least well
|
|
104
|
-
- **You need task-level eval scores** (MMLU, HellaSwag). quantprobe measures perplexity and KL divergence only.
|
|
105
|
-
- **Your architecture isn't in the fragility atlas** (four families so far). The probe still works on your model; the published priors just won't apply. *Open an issue with your result — those are the most valuable datapoints.*
|
|
106
|
-
- **You want multi-token prediction modeled in the planner.** It isn't. Measured, the effect runs from **+17% (dense, GPU-resident) to −24% (MoE, experts in RAM)** — there's no single multiplier to apply. [Full 2×2 →](preregistrations/2026-07-24-law6-speculation-economics.md)
|
|
107
|
-
- **You're on a Mac or a 50-series card.** Those presets are extrapolated, not measured. `quantprobe bench --contribute` turns one into a datapoint.
|
|
108
|
-
- **You need throughput numbers.** Everything here is single-stream decode on one machine; expect ±25% across environments.
|
|
109
|
-
|
|
110
|
-
## Commands
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
quantprobe auto # interactive: detects, asks, decides, runs
|
|
114
|
-
quantprobe plan --gguf model.gguf # predicted tok/s + placement + launch command
|
|
115
|
-
quantprobe hw # what the law sees on THIS machine
|
|
116
|
-
quantprobe run --gguf model.gguf # plan the placement, then launch chat
|
|
117
|
-
quantprobe bench --gguf model.gguf --contribute # predicted vs measured; opt-in datapoint
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
<details>
|
|
121
|
-
<summary>Six more: optimize, target, fetch, quantize, probe, dashboard</summary>
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
quantprobe optimize --tps 20 # cheapest path to a speed target, Pareto-ranked
|
|
125
|
-
quantprobe target --tps 5 --ladder # inverse: target -> smartest model that fits
|
|
126
|
-
quantprobe fetch qwen3-30b ./models # robust, resumable download
|
|
127
|
-
quantprobe quantize --gguf f16.gguf --out 2bit.gguf # build a depth-aware quant
|
|
128
|
-
quantprobe probe --gguf f16.gguf --eval wiki.test.raw # measure YOUR model's fragile band
|
|
129
|
-
quantprobe dashboard --gguf 2bit.gguf # the law live, every reply scored vs prediction
|
|
130
|
-
```
|
|
131
|
-
</details>
|
|
132
|
-
|
|
133
|
-
`hw`/`plan`/`target`/`optimize` need nothing but Python. The weight-touching commands drive stock llama.cpp — point at it with `--llama-dir`, `QUANTPROBE_LLAMA_DIR`, or `PATH`, and preview anything with `--dry`. 17 machine presets ship in (`--machine`); multi-GPU and RAID aggregate with comma lists (`--vram 24,24`).
|
|
134
|
-
|
|
135
|
-
> **Windows: `'quantprobe' is not recognized`?** pip put it in a folder that isn't on your PATH. Use `python -m quantprobe ...` — identical, always works.
|
|
136
|
-
|
|
137
|
-
## Contributing
|
|
138
|
-
|
|
139
|
-
`quantprobe bench --contribute` prints exactly what would be shared plus a pre-filled issue link — **you review and submit; nothing is ever sent automatically.** Points that land *outside* the predicted bands are the most valuable ones, and there are [open predictions](preregistrations/) anyone can settle.
|
|
140
|
-
|
|
141
|
-
## Docs
|
|
142
|
-
|
|
143
|
-
| | |
|
|
144
|
-
|---|---|
|
|
145
|
-
| [QUICKSTART.md](QUICKSTART.md) | get running, three levels; recipes for fine-tunes, coding agents, hardware buying |
|
|
146
|
-
| [LAWS.md](LAWS.md) | the four laws — statements, measurements, falsifiable predictions |
|
|
147
|
-
| [docs/EXAMPLES.md](docs/EXAMPLES.md) | worked examples with real output, including the ×5.4 optimizer A/B |
|
|
148
|
-
| [docs/HARDWARE.md](docs/HARDWARE.md) | the 2016 box: exact specs, measured bandwidths, what the next euro buys |
|
|
149
|
-
| [preregistrations/](preregistrations/) | every staked prediction with its verdict — hits **and** misses |
|
|
150
|
-
| [CONTRIBUTING.md](CONTRIBUTING.md) | the method: stake, measure, score *and wire*, audit |
|
|
151
|
-
| [docs/DEEP-DIVE.md](docs/DEEP-DIVE.md) | what's new vs. built-on, parity tables, and the repository map |
|
|
152
|
-
| [papers/arxiv/](papers/arxiv/) | the paper (submission-ready LaTeX) |
|
|
153
|
-
| [CHANGELOG.md](CHANGELOG.md) | every release, including corrections to numbers published here |
|
|
154
|
-
|
|
155
|
-
## Credits
|
|
156
|
-
|
|
157
|
-
[colibri](https://github.com/JustVugg/colibri) (744B on 25 GB, pure C) inspired the tier-streaming exploration. The quantization stack builds on [llama.cpp](https://github.com/ggml-org/llama.cpp) and the QTIP/QuIP# incoherence codecs — whose central tool our first law bounds. Independent research by Federico Sciuca, AI-supported, on one desktop.
|
|
158
|
-
|
|
159
|
-
Two community contributions changed the tool measurably: **u/RogerAI--fyi** (Reddit) observed that the Law 4 formulation omitted per-token KV reads — measured, confirmed, shipped within a day. **u/MoneroApe** pointed me at [apex-quant](https://github.com/localai-org/apex-quant) and TurboQuant, and testing against **mudler's APEX** exposed two real gaps in my recipe: unprotected always-active tensors (their kurtosis argument, adopted here) and no importance-matrix calibration at all.
|
|
160
|
-
|
|
161
|
-
## License
|
|
162
|
-
|
|
163
|
-
MIT — see [LICENSE](LICENSE). © 2026 Federico Sciuca.
|
|
1
|
+
# quantprobe
|
|
2
|
+
|
|
3
|
+
Predicts how fast an LLM will run on your machine — **before you download it** — then hands you the exact llama.cpp command. If nothing fits well enough, it builds a quantization tuned to your specific model and hardware.
|
|
4
|
+
|
|
5
|
+
[**Quickstart**](#quickstart) · [**Browser version**](https://federicots.github.io/quantprobe/) · [**Commands**](#commands) · [**The laws**](LAWS.md) · [**When it won't help**](#when-quantprobe-wont-help-you)
|
|
6
|
+
|
|
7
|
+
    [](https://x.com/federico_sciuca)
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install quantprobe
|
|
13
|
+
quantprobe plan --model qwen3-30b --bits 2.95
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
[quantprobe] no hardware flags: auto-detected this machine (vram 6GB@192 | ram 16GB@48 | disk 0.5 GB/s).
|
|
18
|
+
|
|
19
|
+
quantprobe plan - Qwen3-30B-A3B @ 2.95-bit on THIS machine [auto-detected]
|
|
20
|
+
model 12.4 GB | active 1.67 GB/token | est. quality cost x1.05 (depth-aware recipe)
|
|
21
|
+
|
|
22
|
+
* 18.9 tok/s split experts: 21%->VRAM, rest->RAM
|
|
23
|
+
18.4 tok/s stream from disk (VRAM+RAM expert cache) [needs an expert-caching runtime]
|
|
24
|
+
16.6 tok/s hybrid: attention->VRAM, experts->RAM [RAM boundary - needs --no-mmap]
|
|
25
|
+
3.0 tok/s stream from disk (cold experts) [exceeds RAM - capacity demo]
|
|
26
|
+
|
|
27
|
+
run it: llama-server -m model.gguf -ngl 99 -ot "blk\.(10|11|…|47)\.ffn_.*_exps\.=CPU" --no-mmap
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Downloads nothing. Takes a second.** No hardware flags needed — it reads your machine. `--model` and `--bits` just say what you're considering; point it at a file you already have with `--gguf model.gguf` instead.
|
|
31
|
+
|
|
32
|
+
Want it to do the whole thing for you?
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
quantprobe auto
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Detects your machine, asks which model you want, picks the best quant for it, downloads it, and launches. No flags to learn.
|
|
39
|
+
|
|
40
|
+
## What it does
|
|
41
|
+
|
|
42
|
+
- **Predicts tok/s before you download** — across every placement (all-VRAM, hybrid, expert-split, CPU, disk-stream) and picks the winner.
|
|
43
|
+
- **Emits the exact command**, including the `-ot` regex most guides get wrong.
|
|
44
|
+
- **Finds free speed in what you already have** — [partial expert offload](#free-speed-you-probably-already-have) and [prompt-lookup speculation](#free-speed-part-two-if-you-write-code) need no new download.
|
|
45
|
+
- **Measures which layers of *your* model break** under compression, then builds a quant that protects them.
|
|
46
|
+
- **Tells you when to stop** — it declines the expensive path on machines that don't need it.
|
|
47
|
+
- Runs on stock [llama.cpp](https://github.com/ggml-org/llama.cpp). No custom runtime, nothing to build.
|
|
48
|
+
|
|
49
|
+
## Fast vs Custom
|
|
50
|
+
|
|
51
|
+
| | **Fast** — `quantprobe auto qwen3-30b` | **Custom** — `quantprobe auto qwen3-30b --custom` |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| what it does | picks the best existing quant for *your* machine, downloads it | measures which layers of *your* model break under compression, then builds a version tailored to it |
|
|
54
|
+
| time | minutes (mostly download) | **~50 min for a 7B, ~10 h for a 35B** — it tells you before starting |
|
|
55
|
+
| disk | one file | source + working files, 3–4× bigger |
|
|
56
|
+
| **speed** | full | **identical** — speed comes from placement, not from the build |
|
|
57
|
+
| **quality** | whatever the community published | **−9% perplexity at the same file size** |
|
|
58
|
+
|
|
59
|
+
**Most people want Fast.** Above ~3 bits per weight, community quants are already near-lossless — so `--custom` refuses to run on machines that don't need it and says why. Reach for Custom when you're squeezing a model that barely fits (under ~3 bits, where ordinary compression falls off a cliff), when you have a fine-tune nobody has published, or when you need maximum quality at a fixed size.
|
|
60
|
+
|
|
61
|
+
## Free speed you probably already have
|
|
62
|
+
|
|
63
|
+
Most guides put *all* of a mixture-of-experts model's experts in system RAM and leave your graphics card half empty. Keeping the first N expert layers on the GPU instead — same file, different flags:
|
|
64
|
+
|
|
65
|
+
| | all experts → RAM | **partial offload** |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| generation | 18.35 tok/s | **20.62 tok/s** (+12.4%) |
|
|
68
|
+
| prompt reading | 88 tok/s | **~238 tok/s** (2–3×) |
|
|
69
|
+
|
|
70
|
+
`plan` and `run` compute the cutoff from your *free* VRAM and emit the flags.
|
|
71
|
+
|
|
72
|
+
## Free speed, part two: if you write code
|
|
73
|
+
|
|
74
|
+
`--spec-type ngram-simple` drafts tokens by finding repeated spans in your own context, then verifies them — output is **identical**, it's one flag, nothing is downloaded.
|
|
75
|
+
|
|
76
|
+
| workload | off | ngram on | effect |
|
|
77
|
+
|---|---|---|---|
|
|
78
|
+
| **code** (edit a file, answer restates its input) | 17.72 | **37.17** | **2.10× — decode doubles** |
|
|
79
|
+
| prose (open-ended continuation) | 18.46 | 18.56 | 1.01× — nothing |
|
|
80
|
+
| code, but **MoE with experts in RAM** | 18.18 | 18.81 | 1.03× — the union tax eats it |
|
|
81
|
+
|
|
82
|
+
Copyability is the whole mechanism: code answers repeat their input, prose invents. Turn it on for coding work on a **dense** model; skip it otherwise.
|
|
83
|
+
|
|
84
|
+
## Measured results
|
|
85
|
+
|
|
86
|
+
| result | number |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Qwen3-30B-A3B on a 2016 desktop | **19.3 tok/s** |
|
|
89
|
+
| Same model, partial expert offload | **20.62 tok/s** (+12.4%, free) |
|
|
90
|
+
| Same bytes, different layers protected (Gemma 4 12B) | **byte-identical files, 2.25 ppl apart** |
|
|
91
|
+
| Gemma 4 12B depth-aware 2-bit | 1.91× → **1.45×** quality cost, ~4.5 GB resident |
|
|
92
|
+
| GLM-4.5-Air **110B** from a SATA drive, 16 GB RAM | **0.19 tok/s** (capacity demo, not usable inference) |
|
|
93
|
+
| RAM overclock (XMP, 2133→3000) | dense **+52%** |
|
|
94
|
+
|
|
95
|
+
<p align="center"><img src="weights/data/validation_19tok/live_run_20tps.png" width="880" alt="One frame: Task Manager showing 16 GB DDR4-3000 and the GTX 1060 6GB beside llama.cpp chatting Qwen3-30B-A3B live at 20.4 tok/s generation"></p>
|
|
96
|
+
<p align="center"><em>One frame, no cuts: Qwen3-30B-A3B at <b>20.4 tok/s</b> on a 2016 desktop — GTX 1060 6 GB · 16 GB DDR4 · SATA SSD. Raw logs + GGUF SHA256: <a href="weights/data/validation_19tok/EVIDENCE.txt">EVIDENCE.txt</a>.</em></p>
|
|
97
|
+
|
|
98
|
+
**Every number above was written down as a prediction, published, and only then measured** — including the ones that missed. [All predictions and their verdicts →](preregistrations/) · [the four laws behind them →](LAWS.md)
|
|
99
|
+
|
|
100
|
+
## When quantprobe won't help you
|
|
101
|
+
|
|
102
|
+
- **Your model already fits comfortably in VRAM at 4 bits or more.** Community quants are near-lossless there, and — measured — quantizing further buys almost no speed once a model is resident: the same 7B at Q2_K vs Q4_K_M is 36% smaller and **4% slower**. Quantize to make a model *fit*; once it fits, stop.
|
|
103
|
+
- **You want a tight number for a model that fits entirely in VRAM.** This is the placement the law knows least well, and the ±25% band above does **not** apply to it. We do not have a point prediction for it, and we would rather say so than quote a number wearing a band too wide to mean anything. What we can state is **one-sided and exception-free**: across 8 models and 13 benchmarks, real speed was **≥ 0.90× the printed number every single time**, and in 12 of the 13 it was strictly higher — typically 1.1×–1.8×. That is a falsifiable claim with the same logical form as our ±25% band, just asymmetric: one measurement below 0.90× kills it. We have refuted six candidate explanations for the gap, including our own favourites: it is not fixed overhead, not GPU clock state, not bytes-per-token, not monotone in bit-width, not a per-format constant, and not a bytes-weighted mixture of the actual tensor types. Within a single architecture it moves cleanly with the dominant tensor type; across architectures it does not transfer. We would rather publish that than move a constant on thin evidence. **This is the single most useful thing you can send us:** `quantprobe bench --contribute` on a GPU-resident model turns your machine into the datapoint that fixes it.
|
|
104
|
+
- **You need task-level eval scores** (MMLU, HellaSwag). quantprobe measures perplexity and KL divergence only.
|
|
105
|
+
- **Your architecture isn't in the fragility atlas** (four families so far). The probe still works on your model; the published priors just won't apply. *Open an issue with your result — those are the most valuable datapoints.*
|
|
106
|
+
- **You want multi-token prediction modeled in the planner.** It isn't. Measured, the effect runs from **+17% (dense, GPU-resident) to −24% (MoE, experts in RAM)** — there's no single multiplier to apply. [Full 2×2 →](preregistrations/2026-07-24-law6-speculation-economics.md)
|
|
107
|
+
- **You're on a Mac or a 50-series card.** Those presets are extrapolated, not measured. `quantprobe bench --contribute` turns one into a datapoint.
|
|
108
|
+
- **You need throughput numbers.** Everything here is single-stream decode on one machine; expect ±25% across environments.
|
|
109
|
+
|
|
110
|
+
## Commands
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
quantprobe auto # interactive: detects, asks, decides, runs
|
|
114
|
+
quantprobe plan --gguf model.gguf # predicted tok/s + placement + launch command
|
|
115
|
+
quantprobe hw # what the law sees on THIS machine
|
|
116
|
+
quantprobe run --gguf model.gguf # plan the placement, then launch chat
|
|
117
|
+
quantprobe bench --gguf model.gguf --contribute # predicted vs measured; opt-in datapoint
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
<details>
|
|
121
|
+
<summary>Six more: optimize, target, fetch, quantize, probe, dashboard</summary>
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
quantprobe optimize --tps 20 # cheapest path to a speed target, Pareto-ranked
|
|
125
|
+
quantprobe target --tps 5 --ladder # inverse: target -> smartest model that fits
|
|
126
|
+
quantprobe fetch qwen3-30b ./models # robust, resumable download
|
|
127
|
+
quantprobe quantize --gguf f16.gguf --out 2bit.gguf # build a depth-aware quant
|
|
128
|
+
quantprobe probe --gguf f16.gguf --eval wiki.test.raw # measure YOUR model's fragile band
|
|
129
|
+
quantprobe dashboard --gguf 2bit.gguf # the law live, every reply scored vs prediction
|
|
130
|
+
```
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
`hw`/`plan`/`target`/`optimize` need nothing but Python. The weight-touching commands drive stock llama.cpp — point at it with `--llama-dir`, `QUANTPROBE_LLAMA_DIR`, or `PATH`, and preview anything with `--dry`. 17 machine presets ship in (`--machine`); multi-GPU and RAID aggregate with comma lists (`--vram 24,24`).
|
|
134
|
+
|
|
135
|
+
> **Windows: `'quantprobe' is not recognized`?** pip put it in a folder that isn't on your PATH. Use `python -m quantprobe ...` — identical, always works.
|
|
136
|
+
|
|
137
|
+
## Contributing
|
|
138
|
+
|
|
139
|
+
`quantprobe bench --contribute` prints exactly what would be shared plus a pre-filled issue link — **you review and submit; nothing is ever sent automatically.** Points that land *outside* the predicted bands are the most valuable ones, and there are [open predictions](preregistrations/) anyone can settle.
|
|
140
|
+
|
|
141
|
+
## Docs
|
|
142
|
+
|
|
143
|
+
| | |
|
|
144
|
+
|---|---|
|
|
145
|
+
| [QUICKSTART.md](QUICKSTART.md) | get running, three levels; recipes for fine-tunes, coding agents, hardware buying |
|
|
146
|
+
| [LAWS.md](LAWS.md) | the four laws — statements, measurements, falsifiable predictions |
|
|
147
|
+
| [docs/EXAMPLES.md](docs/EXAMPLES.md) | worked examples with real output, including the ×5.4 optimizer A/B |
|
|
148
|
+
| [docs/HARDWARE.md](docs/HARDWARE.md) | the 2016 box: exact specs, measured bandwidths, what the next euro buys |
|
|
149
|
+
| [preregistrations/](preregistrations/) | every staked prediction with its verdict — hits **and** misses |
|
|
150
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | the method: stake, measure, score *and wire*, audit |
|
|
151
|
+
| [docs/DEEP-DIVE.md](docs/DEEP-DIVE.md) | what's new vs. built-on, parity tables, and the repository map |
|
|
152
|
+
| [papers/arxiv/](papers/arxiv/) | the paper (submission-ready LaTeX) |
|
|
153
|
+
| [CHANGELOG.md](CHANGELOG.md) | every release, including corrections to numbers published here |
|
|
154
|
+
|
|
155
|
+
## Credits
|
|
156
|
+
|
|
157
|
+
[colibri](https://github.com/JustVugg/colibri) (744B on 25 GB, pure C) inspired the tier-streaming exploration. The quantization stack builds on [llama.cpp](https://github.com/ggml-org/llama.cpp) and the QTIP/QuIP# incoherence codecs — whose central tool our first law bounds. Independent research by Federico Sciuca, AI-supported, on one desktop.
|
|
158
|
+
|
|
159
|
+
Two community contributions changed the tool measurably: **u/RogerAI--fyi** (Reddit) observed that the Law 4 formulation omitted per-token KV reads — measured, confirmed, shipped within a day. **u/MoneroApe** pointed me at [apex-quant](https://github.com/localai-org/apex-quant) and TurboQuant, and testing against **mudler's APEX** exposed two real gaps in my recipe: unprotected always-active tensors (their kurtosis argument, adopted here) and no importance-matrix calibration at all.
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT — see [LICENSE](LICENSE). © 2026 Federico Sciuca.
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=68"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "quantprobe"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "Probe-then-quantize for LLMs: measure a model's fragility curve, plan bit/tier placement by the tiered decode law, and emit ready-to-run llama.cpp recipes."
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
license = { text = "MIT" }
|
|
11
|
-
authors = [{ name = "Federico Sciuca" }]
|
|
12
|
-
requires-python = ">=3.9"
|
|
13
|
-
dependencies = ["gguf>=0.9", "requests>=2.28"]
|
|
14
|
-
keywords = ["llm", "quantization", "llama.cpp", "gguf", "inference", "moe"]
|
|
15
|
-
classifiers = [
|
|
16
|
-
"License :: OSI Approved :: MIT License",
|
|
17
|
-
"Programming Language :: Python :: 3",
|
|
18
|
-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
[project.urls]
|
|
22
|
-
Homepage = "https://github.com/FedericoTs/quantprobe"
|
|
23
|
-
|
|
24
|
-
[project.scripts]
|
|
25
|
-
quantprobe = "quantprobe.cli:main"
|
|
26
|
-
|
|
27
|
-
[tool.setuptools]
|
|
28
|
-
packages = ["quantprobe"]
|
|
29
|
-
|
|
30
|
-
[tool.setuptools.package-data]
|
|
31
|
-
quantprobe = ["recipes/*.json"]
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "quantprobe"
|
|
7
|
+
version = "1.17.0"
|
|
8
|
+
description = "Probe-then-quantize for LLMs: measure a model's fragility curve, plan bit/tier placement by the tiered decode law, and emit ready-to-run llama.cpp recipes."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [{ name = "Federico Sciuca" }]
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
dependencies = ["gguf>=0.9", "requests>=2.28"]
|
|
14
|
+
keywords = ["llm", "quantization", "llama.cpp", "gguf", "inference", "moe"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/FedericoTs/quantprobe"
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
quantprobe = "quantprobe.cli:main"
|
|
26
|
+
|
|
27
|
+
[tool.setuptools]
|
|
28
|
+
packages = ["quantprobe"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.package-data]
|
|
31
|
+
quantprobe = ["recipes/*.json"]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"""quantprobe - probe-then-quantize for LLMs on commodity hardware.
|
|
2
|
-
|
|
3
|
-
Three commands, all grounded in measured laws (see LAWS.md in the repo):
|
|
4
|
-
quantprobe probe - measure a GGUF's depth-fragility curve, emit the depth-aware recipe (Law 3)
|
|
5
|
-
quantprobe plan - evaluate every bit/tier placement for a model on your machine, predict tok/s (Law 4)
|
|
6
|
-
quantprobe fetch - robust HuggingFace downloader (Range-resume, retry)
|
|
7
|
-
|
|
8
|
-
Every constant in `plan` is fitted from measurements published in the repo, including two
|
|
9
|
-
pre-registered hardware predictions confirmed within 8%.
|
|
10
|
-
"""
|
|
11
|
-
__version__ = "1.
|
|
1
|
+
"""quantprobe - probe-then-quantize for LLMs on commodity hardware.
|
|
2
|
+
|
|
3
|
+
Three commands, all grounded in measured laws (see LAWS.md in the repo):
|
|
4
|
+
quantprobe probe - measure a GGUF's depth-fragility curve, emit the depth-aware recipe (Law 3)
|
|
5
|
+
quantprobe plan - evaluate every bit/tier placement for a model on your machine, predict tok/s (Law 4)
|
|
6
|
+
quantprobe fetch - robust HuggingFace downloader (Range-resume, retry)
|
|
7
|
+
|
|
8
|
+
Every constant in `plan` is fitted from measurements published in the repo, including two
|
|
9
|
+
pre-registered hardware predictions confirmed within 8%.
|
|
10
|
+
"""
|
|
11
|
+
__version__ = "1.17.0"
|