quantprobe 1.22.0__tar.gz → 1.23.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.
Files changed (35) hide show
  1. {quantprobe-1.22.0/quantprobe.egg-info → quantprobe-1.23.0}/PKG-INFO +3 -1
  2. {quantprobe-1.22.0 → quantprobe-1.23.0}/README.md +2 -0
  3. {quantprobe-1.22.0 → quantprobe-1.23.0}/pyproject.toml +1 -1
  4. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/__init__.py +1 -1
  5. quantprobe-1.23.0/quantprobe/branding.py +76 -0
  6. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/cli.py +6 -1
  7. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/plan.py +40 -6
  8. {quantprobe-1.22.0 → quantprobe-1.23.0/quantprobe.egg-info}/PKG-INFO +3 -1
  9. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe.egg-info/SOURCES.txt +1 -0
  10. {quantprobe-1.22.0 → quantprobe-1.23.0}/LICENSE +0 -0
  11. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/__main__.py +0 -0
  12. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/auto.py +0 -0
  13. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/calibrate.py +0 -0
  14. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/dashboard.py +0 -0
  15. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/detect.py +0 -0
  16. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/fetch.py +0 -0
  17. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/optimize.py +0 -0
  18. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/probe.py +0 -0
  19. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/recipes/mistral-7b.json +0 -0
  20. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/recipes/qwen2.5-7b.json +0 -0
  21. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/recipes/qwen3-30b.json +0 -0
  22. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/recipes/qwen3.5-35b.json +0 -0
  23. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/recipes.py +0 -0
  24. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/runtime.py +0 -0
  25. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/spec.py +0 -0
  26. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe/target.py +0 -0
  27. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe.egg-info/dependency_links.txt +0 -0
  28. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe.egg-info/entry_points.txt +0 -0
  29. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe.egg-info/requires.txt +0 -0
  30. {quantprobe-1.22.0 → quantprobe-1.23.0}/quantprobe.egg-info/top_level.txt +0 -0
  31. {quantprobe-1.22.0 → quantprobe-1.23.0}/setup.cfg +0 -0
  32. {quantprobe-1.22.0 → quantprobe-1.23.0}/tests/test_engine.py +0 -0
  33. {quantprobe-1.22.0 → quantprobe-1.23.0}/tests/test_evaluator.py +0 -0
  34. {quantprobe-1.22.0 → quantprobe-1.23.0}/tests/test_pipeline.py +0 -0
  35. {quantprobe-1.22.0 → quantprobe-1.23.0}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.22.0
3
+ Version: 1.23.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
@@ -16,6 +16,8 @@ Requires-Dist: gguf>=0.9
16
16
  Requires-Dist: requests>=2.28
17
17
  Dynamic: license-file
18
18
 
19
+ <img src="assets/quantprobe-icon.svg" width="88" align="left" alt="quantprobe — the Q is a gauge">
20
+
19
21
  # quantprobe
20
22
 
21
23
  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.
@@ -1,3 +1,5 @@
1
+ <img src="assets/quantprobe-icon.svg" width="88" align="left" alt="quantprobe — the Q is a gauge">
2
+
1
3
  # quantprobe
2
4
 
3
5
  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,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantprobe"
7
- version = "1.22.0"
7
+ version = "1.23.0"
8
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
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -8,4 +8,4 @@ Three commands, all grounded in measured laws (see LAWS.md in the repo):
8
8
  Every constant in `plan` is fitted from measurements published in the repo, including two
9
9
  pre-registered hardware predictions confirmed within 8%.
