Even at 4-bit, this 304B model needs about 168 GB of memory. Run it with ZK Inference instead: pay anonymously, and personal details stay hidden.
DeepSeek-V4-Flash-0731 is the official release of DeepSeek-V4-Flash, superseding the preview version, with substantially enhanced agentic capabilities. It has the same model structure as DeepSeek-V4-Flash-DSpark, i.e. it comes with a speculative decoding module attached.
DeepSeek-V4-Flash-0731 outperforms DeepSeek-V4-Pro (Preview) on benchmarks listed below despite its far smaller activated parameter count, and is broadly competitive with the strongest proprietary models available.
| Benchmark | DeepSeek-V4-Flash-0731 | DeepSeek-V4-Flash (Preview) | DeepSeek-V4-Pro (Preview) | GLM-5.2 | Opus-4.8 |
|---|---|---|---|---|---|
| Terminal Bench 2.1 | 82.7 | 61.8 | 72.1 | 81.0 | 85.0 |
| NL2Repo | 54.2 | 39.4 | 38.5 | 48.9 | 69.7 |
| Cybergym | 76.7 | 38.7 | 52.7 | - | 83.1 |
| DeepSWE | 54.4 | 7.3 | 12.8 | 46.2 | 58.0 |
| Toolathlon-Verified | 70.3 | 49.7 | 55.9 | 59.9 | 76.2 |
| Agents' Last Exam | 25.2 | 15.8 | 16.5 | 23.8 | 25.7 |
| AutomationBench Public | 25.1 | 10.8 | 12.8 | 12.9 | 27.2 |
| DSBench-FullStack † | 68.7 | 37.0 | 41.8 | 61.8 | 71.6 |
| DSBench-Hard † | 59.6 | 25.8 | 31.1 | 54.5 | 71.7 |
Notes:
max reasoning effort level with temperature = 1.0, top_p = 0.95.This release does not include a Jinja-format chat template. Instead, we provide a dedicated encoding folder with Python scripts and test cases demonstrating how to encode messages in OpenAI-compatible format into input strings for the model, and how to parse the model's text output. Please refer to the encoding folder for full documentation.
The reasoning_effort parameter now supports three levels — low, high, and max — which control how much deliberation the model spends before answering.
A brief example:
from encoding_dsv4 import encode_messages, parse_message_from_completion_text
messages = [
{"role": "user", "content": "hello"},
{"role": "assistant", "content": "Hello! I am DeepSeek.", "reasoning_content": "thinking..."},
{"role": "user", "content": "1+1=?"}
]
# messages -> string
prompt = encode_messages(messages, thinking_mode="thinking", reasoning_effort="max")
# string -> tokens
import transformers
tokenizer = transformers.AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V4-Flash-0731")
tokens = tokenizer.encode(prompt)
DSpark speculative decoding is enabled with a single flag — add --speculative-config with method: dspark to your vLLM launch command:
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
For example, the command below serves the model with vLLM on a single 4×GB300 node. See the vLLM recipe for detailed instructions and other hardware configurations.
vllm serve deepseek-ai/DeepSeek-V4-Flash-0731 \
--trust-remote-code --kv-cache-dtype fp8 --block-size 256 \
--data-parallel-size 4 --enable-expert-parallel \
--moe-backend deep_gemm_mega_moe \
--attention-config '{"use_fp4_indexer_cache": true}' \
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
Enable DSpark with --speculative-algorithm DSPARK and do not set a separate --speculative-draft-model-path as the target and draft weights therefore come from the same checkpoint.
See the SGLang cookbook for detailed instructions, benchmarks and other hardwares configurations.
sglang serve \
--trust-remote-code \
--model-path deepseek-ai/DeepSeek-V4-Flash-0731 \
--tp 4 \
--moe-runner-backend flashinfer_mxfp4 \
--speculative-algorithm DSPARK \
--mem-fraction-static 0.90 \
--chunked-prefill-size 4096 \
--swa-full-tokens-ratio 0.1 \
Please refer to the inference folder for detailed instructions on running DeepSeek-V4 locally, including model weight conversion and interactive chat demos.
For local deployment, we recommend setting the sampling parameters to temperature = 1.0, with top_p = 0.95 for agentic scenarios and top_p = 1.0 otherwise. For the high and max reasoning effort levels, we recommend a maximum output length of 384K tokens.
This repository and the model weights are licensed under the MIT License.
@misc{deepseekai2026deepseekv4,
title={DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence},
author={DeepSeek-AI},
year={2026},
}
If you have any questions, please raise an issue or contact us at service@deepseek.com.
model-00048-of-00048.safetensors 3.4 GiBmodel-00046-of-00048.safetensors 3.4 GiBmodel-00004-of-00048.safetensors 3.3 GiBmodel-00012-of-00048.safetensors 3.3 GiBmodel-00014-of-00048.safetensors 3.3 GiBmodel-00016-of-00048.safetensors 3.3 GiBmodel-00018-of-00048.safetensors 3.3 GiBmodel-00020-of-00048.safetensors 3.3 GiBmodel-00022-of-00048.safetensors 3.3 GiBmodel-00024-of-00048.safetensors 3.3 GiBmodel-00026-of-00048.safetensors 3.3 GiBmodel-00028-of-00048.safetensors 3.3 GiBmodel-00030-of-00048.safetensors 3.3 GiBmodel-00032-of-00048.safetensors 3.3 GiBmodel-00034-of-00048.safetensors 3.3 GiBmodel-00036-of-00048.safetensors 3.3 GiBmodel-00038-of-00048.safetensors 3.3 GiBmodel-00040-of-00048.safetensors 3.3 GiBmodel-00042-of-00048.safetensors 3.3 GiBmodel-00044-of-00048.safetensors 3.3 GiBmodel-00006-of-00048.safetensors 3.3 GiBmodel-00008-of-00048.safetensors 3.3 GiBmodel-00010-of-00048.safetensors 3.3 GiBmodel-00013-of-00048.safetensors 3.3 GiBmodel-00015-of-00048.safetensors 3.3 GiBmodel-00017-of-00048.safetensors 3.3 GiBmodel-00019-of-00048.safetensors 3.3 GiBmodel-00021-of-00048.safetensors 3.3 GiBmodel-00023-of-00048.safetensors 3.3 GiBmodel-00025-of-00048.safetensors 3.3 GiBmodel-00027-of-00048.safetensors 3.3 GiBmodel-00029-of-00048.safetensors 3.3 GiBmodel-00031-of-00048.safetensors 3.3 GiBmodel-00033-of-00048.safetensors 3.3 GiBmodel-00035-of-00048.safetensors 3.3 GiBmodel-00037-of-00048.safetensors 3.3 GiBmodel-00039-of-00048.safetensors 3.3 GiBmodel-00041-of-00048.safetensors 3.3 GiBmodel-00043-of-00048.safetensors 3.3 GiBmodel-00005-of-00048.safetensors 3.3 GiBmodel-00007-of-00048.safetensors 3.3 GiBmodel-00009-of-00048.safetensors 3.3 GiBmodel-00011-of-00048.safetensors 3.3 GiBmodel-00002-of-00048.safetensors 3.3 GiBmodel-00003-of-00048.safetensors 3.3 GiBmodel-00047-of-00048.safetensors 3.3 GiBmodel-00045-of-00048.safetensors 1010 MiBmodel-00001-of-00048.safetensors 1010 MiBdocker compose up -d # image riverhouse/glm52-hybrid:v1.4-cfe43b0 (vLLM 0.11.2.dev279+eldritch.enlightenment...b12x7bfc945.cu132, b12x/sparkinfer 0.30.0)
vllm serve /model --served-model-name DeepSeek-V4-Flash-0731 --trust-remote-code --tensor-parallel-size 4 --kv-cache-dtype fp8_ds_mla --moe-backend b12x --load-format safetensors -cc.pass_config.fuse_allreduce_rms=True --gpu-memory-utilization 0.90 --max-model-len 262144 --max-num-seqs 8 --max-num-batched-tokens 8192 --max-cudagraph-capture-size 48 --async-scheduling --enable-chunked-prefill --enable-auto-tool-choice --tokenizer-mode deepseek_v4 --tool-call-parser deepseek_v4 --reasoning-parser deepseek_v4 --speculative-config '{"method":"dspark","num_speculative_tokens":5,"moe_backend":"b12x","draft_sample_method":"probabilistic"}'
# env: CUTE_DSL_ARCH=sm_120a VLLM_USE_V2_MODEL_RUNNER=1 VLLM_USE_B12X_MOE=1 VLLM_USE_B12X_SPARSE_INDEXER=1 VLLM_USE_B12X_FP8_GEMM=0 B12X_DENSE_SPLITK_TURBO=1 B12X_MLA_SM120_PREFILL_F16_ROPE=1 NCCL_P2P_DISABLE=1 NCCL_IB_DISABLE=1 NCCL_P2P_LEVEL=SYS NCCL_PROTO=LL,LL128,Simple VLLM_ENABLE_PCIE_ALLREDUCE=0
# Notes: Threadripper PRO topology deadlocks on PCIe P2P, so P2P is disabled. b12x MoE is used; b12x MLA (B12X_MLA_SPARSE) is NOT usable for DeepSeek-V4 in b12x 0.30.0 (DSV4 topk-128 MG prefill dispatcher passes scale_format= to io_issue_gather_dsv4_nope(), which rejects it). VLLM_USE_B12X_FP8_GEMM must be 0 with DSpark or deep_gemm fp8_einsum hits a layout assertion during drafter warmup. DSpark requires decode-context-parallel-size 1. DeepseekV4 ds_mla accepts fp8_ds_mla only, not nvfp4_ds_mla.View run on LocalMaxxing vllm serve deepseek-ai/DeepSeek-V4-Flash-0731 --pipeline-parallel-size 4 --kv-cache-dtype fp8 --gpu-memory-utilization 0.90 --trust-remote-codeView run on LocalMaxxing
llama-bench -m Qwen3.5-9B-DeepSeek-V4-Flash-MTP-Q4_K_M.gguf -p 16384 -n 128 -ngl 999 -fa on -ctk f16 -ctv f16 -fitt 1024 -r 5View run on LocalMaxxing
llama-server -m DeepSeek-V4-Flash-0731-AD-IQ1_M.gguf -md dspark-DeepSeek-V4-Flash-0731-MXFP4.gguf --spec-type draft-dspark --spec-draft-n-max 5 -ngl 99 --flash-attn auto --no-mmap -ts 0.8/1.05/1.15 -ctk f16 -ctv f16 -c 32768 -np 1View run on LocalMaxxing
docker run -d --name lsv-dsv4f-iq2m-v16 --gpus all --ipc=host -p 127.0.0.1:8000:8000 -v /mnt/models:/mnt/models -v /mnt/models/cache:/root/.cache -e HF_HOME=/mnt/models/hf ghcr.io/ggml-org/llama.cpp@sha256:b51c252687249a6990ae1c168156cb215c954bfd71f9c434eda9a065b1a40dbe -m /mnt/models/gguf/DeepSeek-V4-Flash-IQ2M/UD-IQ2_M/DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf --host 0.0.0.0 --port 8000 -fa on -c 32768 -np 8 --jinja -t 8 -tb 16 --metrics -b 4096 -ub 2048 -lm noneView run on LocalMaxxing
docker run -d --name lsv-dsv4f-q2kxl-kv4-np16-t8-fit --device /dev/dri:/dev/dri --shm-size 32g -p 127.0.0.1:8000:8000 -v /mnt/models:/mnt/models -v /mnt/models/cache:/root/.cache -e HF_HOME=/mnt/models/hf ghcr.io/ggml-org/llama.cpp@sha256:bf9a9d6290f917eb040e4313ecdab2a88757d18fc16311298a88b6c0e4a8c7fb -m /mnt/models/gguf/DeepSeek-V4-Flash/UD-Q2_K_XL/DeepSeek-V4-Flash-0731-UD-Q2_K_XL-00001-of-00003.gguf --host 0.0.0.0 --port 8000 -fa on -c 65536 -np 16 --jinja -t 8 -tb 16 --metrics -ctk q4_0 -ctv q4_0 -b 4096 -ub 2048 -lm noneView run on LocalMaxxing
Median of 113 community runs on 15 setups, from LocalMaxxing.
Run it yourself: setup guideunsloth/DeepSeek-V4-Flash-0731-GGUF Magnet 1