Instructions to use tiny-random/deepseek-v4.1-flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/deepseek-v4.1-flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/deepseek-v4.1-flash") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("tiny-random/deepseek-v4.1-flash", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/deepseek-v4.1-flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/deepseek-v4.1-flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/deepseek-v4.1-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiny-random/deepseek-v4.1-flash
- SGLang
How to use tiny-random/deepseek-v4.1-flash 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 "tiny-random/deepseek-v4.1-flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/deepseek-v4.1-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "tiny-random/deepseek-v4.1-flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/deepseek-v4.1-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiny-random/deepseek-v4.1-flash with Docker Model Runner:
docker model run hf.co/tiny-random/deepseek-v4.1-flash
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -31,26 +31,10 @@ Note:
|
|
| 31 |
| Quantization | Routed experts FP4; most other linears FP8; UE8M0 scales; 32x32 blocks | Same |
|
| 32 |
| Public checkpoint | 96,085 tensors; ~510.3 GB | 1,629 tensors; 96.7 MB |
|
| 33 |
|
| 34 |
-
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
- The structure is derived by instantiating DeepSeek's pinned official V4.1 inference
|
| 40 |
-
implementation on the meta device, then converting its runtime state back to the
|
| 41 |
-
public Hugging Face checkpoint representation. The original and 1017 releases have
|
| 42 |
-
byte-identical source `config.json` and checkpoint index (96,085 tensor names), so
|
| 43 |
-
the 1017 source tree is also the authoritative executable structure for this release.
|
| 44 |
-
|
| 45 |
-
- The SGLang example is intentionally a conservative TP=2 launch. The
|
| 46 |
-
attention latent stays 512-wide and the indexer stays 128-wide because those are
|
| 47 |
-
fixed by SGLang's DSV4 cache/kernel ABI; all TP-sharded widths, head/group counts,
|
| 48 |
-
expert counts, vocabulary rows, and 32-wide quantization blocks divide cleanly by 2.
|
| 49 |
-
The online example enables the embedded three-stage DSpark/MTP draft explicitly.
|
| 50 |
-
|
| 51 |
-
- TP=2 inference with DSpark/MTP and CUDA Graph was validated for both
|
| 52 |
-
text-only and image-plus-text requests on two NVIDIA H20 GPUs, using the
|
| 53 |
-
versions listed under Test environment.
|
| 54 |
|
| 55 |
| File path | Size |
|
| 56 |
|------|------|
|
|
@@ -61,6 +45,13 @@ Note:
|
|
| 61 |
|
| 62 |
- SGLang
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
```bash
|
| 65 |
# Requires an SGLang preview/main build with DeepSeek-V4.1 support.
|
| 66 |
# Runs the target model and its embedded three-stage DSpark/MTP draft with TP=2.
|
|
|
|
| 31 |
| Quantization | Routed experts FP4; most other linears FP8; UE8M0 scales; 32x32 blocks | Same |
|
| 32 |
| Public checkpoint | 96,085 tensors; ~510.3 GB | 1,629 tensors; 96.7 MB |
|
| 33 |
|
| 34 |
+
- Topology (sparse attention + indexer, Hyper-Connections, Engram, DSpark/MTP,
|
| 35 |
+
vision, FP4/FP8 quantization) is preserved with reduced widths and counts.
|
| 36 |
+
Derived from the source inference implementation on the meta device. The
|
| 37 |
+
original and 1017 releases have byte-identical `config.json` and checkpoint index.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
| File path | Size |
|
| 40 |
|------|------|
|
|
|
|
| 45 |
|
| 46 |
- SGLang
|
| 47 |
|
| 48 |
+
- TP=2 inference with DSpark/MTP and CUDA Graph was validated for both
|
| 49 |
+
text-only and image-plus-text requests on two NVIDIA H20 GPUs, using the
|
| 50 |
+
versions listed under Test environment.
|
| 51 |
+
- The attention latent stays 512-wide and the indexer 128-wide per SGLang
|
| 52 |
+
DSV4 ABI; all sharded widths, heads, experts, and vocab rows divide cleanly by TP=2.
|
| 53 |
+
- The online example enables the embedded three-stage DSpark/MTP draft explicitly.
|
| 54 |
+
|
| 55 |
```bash
|
| 56 |
# Requires an SGLang preview/main build with DeepSeek-V4.1 support.
|
| 57 |
# Runs the target model and its embedded three-stage DSpark/MTP draft with TP=2.
|