Run this model with HF Jobs
Run mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX") config = load_config("mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX
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.
At a glance
| 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 |
Quickstart
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."}]
}'
Settings explained
--memory-guard-gb 106is 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: truekeeps 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: trueturns on DSpark speculative decoding. It uses no extra memory: the draft head is always loaded.deepseek_v41_ced_prefill_enabled: truespeeds 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: 2drafts two tokens per step. This was the fastest and most consistent setting at the recommended sampling (see Performance).- Sampling:
temperature: 1.0,top_p: 1.0andmax_tokensof at least 256K are DeepSeek's recommended settings for this model, including for coding. Leavetop_kunset. 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 and reasoning. OpenAI-style
toolsare supported. omlx applies the DeepSeek V4.1 prompt format itself and acceptsenable_thinking,thinking_modeandreasoning_effort.chat_template.jinjais included for other runtimes. - If loading still fails, close other large apps, or raise the GPU memory limit with
sudo sysctl iogpu.wired_limit_mb=120000.
Performance
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.
- Time to first token: about 0.1 s for a short prompt.
- Memory in use: 97–99 GB.
- Tool calling and image input both worked correctly in our tests.
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.
Quality
Task quality has not yet been measured on these MLX weights. For ISTA-DASLab's evaluation of the source GGUF, see their model card.
What is in this checkpoint
| 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.
Quantization recipe
| 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.
Conversion fidelity
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.
Limitations
- Quality not yet measured on MLX. The experts were quantized twice (by ISTA, then to MLX 2-bit), so quality may be somewhat below the source GGUF.
- Narrower general knowledge. Pruning half the experts toward code, tool use, long context and vision weakens knowledge outside those areas.
- Needs a 128 GB Mac, with little memory to spare. Close other large apps and lower the context if long prompts fail.
- Engram tables are read from SSD on every token, so the model should live on a fast internal drive.
- Draft acceptance may be lower on non-code text, which reduces speed but not output quality.
- Apple silicon and omlx only. For CUDA or llama.cpp, use the original GGUF.
How it was made
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.
License and attribution
Released under the MIT license, the license of DeepSeek V4.1 Flash and of the source GGUF.
- Base model: DeepSeek, deepseek-ai/DeepSeek-V4.1-Flash-1017
- Expert pruning (RCO) and quantization (GSQ): ISTA-DASLab, DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-GGUF
- GSQ: arXiv:2604.18556
- RCO: arXiv:2605.00649
- DSpark head, vision tower and MLX layout reference: mlx-community/DeepSeek-V4.1-Flash-1017-oQ2e-mtp
- Runtime: omlx
- GGUF tooling: llama.cpp
If you use this model in research, please cite the GSQ and RCO papers above.
- Downloads last month
- 2,151
Quantized
Model tree for mbrown-uno/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-MLX
Base model
deepseek-ai/DeepSeek-V4.1-Flash-1017