Skip to main content

effbelt — the LLM efficiency toolbelt

Six small, honest tools that save money and catch silent bugs — all runnable on a laptop with no GPU and no API key. Four of them need nothing but Python; two can optionally measure real numbers on a tiny local model.

pip install effbelt            # the four pure tools
pip install "effbelt[hf]"      # + quantcheck tensors and live modelcard
tool one line needs a model?
fit will this model fit on my card? (weights + KV cache + overhead) no
tokenwaste where your LLM API bill leaks (duplicate prompts, retries, oversized model) no
evalsanity is your benchmark lying? (contamination, degenerate data/preds) no
quantcheck did your quantization actually do anything? (silent no-op guard) tensors only
cheapest the cheapest config that still clears your quality bar your eval
modelcard one-page quant tradeoff card (exact memory + measured ppl) optional

Every number here was produced on an Apple-silicon MacBook, offline. Nothing is invented.


Why trust the memory math? It matches a real cache to the byte.

fit's KV-cache formula is cross-checked in the test suite against the real measured bytes of a live Hugging Face cache (via the sister project kvquant):

KV formula check: analytic 180.0KB vs measured 180.0KB at seq=10 (0.00% off)

fit — stop guessing at OOM

$ effbelt fit llama-3.1-70b --gpu rtx-4090 --seq 8192
llama-3.1-70b  @  seq=8192 batch=1  weights=fp16 kv=fp16
  weights   131.50 GB
  kv cache    2.50 GB   (8 kv-heads GQA)
  overhead    1.00 GB
  --------  135.00 GB total
  DOES NOT FIT on a 24 GB card  (headroom -111.00 GB)
$ effbelt fit llama-3.1-8b --gpu rtx-4090 --seq 32768 --kv int8
  ... FITS on a 24 GB card  (headroom +6.04 GB)

Use --hf <repo> to pull authoritative dimensions straight from a model's config.

tokenwaste — audit an API request log (JSONL)

$ effbelt tokenwaste requests.jsonl
22 requests, ~$0.0780 total (prices as of 2026-10)
  recoverable up to ~$0.0780 (<= 100% of bill; levers below can overlap):
  - oversized-model   ~$0.0718  large model, <=20 output tok -> try a small model
  - over-long-context ~$0.0300  context over 8000 tok
  - no-prefix-cache   ~$0.0183  22x identical system prompt (~290 tok)
  - retries           ~$0.0013  requests marked retry=true

The levers overlap on the same request, so the headline is an honest upper bound capped at 100% of the bill — never a made-up "save 300%".

evalsanity — before you believe a leaderboard number

$ effbelt evalsanity eval.json
41 test items: 2 flag(s)
  [HIGH] 1/41 test items appear VERBATIM in train -> contamination
  [MED ] labels 93% one class ('A') -> imbalanced
  -> at least one HIGH flag: do NOT trust this number yet.

quantcheck — the silent no-op killer

The lesson behind kvquant, generalized to any tensor transform you think quantizes. A no-op (e.g. you mutated a non-persisting view) passes every smoke test and moves no metric — quantcheck proves it bit, estimates effective bits, and flags the two classic bugs:

from effbelt import quantcheck
r = quantcheck.check(my_quant_fn, some_tensor, claimed_bits=8)
print(r.report())
# quantcheck: SILENT NO-OP   <- if your "quantizer" changed nothing
# quantcheck: SUSPICIOUS     <- not idempotent / coarser than claimed
# quantcheck: OK

modelcard — know the tradeoff before you quantize

Exact memory arithmetic, and measured quality when you point it at a model:

$ effbelt modelcard gemma-3-270m --seq 8192 --live google/gemma-3-270m-it
  kv dtype   kv cache  vs fp16   quality
  fp16         0.14GB    1.00x   +0.00% ppl
  int8         0.07GB    2.00x   -0.33% ppl     <- free: 2x smaller, lossless
  int4         0.04GB    4.00x  +68.41% ppl     <- breaks on this small model
  quality measured on google/gemma-3-270m-it (160 tok, MPS/CPU)

cheapest — smallest model that still passes

from effbelt import cheapest
res = cheapest.sweep([
    cheapest.Candidate("7b-int4",  cost=1, quality_fn=lambda: my_eval("7b-int4")),
    cheapest.Candidate("7b-fp16",  cost=2, quality_fn=lambda: my_eval("7b-fp16")),
    cheapest.Candidate("70b-int4", cost=8, quality_fn=lambda: my_eval("70b-int4")),
], bar=0.80)
print(res.report())   # -> use the cheapest one that clears 0.80

Honest scope

  • Prices and the small model table are approximate and editable (see effbelt/models.py); for authoritative model dims use fit --hf.
  • quantcheck's effective-bit estimate is advisory at small group sizes — the silent-no-op and idempotency checks are the reliable ones.
  • modelcard quality numbers are measured only when you pass --live; otherwise the quality column is left blank. We don't fill it with guesses.

Tests

All validation runs on a laptop, offline:

python -m pytest tests/ -v      # 18 tests, incl. the real-cache cross-check

Support

Free and MIT. If it saved you a GPU or a bill, consider sponsoring: https://github.com/sponsors/SRKRZ23

Crypto (receive-only):

  • BTC bc1q9hm4upksmvkzhl8z3zvxgz94da358qfe3tred0
  • ETH / Polygon / USDT-ERC20 0xa9e3b63799f5E5cc6258042D45869a5a1d39F021
  • USDT-TRC20 TUyNkMXme1CYAc1wZ8SZ64X9upBc9nwTZ5
  • SOL j8zZCsWwM8WmUZwMSDHikNuz6E49Vn8nwo9FMQnHSoW

Sister project: kvquant — the engine behind quantcheck and modelcard.

Metadata

Release files for effbelt 0.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 effbelt 0.1.0
File Size Uploaded Provenance Actions
effbelt-0.1.0.tar.gz 22.2 kB Without provenance Details for effbelt-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for effbelt 0.1.0
File Interpreter ABI Platform Actions
effbelt-0.1.0-py3-none-any.whl Python 3 none any Details for effbelt-0.1.0-py3-none-any.whl

Total release size: 42.0 kB

Release files / effbelt-0.1.0.tar.gz

Download URL effbelt-0.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
88c48e787b0b2ec277f6e3ba6d04f97af8ff8e08f8d0da6fd62e04f3e4ace983
BLAKE2b-256 checksum
How to use checksums
db65b384f49cb13f145645972ae908910f922061c44ca7229bea271bad09af78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / effbelt-0.1.0-py3-none-any.whl

Download URL effbelt-0.1.0-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9028b64e2c5e3e5b2fc66de82d343dc9af2f690111e7a877210484ba31f3e637
BLAKE2b-256 checksum
How to use checksums
befc6e2440a2992c218cd8c872632b7a0ea9872228399aa98946a9e2881f197f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for effbelt 0.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

0.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