A simple CLI tool to display the first lines of a GGUF (GPT-Generated Unified Format) LLM model file in both human-readable ASCII and HEX format.
make buildOr manually:
go build -o ggufview ggufview.go./ggufview <gguf-file> [lines]gguf-file- Path to the GGUF model file to visualizelines- Number of lines to display (default: 10)
Display first 10 lines of a model:
./ggufview model.ggufDisplay first 20 lines:
./ggufview model.gguf 20You can use ggufview to inspect the JSON metadata at the beginning of Ollama model files:
sudo ./ggufview /usr/share/ollama/.ollama/models/blobs/sha256-05a61d37b08453e59290add468e3bb2f688e23a01e967fecb0e2fa41218cea76 20Output:
File: /usr/share/ollama/.ollama/models/blobs/sha256-05a61d37b08453e59290add468e3bb2f688e23a01e967fecb0e2fa41218cea76
Lines: 20
Offset | HEX | ASCII
----------+----------------------------------------------------+----------
0x00000000 | 7b 22 6d 6f 64 65 6c 5f 66 6f 72 6d 61 74 22 3a | {"model_format":
0x00000010 | 22 67 67 75 66 22 2c 22 6d 6f 64 65 6c 5f 66 61 | "gguf","model_fa
0x00000020 | 6d 69 6c 79 22 3a 22 71 77 65 6e 33 22 2c 22 6d | mily":"qwen3","m
0x00000030 | 6f 64 65 6c 5f 66 61 6d 69 6c 69 65 73 22 3a 5b | odel_families":[
0x00000040 | 22 71 77 65 6e 33 22 5d 2c 22 6d 6f 64 65 6c 5f | "qwen3"],"model_
0x00000050 | 74 79 70 65 22 3a 22 38 2e 32 42 22 2c 22 66 69 | type":"8.2B","fi
0x00000060 | 6c 65 5f 74 79 70 65 22 3a 22 51 34 5f 4b 5f 4d | le_type":"Q4_K_M
0x00000070 | 22 2c 22 61 72 63 68 69 74 65 63 74 75 72 65 22 | ","architecture"
0x00000080 | 3a 22 61 6d 64 36 34 22 2c 22 6f 73 22 3a 22 6c | :"amd64","os":"l
0x00000090 | 69 6e 75 78 22 2c 22 72 6f 6f 74 66 73 22 3a 7b | inux","rootfs":{
0x000000A0 | 22 74 79 70 65 22 3a 22 6c 61 79 65 72 73 22 2c | "type":"layers",
0x000000B0 | 22 64 69 66 66 5f 69 64 73 22 3a 5b 22 73 68 61 | "diff_ids":["sha
0x000000C0 | 32 35 36 3a 61 33 64 65 38 36 63 64 31 63 31 33 | 256:a3de86cd1c13
0x000000D0 | 32 63 38 32 32 34 38 37 65 64 65 64 64 34 37 61 | 2c822487ededd47a
0x000000E0 | 33 32 34 63 35 30 34 39 31 33 39 33 65 36 35 36 | 324c50491393e656
0x000000F0 | 35 63 64 31 34 62 61 66 61 34 30 64 30 62 38 65 | 5cd14bafa40d0b8e
0x00000100 | 36 38 36 66 22 2c 22 73 68 61 32 35 36 3a 65 62 | 686f","sha256:eb
0x00000110 | 34 34 30 32 38 33 37 63 37 38 32 39 61 36 39 30 | 4402837c7829a690
0x00000120 | 66 61 38 34 35 64 65 34 64 37 66 33 66 64 38 34 | fa845de4d7f3fd84
0x00000130 | 32 63 32 61 64 65 65 34 37 36 64 35 33 34 31 64 | 2c2adee476d5341d
This example shows how Ollama models contain JSON metadata describing the model format, family, type, and architecture before the actual GGUF weights data.
The tool displays data in three columns:
- Offset: Memory offset in hexadecimal
- HEX: Hexadecimal representation of bytes
- ASCII: Human-readable ASCII characters (non-printable shown as
.)
File: model.gguf
Lines: 10
Offset | HEX | ASCII
----------+----------------------------------------------------+----------
0x00000000 | 47 47 55 46 03 00 00 00 00 00 00 00 00 00 00 00 | GGUF............
0x00000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
- Go 1.18 or later
MIT