10
10
  """
11
- __version__ = "1.22.0"
11
+ __version__ = "1.23.0"
@@ -0,0 +1,76 @@
1
+ """The quantprobe mark: a Q that is a gauge - the dial is the Q's circle, the needle its tail.
2
+ One 12x12 pixel bitmap is the single source of truth: assets/quantprobe-icon.svg is generated
3
+ from it (python -m quantprobe.branding > assets/quantprobe-icon.svg), and the terminal banner
4
+ renders the same pixels as ANSI half-blocks. Old-style pixel art on purpose."""
5
+ import os
6
+ import sys
7
+
8
+ # '.' = background, 'o' = dial (teal), 'X' = needle/hub (white)
9
+ PIXELS = [
10
+ "...oooooo...",
11
+ "..oo....oo..",
12
+ ".oo......oo.",
13
+ ".o........o.",
14
+ "oo........oo",
15
+ "o....XX....o",
16
+ "o....XX....o",
17
+ "oo.....X....",
18
+ ".o......X...",
19
+ ".oo......X..",
20
+ "..oo......X.",
21
+ "...ooo.....X",
22
+ ]
23
+ BG, DIAL, NEEDLE = (20, 24, 31), (20, 184, 166), (230, 255, 250)
24
+
25
+
26
+ def icon_svg(px=10, pad=4):
27
+ w = len(PIXELS[0]) * px + 2 * pad
28
+ out = ['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 %d %d" ' % (w, w)
29
+ + 'shape-rendering="crispEdges" role="img" aria-label="quantprobe">',
30
+ ' <rect width="%d" height="%d" rx="%d" fill="#14181f"/>' % (w, w, 2 * px)]
31
+ for y, row in enumerate(PIXELS):
32
+ for x, c in enumerate(row):
33
+ if c == '.':
34
+ continue
35
+ color = "#14b8a6" if c == 'o' else "#e6fffa"
36
+ out.append(' <rect x="%d" y="%d" width="%d" height="%d" fill="%s"/>'
37
+ % (pad + x * px, pad + y * px, px, px, color))
38
+ out.append('</svg>')
39
+ return "\n".join(out) + "\n"
40
+
41
+
42
+ def _rgb(c):
43
+ return {'.': BG, 'o': DIAL, 'X': NEEDLE}[c]
44
+
45
+
46
+ def icon_ansi():
47
+ """The same pixels as truecolor half-blocks, 12 wide x 6 lines tall."""
48
+ lines = []
49
+ for y in range(0, len(PIXELS), 2):
50
+ top, bot = PIXELS[y], PIXELS[y + 1]
51
+ line = []
52
+ for t, b in zip(top, bot):
53
+ (tr, tg, tb), (br, bg_, bb) = _rgb(t), _rgb(b)
54
+ line.append("\x1b[38;2;%d;%d;%dm\x1b[48;2;%d;%d;%dm▀" % (tr, tg, tb, br, bg_, bb))
55
+ lines.append("".join(line) + "\x1b[0m")
56
+ return "\n".join(lines)
57
+
58
+
59
+ def banner(version=""):
60
+ """Icon + wordmark for the CLI header. Plain-text fallback off-tty / NO_COLOR / dumb terms."""
61
+ plain = not sys.stdout.isatty() or os.environ.get("NO_COLOR") or os.environ.get("TERM") == "dumb"
62
+ if not plain:
63
+ try: # legacy Windows consoles (cp1252) cannot encode the blocks
64
+ "▀".encode(sys.stdout.encoding or "utf-8")
65
+ except (UnicodeEncodeError, LookupError):
66
+ plain = True
67
+ if plain:
68
+ return f"quantprobe {version} - placement beats budget"
69
+ art = icon_ansi().split("\n")
70
+ text = ["", " quantprobe " + version, " placement beats budget",
71
+ " predictions before downloads", "", ""]
72
+ return "\n".join(a + t for a, t in zip(art, text))
73
+
74
+
75
+ if __name__ == "__main__":
76
+ sys.stdout.write(icon_svg())
@@ -15,7 +15,7 @@ def main():
15
15
  prog="quantprobe",
16
16
  description="Probe-then-quantize for LLMs: fragility curves, placement plans, recipes. "
17
17
  "Laws + evidence: github.com/FedericoTs/quantprobe")
18
- sub = ap.add_subparsers(dest="cmd", required=True)
18
+ sub = ap.add_subparsers(dest="cmd") # not required: bare `quantprobe` shows the banner + help
19
19
 
20
20
  p = sub.add_parser("probe", help="measure a GGUF's depth-fragility curve, emit the recipe (Law 3)")
21
21
  p.add_argument("--gguf", required=True, help="f16/bf16 (or high-precision) source GGUF")
@@ -131,6 +131,11 @@ def main():
131
131
  f.add_argument("--force", action="store_true", help="re-download even if a same-named file exists (a stale local file with the same name once fed an incompatible draft model to llama-speculative - three crashed runs before the collision was spotted)")
132
132
 
133
133
  a = ap.parse_args()
134
+ if a.cmd is None:
135
+ from . import branding, __version__
136
+ print(branding.banner("v" + __version__))
137
+ ap.print_help()
138
+ return
134
139
  if a.cmd == "probe":
135
140
  from . import probe
136
141
  probe.run(a)
@@ -350,7 +350,32 @@ def effective_n_layer(args=None, model=None):
350
350
  return None
351
351
 
352
352
 
353
- def moe_split_flags(frac, n_layer):
353
+ # U-23 (E-08, a 32 GB box whose 20 GB working set left 330 MiB free): --no-mmap buys measured
354
+ # speed but makes the model's pages NON-EVICTABLE. On a RAM-tight box that is an OOM risk under
355
+ # desktop load, and the reporter was right to override us. Keep mmap when the host share leaves
356
+ # less than this much RAM free, and say which way the trade went either way.
357
+ # Threshold on the SAME basis as the pinning warning above it (share of the post-reserve pool),
358
+ # deliberately NOT a second absolute reserve - stacking one on `ra` would repeat the double-count
359
+ # #62 removed. 0.75 keeps --no-mmap on every configuration this box has measured (the flagship
360
+ # split holds ~58% of the pool and gained +13.7% from it) and drops it only where the placement
361
+ # dominates RAM, which is E-08's regime.
362
+ MMAP_HOST_SHARE_CAP = 0.75
363
+
364
+
365
+ def mmap_decision(host_gb, ram_gb):
366
+ """(use_no_mmap, note). host_gb = how much this placement holds in RAM."""
367
+ if not ram_gb or (host_gb or 0) <= ram_gb * MMAP_HOST_SHARE_CAP:
368
+ return True, None
369
+ return False, (f"keeping mmap: this placement holds ~{host_gb:.0f}GB of your ~{ram_gb:.0f}GB "
370
+ f"usable RAM ({host_gb / ram_gb:.0%}) - with --no-mmap those pages are NOT "
371
+ f"evictable and the box can OOM under desktop load (U-23, reported by a user "
372
+ f"whose 32GB machine was left with 330 MiB free). The trade: mmap gives up the "
373
+ f"measured +13.7% decode that --no-mmap buys on this placement. Add it back "
374
+ f"yourself if you can free the RAM - and check actual free memory, not just "
375
+ f"the model size, since the mapped file counts too.")
376
+
377
+
378
+ def moe_split_flags(frac, n_layer, host_gb=None, ram_gb=None):
354
379
  """-ot regex placing the FIRST ceil(frac*L) layers' experts on GPU, the rest on CPU.
