Which weight and graph formats PexLens will inspect, and why some files are skipped.
Point PexLens at a directory that contains model files. The first pass looks at how the file is packaged and flags unsafe serialization. A deeper pass, which you ask for separately, adds numeric checks. This page is about the formats and about the files that must not be opened in order to be judged.
PexLens identifies a file by what it is, not only by the extension a publisher chose. A renamed payload is still the format its contents declare. Trust the inspection, not the filename in the repository listing.
Formats
| Format | What PexLens checks |
|---|---|
| Safetensors | Values that are not real numbers, extreme magnitudes, dead tensors, and outliers on small classifier heads. These files are data. They are the format a comparison with a published checkpoint is willing to fetch. |
| GGUF | Common floating-point tensors, read in chunks. Quantized tensors are included when they can be sampled safely. |
| ONNX | Weights stored inside the graph, so a model that claims to be only a graph can still be carrying unexpected data. |
| NumPy arrays | Numeric arrays stored as .npy files. |
| Keras and HDF5 | Weights stored in those containers, when the file can be read as data. |
| PyTorch weight files | Opened as weights only. Executable pickle content is not loaded. |
What is skipped
Pickle files that static analysis has already marked as a code-execution payload are skipped. Opening them to “confirm” would run the code the inspection just refused to trust. You can extend that skip list when your team already knows a file should not be opened. Skipping is a successful safety decision, not a gap in coverage. The finding is that the file is unsafe to load. You do not need a tensor statistic on top of that.
Other formats are refused or left alone when they cannot be read as data without executing them. If a model only exists as one of those files, say so in the review. “Not opened” plus the reason is the result. Do not convert it into “no issues found.”
How to explain a finding
Tell the team which file, which format, and what the inspection objected to. “The checkpoint includes a pickle that executes on load” is a block. “A safetensors file has non-finite values in one tensor” is a review of the weights, and it is a different severity conversation from code execution. Do not use the word malicious for both unless the verdict does. The file guide exists so those sentences stay precise.
