# Inspect a GGUF File Before Loading It with llama.cpp

> Read GGUF architecture, file size and tensor storage types locally, with a small synthetic fixture and a script you can run on a downloaded model.

Canonical article: https://modelrovia.com/guides/inspect-gguf-metadata/
Author: Modelrovia Editorial
Published: 2026-11-09
Updated: 2026-11-09

## Key takeaway

Check the actual GGUF fields and tensor types before diagnosing a model download or runtime mismatch.

Inspect the file you downloaded before trying to load it into a model runtime. Architecture metadata, actual file size and the distribution of tensor storage types can narrow a compatibility problem. The inspection uses the GGUF reader maintained with llama.cpp and does not start inference.

## Try the reader on a known input

Download the [inspection script](/examples/gguf-inspect.py) and our [256-byte synthetic GGUF fixture](/examples/gguf-inspection-fixture.gguf). The fixture contains one artificial 4-by-4 tensor and basic metadata. Use it to verify the reader installation. It has no trained model weights.

~~~sh
python -m pip install gguf==0.19.0
python gguf-inspect.py gguf-inspection-fixture.gguf
~~~

On November 9, 2026, GGUF 0.19.0 printed this result:

~~~text
File bytes: 256
general.name: ModelRovia synthetic metadata fixture
general.architecture: llama
Tensor count: 1
Tensor types: {'F32': 1}
~~~

The architecture field is a value in the container. A runtime still needs the complete tensor set and implementation for the real architecture. The fixture is intentionally incomplete for inference.

## Apply the same check to your own download

Run the script with your actual file. Compare the observed architecture with the publisher's model card and the runtime's supported architectures. Record the filename, download revision and size. If the publisher provides a checksum, compare it against the downloaded file. A valid header alone cannot establish that the full artifact is the intended release.

The [ModelScope model download checklist](/guides/modelscope-download-model-checklist/) covers choosing a repository and artifact before download. This procedure starts with the bytes already on your disk.

## Read tensor types with care

A quantization label in the filename can summarize the weight format, while the file may contain tensors of several storage types. The script counts tensors by type. A count does not describe how many bytes each type occupies: one large tensor may take more space than dozens of small ones. Use the count to identify mixed storage, and use the actual file size and runtime logs for storage and load investigations.

The header does not tell you how much memory a live session will need. Runtime buffers, context and placement settings also matter. Keep a file inspection and a runtime test as separate records.

## Troubleshoot an unreadable file

If GGUFReader rejects the input, check for an incomplete transfer or an HTML error page saved under a .gguf name. Confirm you obtained the expected file or all required shards from the publisher. If the file opens but the runtime rejects the architecture, check the runtime version and its compatibility documentation. Our local run used the synthetic fixture because the public model download failed. It establishes the inspection procedure, with actual model loading left to your runtime.

## Sources & references

- [llama.cpp GGUF Python tools](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/README.md)
- [GGUF format and metadata specification](https://github.com/ggml-org/ggml/blob/master/docs/gguf.md)

[Editorial standards](https://modelrovia.com/methodology/)