355
380
  Measured 2026-07-26 (pre-registration #13, corrected): +12.4% decode and ~2-3x prefill
356
381
  on a 6 GB card, against a properly configured baseline.
@@ -360,9 +385,10 @@ def moe_split_flags(frac, n_layer):
360
385
  k = max(1, min(n_layer - 1, int(frac * n_layer)))
361
386
  # --no-mmap for the same reason the all-experts row carries it: llama.cpp itself warns that
362
387
  # tensor overrides to CPU with mmap enabled cost performance. Measured 2026-07-26 on this
363
- # split placement: 16.45 tok/s with mmap vs 18.70 without (+13.7%).
364
- return ('-ngl 99 -ot "blk\\.(%s)\\.ffn_.*_exps\\.=CPU" --no-mmap'
365
- % "|".join(str(i) for i in range(k, n_layer)))
388
+ # split placement: 16.45 tok/s with mmap vs 18.70 without (+13.7%). Gated by U-23 above.
389
+ use_nm = True if host_gb is None or ram_gb is None else mmap_decision(host_gb, ram_gb)[0]
390
+ return ('-ngl 99 -ot "blk\\.(%s)\\.ffn_.*_exps\\.=CPU"%s'
391
+ % ("|".join(str(i) for i in range(k, n_layer)), " --no-mmap" if use_nm else ""))
366
392
 
367
393
 
368
394
  def fits_in_vram_advice(placement, bits):
@@ -399,7 +425,12 @@ def fits_in_vram_advice(placement, bits):
399
425
  "explanations refuted). What we can state is one-sided and has no exceptions: in 13 of "
400
426
  "13 benchmarks real speed was >= 0.90x this number, and in 12 of 13 it was HIGHER, "
401
427
  "typically 1.1x-1.8x. Read it as a floor, not a ceiling - a single measurement below "
402
- "0.90x would falsify this and we ask for exactly that measurement below.")
428
+ "0.90x would falsify this and we ask for exactly that measurement below. "
429
+ "The spread is NOT our old GPU: 61 public benchmarks across 8 architectures "
430
+ "(hopper/ada/blackwell/ampere/apple/rdna3/rdna4/intel-xe) span efficiency "
431
+ "0.51-0.81 on one basis - a 1.6x spread that our own card sits INSIDE - so no "
432
+ "per-architecture constant can replace this floor (prereg #72, L-18). Only a "
433
+ "measurement of YOUR box collapses it: `quantprobe calibrate` does that in ~5 min.")
403
434
  if bits < 4.5:
