gguf-fit
Zero-download GGUF v2/v3 header inspector, exact KV-cache & VRAM fit calculator, local LLM runtime doctor (Ollama, llama-server, vLLM), stdio MCP server, and GitHub Action.
Pure Python 3.10+ standard library — zero runtime dependencies, zero telemetry.
Why gguf-fit?
Running local coding and agent models fails in three predictable ways:
- 32k–128k context OOM surprises — a 7B/32B model fits at 4k context, then blows past VRAM once real coding-agent context kicks in.
- Silent Ollama truncation & CPU spill — Ollama defaults to
num_ctx 2048/4096(silently dropping prompts) or silently spills layers to host RAM (size_vram < size) with a 4–8× decode collapse. - Guessing launch flags — manually calculating
-ngl,-c,-ctk/-ctv,--max-model-len, and KV cache quantization across GQA, MHA, DeepSeek MLA, Gemma 2/3 SWA, and MoE models.
gguf-fit reads only the binary GGUF header via HTTP Range requests (typically 256 KiB, fast-skipping 150k+ token vocab arrays without decoding strings), aggregates multi-shard files automatically, probes your real GPU or Apple Silicon / Strix Halo unified memory, and emits exact copy-paste launch commands.
Quick Start
Run directly without installing via uvx, or install with pip:
uvx gguf-fit unsloth/Qwen2.5-Coder-7B-Instruct-GGUF --ctx 32k --kv q8_0
pip install gguf-fit
Common CLI Workflows
# Inspect all quantizations in a Hugging Face repo against an M4 Pro 48 GB
gguf-fit unsloth/Qwen3-30B-A3B-GGUF --gpu m4-pro-48g --ctx 64k --all-quants
# Inspect a local .gguf file (auto-aggregates multi-shard siblings)
gguf-fit ./DeepSeek-R1-Distill-Qwen-32B-Q4_K_M.gguf --ctx 32k --kv q8_0
# Generate paste-ready Markdown for GitHub PRs, HF Discussions, or r/LocalLLaMA
gguf-fit unsloth/Qwen2.5-Coder-7B-Instruct-GGUF --gpu rtx-4090 --ctx 64k --markdown
# Machine-readable JSON output
gguf-fit unsloth/Qwen2.5-Coder-7B-Instruct-GGUF --json
# Probe local hardware & list built-in --gpu presets
gguf-fit hardware --list-presets
gguf-fit doctor — Audit Local Runtimes (Localhost Only)
Connects strictly to 127.0.0.1 / localhost (1.5s timeout, zero external calls) to audit running Ollama, llama-server, and vLLM instances:
gguf-fit doctor
Detects:
- Silent
num_ctxtruncation in Ollama (/api/ps+/api/show) and emits a copyableModelfile+ollama createfix. - Silent partial CPU spill (
size_vram < size) with exact GiB spilled to RAM. - Unquantized
f16KV cache with ready-to-runOLLAMA_FLASH_ATTENTION=1andOLLAMA_KV_CACHE_TYPE=q8_0commands. llama-serverslot-split context traps (/props+/slots) and vLLMmax_model_lenKV pre-allocation warnings.
MCP Server (dev.nodebudget/gguf-fit)
gguf-fit ships a pure-stdlib stdio JSON-RPC 2.0 MCP server exposing 3 lean tools (< 600 total schema tokens):
inspect_model_fit— zero-download GGUF/HF inspection, VRAM/KV breakdown,-ngl,tok/s, and launch flagsdetect_local_hardware— Apple Silicon / NVIDIA / AMD ROCm Strix Halo / CPU probeaudit_local_llm_runtime— localhost Ollama /llama-server/ vLLM runtime audit
Claude Code
claude mcp add gguf-fit -- uvx gguf-fit --mcp
Cursor / VS Code / Claude Desktop
{
"mcpServers": {
"gguf-fit": {
"command": "uvx",
"args": ["gguf-fit", "--mcp"]
}
}
}
GitHub Action
Validate local LLM model targets in CI and upsert a single <!-- gguf-fit-report --> PR comment:
name: Local LLM Fit Check
on: [pull_request]
permissions:
contents: read
pull-requests: write
jobs:
gguf-fit:
runs-on: ubuntu-latest
steps:
- uses: a895047059/gguf-fit@v1
with:
model: unsloth/Qwen2.5-Coder-7B-Instruct-GGUF
gpu: rtx-4090
ctx: "32768"
kv: q8_0
all-quants: "true"
comment-pr: "true"
fail-on-oom: "false"
Set comment-pr: "false" to write only to the GitHub Job Summary without commenting on PRs (only contents: read required).
Companion Browser Extension
Want inline FITS / TIGHT / OOM badges and 1-click launch commands directly inside Hugging Face /tree/main file tables and Ollama library pages?
- Local LLM VRAM & GGUF Fit Checker (Chrome Web Store & Firefox Add-ons) — shares the exact same GGUF binary header parser and KV-cache math engine.
- Source: nodebudget-chrome-extension
Architecture & Methodology
- Binary GGUF v2/v3 parser: Incremental HTTP
Rangereads (256 KiB->1 MiB->2 MiB->4 MiB), fast-skippingtokenizer.*arrays by byte offset without decoding vocab strings, plusconfig.json/ safetensors fallback. - Exact KV-cache equations: Supports MHA, GQA, DeepSeek MLA (
kv_lora_rank + qk_rope_head_dim), Gemma 2/3 & Mistral Sliding Window Attention (sliding_window), and MoE active-parameter memory-bandwidth decode estimation (CUDA/Metal/ROCm/CPU). - Interactive web calculator & methodology: Local LLM VRAM & Mini PC Fit Checker and Local LLM vs Cloud GPU Break-Even Guide.
License
MIT
Metadata
Release files for gguf-fit 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gguf_fit-1.0.0.tar.gz | 44.1 kB | Without provenance | Details for gguf_fit-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gguf_fit-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for gguf_fit-1.0.0-py3-none-any.whl |
Total release size: 81.3 kB
Release files / gguf_fit-1.0.0.tar.gz
| Download URL | gguf_fit-1.0.0.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c51bded6896e1855f023a93d70241e6a0a512d744b5e7399ab58a6263af12623
|
|
BLAKE2b-256 checksum How to use checksums |
cc34d2bcb2e7cef3c059523f13f5079d3a9e2881527215a0f1f80f4486695b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gguf_fit-1.0.0-py3-none-any.whl
| Download URL | gguf_fit-1.0.0-py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
558208dc74f1634e3bb9be061afdb8e9a4d3daa2397806d9054d2b7ac57e40de
|
|
BLAKE2b-256 checksum How to use checksums |
aee8f3f52f2cc0e6ad15869d2bc115e0ba21f9ff1778fef13f116a47dea5651f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gguf-fit 1.0.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.