Instructions to use EnvLoop/DeepSeek-V4.1-Flash-1017-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EnvLoop/DeepSeek-V4.1-Flash-1017-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EnvLoop/DeepSeek-V4.1-Flash-1017-bf16")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("EnvLoop/DeepSeek-V4.1-Flash-1017-bf16", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EnvLoop/DeepSeek-V4.1-Flash-1017-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EnvLoop/DeepSeek-V4.1-Flash-1017-bf16
- SGLang
How to use EnvLoop/DeepSeek-V4.1-Flash-1017-bf16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EnvLoop/DeepSeek-V4.1-Flash-1017-bf16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EnvLoop/DeepSeek-V4.1-Flash-1017-bf16 with Docker Model Runner:
docker model run hf.co/EnvLoop/DeepSeek-V4.1-Flash-1017-bf16
DeepSeek-V4.1-Flash-1017-bf16
A bfloat16 re-export of deepseek-ai/DeepSeek-V4.1-Flash-1017
(revision 1bae0e1088993b9b82de08f59de5be5a34e42170) under the published tensor names, in the same
layout as PrimeIntellect/DeepSeek-V4.1-Flash-bf16.
The dense linears (fp8 e4m3, ue8m0 scales over 32x32 blocks) and the routed experts (MXFP4, ue8m0 scales
over 1x32 groups) are dequantized to plain bfloat16. Every fp8 / fp4 value times its power-of-two scale is
representable in bfloat16, so the dequantization is exact. 48 safetensors shards, 1.34 TB, with the same
tensor-to-shard assignment as upstream. Published by EnvLoop.
Differences from upstream
quantization_configremoved fromconfig.json. An engine that reads it allocates fp8 and MXFP4 parameters, which bfloat16 weights cannot fill.- The two engram tables (
layers.1.engram.embedandlayers.14.engram.embed, ~98B parameters each) are not dequantized: they keep the upstream fp8 e4m3 weight and 1x32 ue8m0.scale, because vLLM's engram is fp8-only. In bfloat16 they would add ~197 GB. - All other
.scaletensors are dropped (47,587 of them, folded into the bf16 weights). - Everything else is copied unchanged: fp32 tensors (mHC, attention sinks, biases), already-bf16 tensors,
the vision tower, the MTP / DSpark weights, the tokenizer,
encoding/andinference/. - Tensor dtypes in the export: 48,107 bf16, 387 fp32, 2 fp8 e4m3 and 2 e8m0 (48,498 tensors in total).
Verification
- Tensor names, shapes and dtypes match the index and safetensors headers of
PrimeIntellect/DeepSeek-V4.1-Flash-bf16exactly (same architecture). - 160 dequantized tensors (dense fp8 from layers 0 / 20 / 39 and MTP, shared experts, routed experts from layers 0 / 20 / 39 and MTP) were checked against an independent numpy decode (e4m3 and e2m1 bit formulas times 2^(e8m0 - 127) per block); all are bit-exact.
- Non-quantized tensors, including both engram tables, are byte-identical to the source.
Use
Same layout as PrimeIntellect's export, so the same usage should apply (vLLM without quantization_config,
optionally with online fp8 via quantization = "fp8"; prime-rl model.name). Not yet tested by us on this
1017 export.
Credits and license
The dequantization math is prime-rl's src/prime_rl/trainer/models/deepseek_v4/dequantize.py
(commit fffdbe98dc4a34044376c8e09c54406b349d195f), used unmodified. The layout follows PrimeIntellect's
DeepSeek-V4.1-Flash-bf16 export.
MIT, inherited from upstream. The upstream LICENSE is included verbatim.
- Downloads last month
- 166
Model tree for EnvLoop/DeepSeek-V4.1-Flash-1017-bf16
Base model
deepseek-ai/DeepSeek-V4.1-Flash-1017