# Engram n-gram tables: mix and match DeepSeek-V4.1-Flash-1017 has a large Engram n-gram embedding table (`per_layer_token_embd.weight`, 256 x 768,022,850). Every quant in this repo keeps that table in its own shard, so you can swap it for a smaller or a lossless one without re-downloading the rest of the model. | file | table type | size | notes | |---|---|---|---| | `DeepSeek-V4.1-Flash-1017-engram-MXFP8.gguf_file` | MXFP8 | 202.8 GB | lossless, exactly as in the checkpoint | | `DeepSeek-V4.1-Flash-1017-engram-Q6_K.gguf_file` | Q6_K | 161.3 GB | | | `DeepSeek-V4.1-Flash-1017-engram-Q5_K.gguf_file` | Q5_K | 135.2 GB | | | `DeepSeek-V4.1-Flash-1017-engram-IQ4_NL.gguf_file` | IQ4_NL | 110.6 GB | | Sizes are GB = 10^9 bytes. The files end in `.gguf_file` so tools that scan the repo for models do not pick them up; you rename one to your quant's table shard name when swapping (step 3 below). ## Which shard is the table | quant | table shard | slot / count | |---|---|---| | UD-IQ1_S, UD-IQ1_M | `-00005-of-00005` | 5 5 | | UD-IQ2_XXS | `-00006-of-00006` | 6 6 | | UD-Q2_K_XL, UD-IQ3_XXS | `-00007-of-00007` | 7 7 | | UD-IQ3_S, UD-Q3_K_XL | `-00008-of-00008` | 8 8 | | UD-Q4_K_XL, UD-Q8_K_XL | `-00008-of-00009` | 8 9 | ## How to swap (example: UD-IQ1_S with the lossless MXFP8 table) llama.cpp checks that each shard's `split.no` / `split.count` match its place in the set, so the table file has to be stamped for your quant first. `set_split.py` (in this folder, plain Python, no dependencies) changes those two header values in place in milliseconds; nothing else in the file changes. ```bash # 1. get the table + the script hf download unsloth/DeepSeek-V4.1-Flash-1017-GGUF \ --include "engram/*MXFP8*" "engram/set_split.py" --local-dir . # 2. stamp it as shard 5 of 5 (UD-IQ1_S's table slot) python engram/set_split.py engram/DeepSeek-V4.1-Flash-1017-engram-MXFP8.gguf_file 5 5 # 3. keep the old table aside, then rename the new one to the table shard's name mv UD-IQ1_S/DeepSeek-V4.1-Flash-1017-UD-IQ1_S-00005-of-00005.gguf UD-IQ1_S/engram-IQ4_NL.bak mv engram/DeepSeek-V4.1-Flash-1017-engram-MXFP8.gguf_file \ UD-IQ1_S/DeepSeek-V4.1-Flash-1017-UD-IQ1_S-00005-of-00005.gguf # 4. run as usual llama-server -m UD-IQ1_S/DeepSeek-V4.1-Flash-1017-UD-IQ1_S-00001-of-00005.gguf ``` For another quant only the two numbers and the file name change (table above). The files here are stamped as shard 1 of 1, so using one without `set_split.py` fails to load with `invalid split file idx` instead of loading the wrong thing.