Instructions to use drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid
- SGLang
How to use drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid 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 "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid" \ --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": "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid", "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 "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid" \ --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": "drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid with Docker Model Runner:
docker model run hf.co/drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid
DeepSeek-V4.1-Flash TR3 Hybrid
Custom hybrid quant of deepseek-ai/DeepSeek-V4.1-Flash for 4× NVIDIA DGX Spark (GB10).
This is not a uniform 3.5 bpw Pollard EXL3 pack. It is a TR3 hybrid: most routed experts are EXL3 3.0 bpw, the 64 hardest experts per layer stay native MXFP4.
Bits per weight
| Piece | Format | BPW |
|---|---|---|
| Routed tail | EXL3-TR3 K=3, codebook mcg | 3.0 |
| Routed keep-64 / layer | native MXFP4 (E2M1 + UE8M0/32) | 4.25 |
| Expert-weighted mix | 64 keep + rest tail | ≈3.22 |
| Attention, shared expert, norms, embeddings | official FP8 / native | unchanged |
| Engram (shards 47–48) | official, hardlinked | unchanged (~203 GB) |
Do not label this repo “3 bpw only.” The honest headline is 3.0 bpw EXL3-TR3 tail + 64 MXFP4 keeps/layer (~3.22 bpw MoE mix).
Disk: official 476 GB → this pack 410 GB (48 shards). Non-Engram 273 → 207 GB (~0.76×), matching 320/384 experts at 3/4.25 and 64/384 kept MXFP4.
Recipe
- Source:
deepseek-ai/DeepSeek-V4.1-Flash(552B backbone, 384 routed + 1 shared, top-6,moe_intermediate_size=2304, 1M context). - Keep: 64 experts/layer with the highest trellis round-trip error, left as MXFP4.
- Tail: EXL3 K3 mcg, full expert matrices (2304 and 5120 are both
% 128 == 0). - DSpark layers 37–39: 128 routed experts; still keep-64, so 64 tail on those layers.
- Hessian: identity /
q_fallback(Pass A does not fit 4×128 GB unified memory). - Smoke: identity-H mcg 5120×2304, nmse 1.74e-2.
- Encoder:
encode_dsv41_tr3.pywrapping the TR3 numeric core.
config.json field hybrid_tr3_tail: bits: 3.0, codebook: mcg, keep_mxfp4_per_layer: 64.
Credit
The hybrid quant method is brandonmusic’s TR3 recipe, first published as brandonmusic/GLM-5.2-NVFP4-TR3-Hybrid: keep the highest round-trip-error experts in native 4-bit, EXL3-TR3 K3 mcg on the tail, same numeric core (encode_tr3_v31.py). This checkpoint ports that method onto DeepSeek-V4.1-Flash. If you use these weights, credit brandonmusic for the hybrid quant.
Also:
- DeepSeek-AI for the base model.
- EXL3 trellis / mcg as used in that TR3 pipeline.
This pack is not bot-lab-21/DeepSeek-V4.1-Flash-EXL3-3.5bpw-Pollard (uniform ~3.51 bpw Pollard on all routed experts). Different method, different BPW mix.
Intended runtime (4× DGX Spark)
EXL3 GEMM requires N % 128 == 0. Uniform TP4 on 2304-wide experts is 2304/4 = 576 (illegal). Options that are legal:
- Plugin expert-parallel: 96 full-width 2304 experts/rank (this lab’s hybrid path).
- Uneven TP4 slice
512/640/640/512(Tony / cuda-exl3 128-aligned split). - TP3:
2304/3 = 768(legal); needs V4.1 TP3 patches (virtual heads 64→72, etc.).
License
MIT, same as the DeepSeek-V4.1-Flash release.
- Downloads last month
- 55
Model tree for drowzeys/DeepSeek-V4.1-Flash-TR3-Hybrid
Base model
deepseek-ai/DeepSeek-V4.1-Flash