404
435
  note += (" It also already fits, and going lower-bit buys almost nothing: the same 7B at "
405
436
  "Q2_K vs Q4_K_M is 36% smaller and 4% SLOWER (19.17 vs 20.03 tok/s). Quantize "
@@ -660,7 +691,7 @@ def evaluate(t, a, ne, moe, bits, vc, vb, rc, rb, db, geta, act_scale=1.0, gl=No
660
691
  if f > 0.05 and ram_left <= ra:
661
692
  t_split = (act_ne / (geta * vb) + f * act_ex / (geta * vb)
662
693
  + (1 - f) * act_ex / (eta_r * rb) + kv_gb / (ETA_KV * vb))
663
- fl = moe_split_flags(f, n_layer)
694
+ fl = moe_split_flags(f, n_layer, host_gb=ram_left, ram_gb=ra)
664
695
  # Only offer it if we can emit the EXACT command. Advertising a speed the
665
696
  # printed flags cannot deliver is the v1.6.5 bug class; without a layer count
666
697
  # the row is suppressed and the footer tells the user how to unlock it.
@@ -668,6 +699,9 @@ def evaluate(t, a, ne, moe, bits, vc, vb, rc, rb, db, geta, act_scale=1.0, gl=No
668
699
  pin_warn = ((f"pins {ram_left:.0f}GB of {ra:.0f}GB RAM (CUDA host memory) - "
669
700
  "fails under memory pressure; if it does, drop -ot and let "
670
701
  "auto-placement decide") if ram_left > ra * 0.45 else None)
702
+ mm_note = mmap_decision(ram_left, ra)[1]
703
+ if mm_note:
704
+ pin_warn = f"{pin_warn}; {mm_note}" if pin_warn else mm_note
671
705
  out.append((f"split experts: {f:.0%}->VRAM, rest->RAM", 1 / t_split, pin_warn, fl))
672
706
  if (not moe) and vc > 0 and size + kv_gb > vc * 0.90 and size + kv_gb <= ra + vc * 0.9:
673
707
  # C-11 (prereg #66): the old budget handed the model vc*0.9 outright - no desktop
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.22.0
3
+ Version: 1.23.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
@@ -16,6 +16,8 @@ Requires-Dist: gguf>=0.9
16
16
  Requires-Dist: requests>=2.28
17
17
  Dynamic: license-file
18
18
 
19
+ <img src="assets/quantprobe-icon.svg" width="88" align="left" alt="quantprobe — the Q is a gauge">
20
+
19
21
  # quantprobe
20
22
 
21
23
  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,6 +4,7 @@ pyproject.toml
4
4
  quantprobe/__init__.py
5
5
  quantprobe/__main__.py
6
6
  quantprobe/auto.py
7
+ quantprobe/branding.py
7
8
  quantprobe/calibrate.py
8
9
  quantprobe/cli.py
9
10
  quantprobe/dashboard.py
File without changes
File without changes