DevTools Logo

GGUF Metadata Inspector

GGUF Metadata Inspector

Read a GGUF header, quantization, chat template and tensor list — without loading weights.

Runs in your browser

Only the first 4 MB are read with File.slice; tensor weights are never loaded or uploaded. GGUF v2 and v3 are supported.

Header report

no file loaded

Choose a GGUF file or load the demo

No weights are read and nothing leaves your browser.

Details

The inspector reads only the first slice of a local GGUF file: magic, version, typed key/value metadata and tensor info records. It decodes architecture, file_type quantization, context length and chat-template presence (including tokenizer.chat_template.jinja), lists every tensor with dimensions, ggml type and an estimated byte size, and exports the metadata as JSON or the tensor list as CSV. Bounds-checked parsing produces typed errors for bad magic, unsupported versions and truncated headers. Weight data is never read, executed or uploaded.

More examples

Verify a download

The summary card shows architecture, quantization, context length and chat-template presence at a glance.

Tensor inventory

Sizes come from ggml block math and are marked approximate for exotic quant types.

Header debug

The raw tab helps diagnose malformed or unfamiliar exports.

Examples

Quantization check

Input
4.5 GB Q4_K_M download with general.file_type = 15
Output
Summary: llama · Q4_K_M · ctx 4096 · tensors 32

The file_type enum is decoded from the llama.cpp table rather than guessed from the filename.

Chat template

Input
GGUF containing tokenizer.chat_template.jinja
Output
chat template: yes

Both the classic and .jinja template keys count, so recent exports are reported correctly.

Truncated header

Input
File declares a string longer than the available bytes
Output
Typed truncated-header error with expected and actual byte counts

Every read is bounds-checked; no buffer overrun or unhandled exception can occur.

About this tool

GGUF Metadata Inspector reads the header of a local GGUF model file: magic, version, typed key/value metadata and every tensor-info record. It decodes architecture, quantization file type, context length, tokenizer information and chat-template presence.

Parsing is bounds-checked and reads only the first slice of the file with File.slice. Tensor weights are never loaded, dequantized or executed, so a multi-gigabyte model costs the same as a small one in memory. Bad magic, unsupported versions and truncated headers produce typed errors rather than raw exceptions.

The summary card gives a screenshot-ready verdict; the metadata table, tensor inventory and raw hex pane support deeper debugging. JSON and CSV exports make it easy to paste evidence into an issue report. Nothing is uploaded or cached.

What this tool does not do

  • Only GGUF versions 2 and 3 are supported; v1 is rejected explicitly.
  • Very large tokenizer arrays are decoded but only the first 64 elements are displayed.
  • The header slice is capped at 4 MB in this browser implementation.
  • Exotic quantization byte sizes are approximate and labeled as such.
  • No tensor data, file integrity checksum or dequantization is performed.

How to use this tool

  1. Choose a GGUF file

    Use the file picker, or load the bundled demo header to explore the UI without a download.

  2. Read the summary

    Check architecture, file_type quantization, context length, vocab size and chat-template presence.

  3. Inspect details

    Search metadata keys, filter tensors by ggml type and inspect the first 512 raw bytes in the Raw tab.

  4. Export evidence

    Download the metadata as JSON or the tensor inventory as CSV for bug reports and model cards.

Use cases

Pre-download verification

Confirm quantization, context length and template support before committing disk space.

Model publisher QA

Check exported headers and tensor inventories against a model card.

Server setup

Read n_ctx and rope settings to configure llama.cpp server flags correctly.

Header layout

RegionDecoded fields
Magic + version'GGUF' bytes and u32 version (2 or 3; v1 is rejected).
Countersu64 tensor count and key/value count.
KV recordsString key, u32 type id and typed value; arrays are summarized after 64 items.
Tensor infosName, dimensions, ggml type id and data offset.
AlignmentData section aligned to max(32, general.alignment).
Hex paneFirst 512 bytes verbatim for debugging.

Tensor byte sizes come from pinned ggml block layouts and are labeled approximate for exotic quantization types.

Common mistakes

Mistake:Expecting weight inspection or dequantization.

Fix:This is a header-only reader; tensor data is never touched.

Mistake:Trusting file_type as the actual byte mix.

Fix:It is self-reported metadata; inspect per-tensor ggml types for a fuller picture.

Mistake:Ignoring a missing chat template warning.

Fix:Recent exports may use tokenizer.chat_template.jinja; if both are absent, check your server's template configuration.

Mistake:Feeding a GGUF v1 file.

Fix:v1 uses a legacy u32 layout; convert it with llama.cpp first.

Mistake:Assuming huge tokenizer arrays are fully displayed.

Fix:Arrays are summarized after 64 elements; export the JSON for the full decoded prefix.

Frequently asked questions

Can it read a 40 GB GGUF?

Yes. The inspector uses File.slice to read only the header region — up to the first 4 MB in this browser implementation — so file size does not determine memory use. Tensor weight bytes are never read. If a header is genuinely larger than the slice, the tool reports a typed truncation error with guidance.

Does it upload my model?

No. There is no upload endpoint. The file is read from disk into a local ArrayBuffer, parsed in your browser tab and released when you leave the page. File names are not cached or stored.

What does a file_type like Q4_K_M mean?

general.file_type is a self-reported enum describing the quantization recipe used when the model was exported. The inspector decodes ids such as 14 (Q4_K_S), 15 (Q4_K_M), 18 (Q6_K) and the IQ variants into readable labels. Per-tensor ggml types give a more precise picture because a Q4_K_M file mixes block types across tensor groups.

Why is my chat template missing?

Older exports write tokenizer.chat_template; recent llama.cpp exports often write tokenizer.chat_template.jinja instead. The inspector accepts either key. If neither exists, the model was exported without an embedded template and your server or client must supply one.

What are alignment and the data offset?

GGUF aligns the tensor data section to a boundary of at least 32 bytes, or max(32, general.alignment). The data offset is the first aligned byte after all tensor-info records; it is where weight bytes begin. The inspector reports it so you can reason about file layout without reading those bytes.

Why are some tensor sizes marked with ≈?

Common ggml types have exact block layouts, so sizes for F16, Q4_0, Q4_K and similar types are computed exactly. Exotic IQ/TQ layouts are approximate in the pinned type table and are labeled with ≈ rather than presented as exact byte counts.

Which GGUF versions are supported?

Versions 2 and 3, which use u64 counters and length-prefixed strings. Version 1 used different u32 packing and is explicitly unsupported; the error message points to llama.cpp for conversion. Unknown value type ids are reported in the warning list rather than aborting the whole header.

References & standards