DeepSeek V4 Flash DSpark Drafter GGUF
This repository contains only the DSpark auxiliary drafter for DeepSeek V4
Flash. It is not a standalone language model and does not contain the target
model weights.
The GGUF is built from the official
deepseek-ai/DeepSeek-V4-Flash-DSpark
checkpoint using the standalone Python scripts included here. The complete
source manifest, build recipe, structural parser, numeric verifier, dependency
pin, and build results are published alongside the artifact.
Artifacts and recipes
| File | Bytes | SHA-256 |
|---|
DeepSeek-V4-Flash-DSpark-Drafter-MXFP4-Q8_0.gguf | 10,897,110,272 | 7f79d5eaf89b6cabb600cefedc6c1e7f6d2c68bc741be1ee4ee805ec56e02750 |
DeepSeek-V4-Flash-DSpark-Drafter-Q2_K-Q8_0-dflash.gguf | 6,976,490,112 | 96f442f7972a6d3e9b05912f511479f4c2f1334870128cc3bb317f8d812faf58 |
DeepSeek-V4-Flash-DSpark-Drafter-Q2_K-Q8_0.gguf | 6,971,241,728 | 732934da14e1dbd854e88bc75e4f382ce233b383b41838c739c56cfa1a120022 |
Both legacy recipes use GGUF v3 with the same custom architecture,
deepseek_v4_flash_dspark_draft, and the same 81 tensor names, dimensions,
order, and source inventory. Only the nine routed-expert output types differ:
| Output type | MXFP4/Q8_0 | Q2_K/Q8_0 | Transformation |
|---|
| F32 | 45 | 45 | BF16 expanded exactly to F32, or source F32 bytes preserved |
| F16 | 2 | 2 | BF16 Markov heads rounded to F16 |
| Q8_0 | 25 | 25 | FP8 E4M3 weights with E8M0 block scales dequantized, then quantized to Q8_0 |
| MXFP4 | 9 | 0 | Routed-expert FP4 nibbles and E8M0 scales repacked without requantization |
| Q2_K | 0 | 9 | Routed-expert MXFP4 decoded and requantized with the unweighted DS4 reference Q2_K algorithm |
The MXFP4 transformation is bit-preserving. Q8_0 and F16 transformations are
lossy and are checked against explicit numeric error bounds. Q2_K is also
lossy; this repository does not claim that either complete conversion is
lossless.
Pinned source
- Repository:
deepseek-ai/DeepSeek-V4-Flash-DSpark
- Revision:
62af8fffb2f7030cac4de2f0169f5b8d1101b646
- Input: only safetensors shards 46, 47, and 48
- Total source size: 10,863,342,388 bytes
Exact file sizes and SHA-256 values are in
manifest/source.json. The downloader and converter
refuse any source that does not match them.
Reproduce
The reference build uses Linux aarch64, Python 3.14.6, uv 0.11.29, and the
exact NumPy wheel pinned by hash in
requirements-linux-aarch64-py314.lock. Source download requires the hf
CLI; the reference download used version 1.23.0.
The upstream repository is public, so a Hugging Face token is not required.
The transport tool cannot affect the conversion because every downloaded byte
is checked against manifest/source.json before use.
1uv venv --python 3.14.6 .venv
2uv pip install --python .venv/bin/python \
3 --require-hashes --only-binary=:all: \
4 -r requirements-linux-aarch64-py314.lock
5
6.venv/bin/python scripts/download_sources.py --destination sources
7.venv/bin/python -m unittest discover -s tests -v
8.venv/bin/python scripts/reproduce.py \
9 --sources sources \
10 --recipe mxfp4-q8_0 \
11 --manifest-dir manifest \
12 --repeat-check
13sha256sum -c SHA256SUMS
Build the Q2_K/Q8_0 artifact with the same pinned inputs and environment:
1.venv/bin/python scripts/reproduce.py \
2 --sources sources \
3 --recipe q2_k-q8_0 \
4 --manifest-dir manifest \
5 --repeat-check
6sha256sum -c SHA256SUMS
Each recipe defaults to its explicit canonical output filename. --output
can override the path without changing the selected tensor policy. The
published MXFP4 build continues to use manifest/build.json and
manifest/validation.json; Q2_K uses
manifest/build-q2_k-q8_0.json and
manifest/validation-q2_k-q8_0.json. Updating one recipe replaces only its
entry in SHA256SUMS, preserving the other artifact's digest and evidence.
--repeat-check performs a second clean conversion and requires its complete
GGUF SHA-256 to match the verified first build byte for byte.
The converter memory-maps the source shards, processes FP8 tensors in 128-row
bands, and uses at most eight ordered worker threads while producing Q2_K.
Each worker keeps at most one decoded routed expert resident, and results are
written in expert order so scheduling cannot affect the GGUF bytes. It does not
require PyTorch, CUDA, safetensors, a GGUF package, or a GPU.
Verification
The included verifier checks:
- all pinned source sizes and hashes;
- all 4,705 source tensor names, dtypes, shapes, and byte ranges;
- GGUF version, metadata, tensor order, dimensions, types, offsets, alignment,
non-overlap, zero padding, and final length;
- exact F32 and F16 output bytes;
- exact MXFP4 scale and nibble repacking for all 9 fused expert tensors in the
MXFP4 recipe;
- independent Q2_K block decoding and block-normalized reconstruction error
against a fresh MXFP4 source decode for all 9 routed-expert tensors in the
Q2_K recipe; and
- exact Q8_0 scale/code encoding plus block-relative error against a fresh FP8
source decode.
Reference-build results:
| Check | MXFP4/Q8_0 | Q2_K/Q8_0 |
|---|
| Tensor count | 81 | 81 |
| Exact F32/F16 tensors | 47 | 47 |
| Exact MXFP4 tensors | 9 | n/a |
| Maximum Q2_K block-relative error | n/a | 0.4886474609375 |
| Q2_K limit | n/a | 0.50 |
| Maximum Q8_0 block-relative error | 0.00396728515625 | 0.00396728515625 |
| Q8_0 limit | 0.01 | 0.01 |
| Repeat build | byte-identical | byte-identical |
The Q2_K verifier enforces a maximum block-relative reconstruction error of
0.50; the observed full-artifact maximum is 0.4886474609375. The
checked-in focused test also requires byte-for-byte agreement with a
nontrivial 84-byte block emitted by the attributed C reference quantizer.
Standardized dflash artifact
DeepSeek-V4-Flash-DSpark-Drafter-Q2_K-Q8_0-dflash.gguf uses GGUF v3,
general.architecture=dflash, canonical llama.cpp metadata and tensor names,
and canonical one-based dflash.target_layers=[41, 42, 43].
The schema is pinned to ggml-org/llama.cpp commit
3581ba0cf591b3f772fbb002de0f70e294bc0396, incorporating PR #25784 and
the separate-DSpark converter in PR #26452. Its exact type inventory is F32
45, F16 2, Q8_0 25, Q2_K 9, and BF16 0.
The standardized file preserves every tensor payload from the custom
Q2_K/Q8_0 artifact byte for byte through an explicit checked name mapping. It
is not a new quantization. Its complete tokenizer metadata was copied from the
compatible target through the official llama.cpp DeepSeek V4 DSpark converter
at commit 15586e2d7165570fb3aa7c26e0d442e289ef69de, including
tokenizer.ggml.mask_token_id=128799. A real llama.cpp draft-dspark decode
generated 120 draft tokens, accepted 38, and emitted no invalid -1 token.
ns4 build e470f38280d9ff4f020c242233998562a88463ee loaded the equivalent
Flash-compatible metadata and completed an exact 32-token decode, drafting 47
and accepting 12.
The legacy artifacts remain available.
Reproduce and verify the standardized candidate with:
1.venv/bin/python -m unittest discover -s tests -v
2.venv/bin/python scripts/dflash.py \
3 --sources sources \
4 --target-tokenizer-gguf tokenizer.gguf \
5 --manifest-dir manifest \
6 --repeat-check \
7 --legacy-reference DeepSeek-V4-Flash-DSpark-Drafter-Q2_K-Q8_0.gguf
8sha256sum -c SHA256SUMS
Dedicated build, validation, payload-comparison, and schema manifests are
published under manifest/.
Compatibility and limitations
- This is an auxiliary drafter, not a complete checkpoint.
- The custom files require the checked-in
deepseek_v4_flash_dspark_draft and
dspark.* dialect. The standardized file requires llama.cpp dflash
support.
- The drafter must be paired with a compatible DeepSeek V4 Flash target model.
This repository makes no universal quality, acceptance-rate, or speed claim
across target quantizations or runtimes.
- This is a community conversion, not an official DeepSeek release or
endorsement.
DSpark configuration
The pinned source configuration defines:
- block size: 5
- target layers: 40, 41, and 42
- Markov rank: 256
- hidden size: 4096
- vocabulary size: 129,280
These values are also embedded in the GGUF metadata and validated during the
build.
License and references
The source-derived weights remain under DeepSeek's MIT terms in
LICENSE. The newly authored conversion and verification scripts
are under
LICENSE.code. The pinned checkpoint's
upstream license
and the DS4/GGML attribution in
THIRD_PARTY_NOTICES.md provide the applicable notices.