A coding-focused DeepSeek V4.1 Flash for 128 GB Apple silicon Macs, with DSpark speculative decoding: about 44 tok/s on an M5 Max.
This is an MLX build of ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-GGUF, ISTA-DASLab's pruned and quantized DeepSeek V4.1 Flash 1017. It keeps 192 of the original 384 routed experts per layer, selected for code, agentic tool use, long context and vision. This checkpoint runs on Apple silicon with omlx and includes DeepSeek's DSpark multi-token-prediction head, which speeds up decoding by about 17%.
Converted by Unosquare. This is an unofficial conversion, not affiliated with or endorsed by ISTA-DASLab or DeepSeek.
| Memory needed | 97–99 GB of unified memory while running, plus KV cache for long prompts. Requires a 128 GB Mac |
| Download size | 227 GB, of which 123 GB (the Engram n-gram tables) stays on SSD and is not loaded into memory |
| Architecture | DeepSeek V4.1 Flash (deepseek_v41): 40-layer mixture-of-experts with sparse long-context attention, hyper-connections, Engram n-gram memory and a vision tower |
| Routed experts | 192 per layer (pruned from 384), 6 active per token, plus 1 shared expert |
| Context | Up to 1,048,576 tokens (DeepSeek's recommended setting) |
| Speculative decoding | DSpark: 3 draft stages, from the full DeepSeek V4.1 Flash |
| Vision | Yes |
| Quantization | 2-bit routed experts, 6- and 8-bit attention and shared-expert weights, 4-bit Engram tables (MLX affine) |
| Runtime | omlx 0.7.3 or later |
Requires omlx ≥ 0.7.3 and a 128 GB Apple silicon Mac.
hf download mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX \
--local-dir ~/models/mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX
Create <base-path>/model_settings.json:
{
"version": 1,
"models": {
"DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX": {
"mtp_enabled": true,
"mtp_fixed_depth": 2,
"deepseek_v41_engram_ssd_offload": true,
"deepseek_v41_ced_prefill_enabled": true,
"max_context_window": 1048576,
"temperature": 1.0,
"top_p": 1.0,
"max_tokens": 262144
}
}
}
Serve it, then call the OpenAI-compatible API:
omlx serve --base-path <base-path> --model-dir ~/models --port 8000 --memory-guard-gb 106
curl http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{
"model": "DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX",
"messages": [{"role": "user", "content": "Write a Python LRU cache with per-entry TTL."}]
}'
--memory-guard-gb 106 is required. omlx's default memory guard allows about 87 GB on a 128 GB Mac and will refuse to load this model. 106 GB stays just under the GPU memory limit macOS allows.deepseek_v41_engram_ssd_offload: true keeps the 123 GB Engram tables on SSD and reads them as needed. Keep the model on the internal SSD; slow or external drives reduce speed.mtp_enabled: true turns on DSpark speculative decoding. It uses no extra memory: the draft head is always loaded.deepseek_v41_ced_prefill_enabled: true speeds up reading long prompts by about 45% (see Performance). Output is not bit-identical to running without it, but we measured no quality difference.mtp_fixed_depth: 2 drafts two tokens per step. This was the fastest and most consistent setting at the recommended sampling (see Performance).temperature: 1.0, top_p: 1.0 and max_tokens of at least 256K are DeepSeek's recommended settings for this model, including for coding. Leave top_k unset.max_context_window: the weights leave about 7 GB of headroom for KV cache. If very long prompts fail, lower it (for example to 262144).tools are supported. omlx applies the DeepSeek V4.1 prompt format itself and accepts enable_thinking, thinking_mode and reasoning_effort. chat_template.jinja is included for other runtimes.sudo sysctl iogpu.wired_limit_mb=120000.Measured with omlx 0.7.3 on an Apple M5 Max (128 GB) on mains power, batch 1, with DeepSeek's recommended sampling (temperature 1.0, top_p 1.0), model already loaded. Averages of 5 runs:
| Prompt | DSpark on | DSpark off | Speedup | Draft acceptance |
|---|---|---|---|---|
| Coding task, 700 generated tokens | 43.6 tok/s (41.2–44.9) | 37.2 tok/s (36.3–37.7) | +17% | 85% (2.6 tokens per verify step) |
DSpark on uses mtp_fixed_depth: 2. Other draft depths, same conditions:
| Draft depth | Decode speed |
|---|---|
| Fixed 1 | 39.1 tok/s |
| Fixed 2 (recommended) | 43.6 tok/s |
| Adaptive up to 2 | 43.1 tok/s |
| Adaptive up to 3 (omlx default) | 42.2 tok/s, varies most between runs |
| Adaptive up to 4 | 41.4 tok/s |
With greedy decoding (temperature 0) draft acceptance rises to 88%.
Prompt processing: about 310 tok/s by default and about 470 tok/s with CED prefill (deepseek_v41_ced_prefill_enabled), which processes only the final 128 tokens through the second half of the layers. On an 11,000-token prompt, time to first token drops from about 34–40 s to about 27 s.
At temperature 0, output with DSpark on is deterministic and unaffected by the draft head. It is not byte-identical to output with DSpark off, because omlx uses different decode kernels in the two modes; the outputs can diverge where two tokens are almost equally likely.
Task quality has not yet been measured on these MLX weights. For ISTA-DASLab's evaluation of the source GGUF, see their model card.
| Part | Source |
|---|---|
| Language model (40 layers, 192 experts each) and Engram tables | ISTA-DASLab GSQ-RCO Coder GGUF, requantized for MLX |
| DSpark draft head | DeepSeek V4.1 Flash, via mlx-community/DeepSeek-V4.1-Flash-1017-oQ2e-mtp, unchanged |
| Vision tower | DeepSeek V4.1 Flash, via mlx-community/DeepSeek-V4.1-Flash-1017-oQ2e-mtp, unchanged |
| Tokenizer | mlx-community/DeepSeek-V4.1-Flash-1017-oQ2e-mtp |
| Chat template | Source GGUF |
The source GGUF has no draft head, so DSpark was taken from the full DeepSeek V4.1 Flash. It was trained alongside all 384 experts, but it still accepts about 85% of its drafts on this pruned model at the recommended settings. Every drafted token is checked by the main model, so the draft head affects speed, not output.
| Weights | MLX format |
|---|---|
| Routed experts | 2-bit affine, group 64 |
Attention (wq_b, wo_b), shared experts, Engram projection |
6-bit affine, group 64 |
Attention (wq_a, wkv), compressor and indexer |
8-bit affine, group 64 |
Attention output (wo_a) |
bf16, rounded to MXFP8 values |
| Embeddings, LM head, routers, norms | Unquantized |
| Engram tables | 4-bit affine, group 32 |
Bit widths mostly follow the precision ISTA gave each tensor in the GGUF. The routed experts are 2-bit because they make up most of the model; at 3 bits they alone would take about 119 GB. Expert and Engram scales are fitted to minimise squared error rather than taken from a plain min/max range. Per-module settings are in config.json under omlx_deepseek_v41.quantized_modules.
Each converted tensor was compared with the GGUF it came from and with mlx-community's independent MLX build of the full model. Full results are in verify_report.json.
| Check | Result |
|---|---|
| Expert selection and router match the full model | Yes, in all 40 layers (router cosine 1.000) |
| Routed experts vs the source GGUF | Mean cosine 0.960 |
| Other language-model weights vs the full model | Median cosine 1.000, lowest 0.998 |
| Engram tables vs the source GGUF | Cosine 0.998 |
| Vision tower vs the source GGUF's vision projector | Cosine 1.000 |
The routed experts lose some precision going from ISTA's 1.75–2.3-bit GGUF formats to MLX 2-bit affine; the other weights are close to exact.
Each tensor of ISTA-DASLab's GGUF was dequantized with llama.cpp's gguf-py, mapped back to DeepSeek's original layout and requantized with MLX 0.32.4 in the layout omlx expects for DeepSeek V4.1. The DSpark head, vision tower and tokenizer were copied unchanged from mlx-community's MLX build of the full model.
Released under the MIT license, the license of DeepSeek V4.1 Flash and of the source GGUF.
If you use this model in research, please cite the GSQ and RCO papers above.
model-00019-of-00021.safetensors 61 GBmodel-00018-of-00021.safetensors 61 GBmodel-00002-of-00021.safetensors 6.1 GBmodel-00014-of-00021.safetensors 6.0 GBmodel-00016-of-00021.safetensors 6.0 GBmodel-00004-of-00021.safetensors 6.0 GBmodel-00008-of-00021.safetensors 6.0 GBmodel-00012-of-00021.safetensors 6.0 GBmodel-00010-of-00021.safetensors 6.0 GBmodel-00006-of-00021.safetensors 6.0 GBmodel-00001-of-00021.safetensors 5.9 GBmodel-00007-of-00021.safetensors 5.6 GBmodel-00009-of-00021.safetensors 5.5 GBmodel-00005-of-00021.safetensors 5.5 GBmodel-00013-of-00021.safetensors 5.5 GBmodel-00011-of-00021.safetensors 5.5 GBmodel-00015-of-00021.safetensors 5.5 GBmodel-00003-of-00021.safetensors 5.5 GBmodel-00020-of-00021.safetensors 5.4 GBmodel-00021-of-00021.safetensors 3.6 GBmodel-00017-of-00021.safetensors 2.3 GB