Model file format identifier
Drop a model file to identify its real format from its bytes: safetensors, GGUF, ONNX, PyTorch, pickle, Keras or SavedModel, and whether loading can run code.
Only the header and, for archives, the list of files are read, in your browser. Nothing is uploaded, and the file is never loaded as a model.
Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.
How to use the model file format identifier
- Drop the model file, or load the example.
- Read the format and the answer to "can loading it run code?".
- Check the details: tensor count, data types and metadata for safetensors and GGUF.
- For pickle-based formats, scan the file with the pickle file scanner before loading it.
About this tool
A file extension is a label anyone can change. A file called model.bin may be a safetensors file, a PyTorch zip archive or a raw pickle, and the difference decides whether opening it can run code on your machine. The bytes at the start of the file say what it really is.
This tool reads those bytes and the structure behind them. For safetensors it parses the JSON header and shows the tensor count, data types, parameter count and metadata. For GGUF it shows the version, tensor count and metadata keys. It recognises ONNX and TensorFlow SavedModel protobufs, PyTorch and Keras zip archives by the files inside them, raw pickles and HDF5.
For each format it says plainly whether loading can execute code. safetensors, GGUF and ONNX hold data and a fixed set of operations. Pickle-based files run what they import. Keras files can carry Lambda layers with embedded Python. A SavedModel is a program for the TensorFlow runtime. Only the header and the archive index are read, so a file of many gigabytes takes a moment.
Sources
Questions
safetensors and GGUF contain tensor data and metadata only, and ONNX contains a graph of predefined operators, so none of them carries code of its own. Pickle-based formats (.pkl, .pt, .pth, .ckpt, .joblib, many .bin files) can run code when loaded. Keras .h5 files can as well, through Lambda layers.
By its first bytes. PK means a zip archive, which for a model is usually a PyTorch checkpoint, and the byte 0x80 followed by a small number is a pickle. Eight bytes of length followed by { is safetensors, and GGUF starts with the letters GGUF. This tool checks these for you.
The first 8 bytes give the length of a JSON object that follows. The JSON maps each tensor name to its dtype, shape and byte offsets, with an optional __metadata__ entry of free-form strings. After it comes the raw tensor data, and nothing else.
The format holds no executable code, so loading the weights does not run anything from the file. Risk comes from bugs in the software that parses it. One example is CVE-2024-34359, where a Python binding rendered the chat template stored in GGUF metadata without a sandbox. Keep the loader up to date.