GGUF Radar looks for malware in the parts of a model file that no runtime ever reads
A Python scanner checks GGUF files for trailing payloads, poisoned chat templates and data tucked under zero-scale quantization blocks, and its docs list what it cannot catch.
Most of us treat a GGUF file, the thing you download to run a model locally, as a blob of numbers. GGUF Radar, by GitHub user Root0ne, treats it as a container with several places to hide things. It scans them without running the model or its chat template, and can write a clean copy with the same weights.
The repo appeared this week, and its README points to a research post on malicious GGUF uploads as its motivation. We could not reach that post from our build machine, so everything here comes from the repo.
How it works
A GGUF file is a header with metadata, a table listing each tensor’s size and position, some padding, then the weights. A runtime such as llama.cpp reads exactly the byte ranges the table names and nothing else. Anything outside those ranges is never loaded, and the scanner can calculate where they end.
So the first checks are arithmetic. If the file continues past the end of the last tensor, the extra bytes are reported, with a note on whether they begin with a known signature such as a Windows program. For models on Hugging Face, the tool reads only the start and end of the file.
The second target is the chat template, a small Jinja2 program stored in the metadata that formats every conversation before the model sees it. A poisoned one can tell a coding agent to fetch and run a script. GGUF Radar parses the template into a syntax tree and looks for patterns such as process commands and trigger-word conditions. It never executes it.
The zero-scale problem
Quantized weights are stored in blocks, each with a scale that multiplies its values. If the scale is zero, the values never reach the model, so an attacker can overwrite them freely.
The catch, per the docs, is that honest quantizers produce such blocks too. The scale is computed at 32-bit precision and stored at 16, so a block of very small weights can round to a zero scale with leftover values behind it.
The scanner therefore counts these blocks as a note and flags them only on specific signs. Bytes as flat as encrypted data. File signatures. Text that passes five separate conditions. Or, in Q8_0, a value the quantizer cannot emit: by the docs’ account it always maps the largest value in a block to 127 or -127 and never writes -128.
The limitations page is long and specific. The IQ formats are not inspected. Data shaped to imitate weights passes. And nothing here detects a model that was simply trained to misbehave. The sanitize command sidesteps much of this by zeroing the unused bytes it knows about, which the docs say leaves the weights identical.
Try it yourself
The repo installs with pip from GitHub and needs Python 3.10 or newer. Scans end in a verdict with exit codes meant for CI. The code is MIT licensed.
We have not run the scanner. This is based on the README and docs, which say a clean result is “not a guarantee”.