GGUF Inspector
Drop a .gguf model file — or all the shards of a split one — and read
everything the container tells you about the model inside: architecture, total parameter count,
declared quantization and the actual per-tensor quantization mix, context length, tokenizer
details including the chat template, and a searchable listing of every tensor with its shape,
type and exact byte size. It works on files from llama.cpp, Ollama, LM Studio or Hugging
Face, including multi-part models, and it never uploads anything: the whole analysis runs on
your own machine.
Model
Parameters by component
| Component | Tensors | Parameters | Share |
|---|
Quantization mix
Exact byte sizes come from each tensor’s offset in the file, so this is what is actually stored — not what the filename claims.
| Type | Tensors | Parameters | Bytes | Bits/weight | Share |
|---|
Tokenizer
Chat template (Jinja)
Tensors
| # | Name | Shape | Type | Parameters | Bytes | Bits/weight |
|---|
All metadata
| Key | Type | Value |
|---|
How the GGUF Inspector works
A GGUF file is a single self-contained container with four sections, laid out back to back:
a fixed header, a block of key–value metadata, an array of tensor descriptors, and then
the weight data itself. The header starts with the magic bytes GGUF, a format
version (2 or 3), the tensor count and the number of metadata pairs. Every metadata value is
typed — integer, float, string, boolean or array — so a reader never has to guess
what it is looking at. Each tensor descriptor carries the tensor’s name, its dimensions,
its storage type (F16, Q4_K, Q8_0 and so on) and the byte offset where its data begins.
file = [ header ][ metadata key/value pairs ][ tensor descriptors ]
+ padding to alignment + [ tensor data ... ]
header: magic "GGUF" | version u32 | tensor_count u64 | kv_count u64
descriptor: name (string) | n_dims u32 | dims[n] u64 | type u32 | offset u64
The inspector reads the file into browser memory with a DataView and walks only
the first two sections — typically the first few megabytes of a multi-gigabyte file.
Parameter counts are summed from the tensor dimensions, and each tensor’s exact byte
size is derived from the distance between its offset and the next tensor’s offset, which
is why the quantization mix table reports what is actually stored rather than a
nominal bits-per-weight estimate. Version 3 files can be big-endian (for POWER and s390x
hosts); the tool detects the byte order from the magic number and parses both. Because the
analysis is pure JavaScript over local bytes, it works identically offline and on any
platform your browser runs on.
How to use the GGUF Inspector
- Choose your file(s). Click the drop zone or drag files onto it. For a split model, select every shard —
model-Q4_K_M-00001-of-00003.gguf,…-00002-of-00003.gguf,…-00003-of-00003.gguf— and the inspector merges them into one report. - Read the Model panel. Architecture, total parameters, declared quantization, layers, embedding size, attention heads, context length and vocabulary come from the file’s own metadata. Where a value is not declared in the file (context length often isn’t), the panel says so instead of guessing.
- Check the quantization mix. The per-type table shows exactly how many bytes live in each storage format. A “Q4_K_M” file typically holds most weights in Q4_K, attention K/V in Q6_K and embeddings in F16 — the mix is the real answer to “how quantized is this?”
- Search the tensor listing. Filter by name (e.g.
blk.12.attn_q) or sort by size to find the heaviest tensors. The per-tensor bits/weight column flags outliers such as an F16 embedding inside a 4-bit file. - Export when you need it. Copy a plain-text summary for a ticket or chat, download the full JSON report (metadata plus every tensor with computed sizes) for scripting, or copy the suggested
llama-servercommand with the declared context length filled in.
Worked example: Llama 3.1 8B Instruct (Q4_K_M)
Take Llama-3.1-8B-Instruct-Q4_K_M.gguf, the single-file ~4.9 GB download you
get from Hugging Face. The inspector reports:
- Architecture:
llama, 32 blocks, embedding length 4096, 32 attention heads with 8 KV heads (grouped-query attention), vocabulary 128,256. - Parameters: 8.03 billion in total — about 1.05 billion in the embedding and output head (128,256 × 4096 each), ~1.34 billion across the attention projections and ~5.6 billion in the feed-forward networks.
- Quantization mix: most of the file is Q4_K (the “_M” middle variant of the K-quants), the attention K/V tensors are stored at higher precision, and the embedding sits in F16. Effective size works out to roughly 4.9 bits per weight: 4.9 GB × 8 ÷ 8.03 billion.
- Tensors: 290 descriptors — nine per block (two layer norms, four attention projections, three feed-forward matrices) times 32 blocks, plus the token embedding and output head.
Now compare it with the same model exported at F16: identical 8.03 billion parameters, but a ~16 GB file. The parameter count never changes between quantizations — only the bytes per weight do — which is exactly the distinction the two panels above keep separate.
Split models and multi-shard files
Models too large for a single file are written as a set of shards that share one header: every shard repeats the full metadata, but each carries only a slice of the tensors. Inspect just the first shard and you will see the right model name and architecture, yet only a fraction of the parameters and tensors — a common source of confusion when someone reports “my 70B model only has 9B parameters”. Select all shards at once and the inspector sums parameter counts across them, merges the tensor listing (with a shard column so you can see which file holds each weight) and adds the file sizes for a true total. If two shards disagree about the architecture or vocabulary, the status line flags it.
Common mistakes when reading GGUF files
- Trusting the filename over the tensor mix. Quantization labels describe the dominant format, not every tensor. Attention K/V is routinely kept at Q6_K or F16, embeddings often stay F16, and mixed-quant conversions can differ from file to file. The per-type byte table is the ground truth.
- Inspecting only shard one of a split model. Parameter counts and tensor listings are per-shard; the totals you want are sums across all parts. Always select every shard.
- Equating parameter count with file size. An 8B model is ~16 GB at F16 and ~4.9 GB at Q4_K_M — same parameters, different bits per weight. File size questions belong to the quantization mix; capacity questions belong to the parameter count.
- Assuming the context length is in the file. Many converters never write
n_ctx, so a missing value means “not declared”, not “small”. Check the model card or base-model metadata before you conclude anything about the window size. - Running an old GGUF v1 file. Version 1 predates the current reader support and llama.cpp no longer loads it either. Re-convert from the original weights with a current converter instead of trying to patch the file.
- Hand-calculating tensor sizes without alignment. Tensor data is padded to the file’s global alignment, so “elements × nominal bytes” drifts from reality. The inspector uses the actual offsets between descriptors, which already include the padding.
- Missing big-endian files. GGUF v3 can be written big-endian for POWER/s390x hosts. Tools that hard-code little-endian parsing produce garbage or “bad magic” errors on those files; this inspector detects the byte order from the header and reads both.
Related tools
If you are setting up a local LLM, these pair well with the inspector:
Suggested
Luke Keam | techgeek.biz