Instructions to use tiny-random/deepseek-v4.1-flash-1017 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-1017 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-1017")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("tiny-random/deepseek-v4.1-flash-1017", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/deepseek-v4.1-flash-1017 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-1017" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/deepseek-v4.1-flash-1017", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiny-random/deepseek-v4.1-flash-1017
- SGLang
How to use tiny-random/deepseek-v4.1-flash-1017 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-1017" \ --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": "tiny-random/deepseek-v4.1-flash-1017", "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 "tiny-random/deepseek-v4.1-flash-1017" \ --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": "tiny-random/deepseek-v4.1-flash-1017", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiny-random/deepseek-v4.1-flash-1017 with Docker Model Runner:
docker model run hf.co/tiny-random/deepseek-v4.1-flash-1017
Document tested SGLang environment
Browse files
README.md
CHANGED
|
@@ -46,9 +46,8 @@ Note:
|
|
| 46 |
expert counts, vocabulary rows, and 32-wide quantization blocks divide cleanly by 2.
|
| 47 |
The online example enables the embedded three-stage DSpark/MTP draft explicitly.
|
| 48 |
|
| 49 |
-
- TP=2 with DSpark/MTP and CUDA Graph was validated on two NVIDIA H20 GPUs
|
| 50 |
-
|
| 51 |
-
`0.5.23.dev384+g9ab74b851`, FlashInfer 0.7.2, and Transformers 5.19.0.
|
| 52 |
|
| 53 |
| File path | Size |
|
| 54 |
|------|------|
|
|
@@ -62,7 +61,7 @@ Note:
|
|
| 62 |
```bash
|
| 63 |
# Requires an SGLang preview/main build with DeepSeek-V4.1 support.
|
| 64 |
# Runs the target model and its embedded three-stage DSpark/MTP draft with TP=2.
|
| 65 |
-
model_id=
|
| 66 |
sglang serve \
|
| 67 |
--model-path $model_id \
|
| 68 |
--trust-remote-code \
|
|
@@ -96,7 +95,7 @@ from safetensors.torch import save_file
|
|
| 96 |
from transformers import AutoTokenizer
|
| 97 |
|
| 98 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 99 |
-
save_folder = "/tmp/
|
| 100 |
source_revision = "1bae0e1088993b9b82de08f59de5be5a34e42170"
|
| 101 |
# DeepSeek-V4.1-Flash-1017 is a multimodal (vision + text) MoE model. The released checkpoint uses the
|
| 102 |
# inference-stack tensor naming (see the repo's inference/model.py), not HF-transformers naming, so
|
|
@@ -565,15 +564,16 @@ main()
|
|
| 565 |
|
| 566 |
### Test environment:
|
| 567 |
|
| 568 |
-
- Pillow: 12.
|
| 569 |
-
- flashinfer-python: 0.
|
| 570 |
-
- huggingface_hub: 1.
|
| 571 |
-
- numpy: 2.
|
| 572 |
- safetensors: 0.8.0
|
|
|
|
| 573 |
- sympy: 1.14.0
|
| 574 |
- tilelang: 0.1.12
|
| 575 |
-
- torch: 2.
|
| 576 |
-
- transformers: 5.
|
| 577 |
|
| 578 |
### Change log:
|
| 579 |
|
|
|
|
| 46 |
expert counts, vocabulary rows, and 32-wide quantization blocks divide cleanly by 2.
|
| 47 |
The online example enables the embedded three-stage DSpark/MTP draft explicitly.
|
| 48 |
|
| 49 |
+
- TP=2 with DSpark/MTP and CUDA Graph was validated on two NVIDIA H20 GPUs
|
| 50 |
+
using the versions listed under Test environment.
|
|
|
|
| 51 |
|
| 52 |
| File path | Size |
|
| 53 |
|------|------|
|
|
|
|
| 61 |
```bash
|
| 62 |
# Requires an SGLang preview/main build with DeepSeek-V4.1 support.
|
| 63 |
# Runs the target model and its embedded three-stage DSpark/MTP draft with TP=2.
|
| 64 |
+
model_id=yujiepan/deepseek-v4.1-flash-1017-tiny-random
|
| 65 |
sglang serve \
|
| 66 |
--model-path $model_id \
|
| 67 |
--trust-remote-code \
|
|
|
|
| 95 |
from transformers import AutoTokenizer
|
| 96 |
|
| 97 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 98 |
+
save_folder = "/tmp/yujiepan/deepseek-v41-flash-1017-tiny-random"
|
| 99 |
source_revision = "1bae0e1088993b9b82de08f59de5be5a34e42170"
|
| 100 |
# DeepSeek-V4.1-Flash-1017 is a multimodal (vision + text) MoE model. The released checkpoint uses the
|
| 101 |
# inference-stack tensor naming (see the repo's inference/model.py), not HF-transformers naming, so
|
|
|
|
| 564 |
|
| 565 |
### Test environment:
|
| 566 |
|
| 567 |
+
- Pillow: 12.2.0
|
| 568 |
+
- flashinfer-python: 0.7.2
|
| 569 |
+
- huggingface_hub: 1.33.0
|
| 570 |
+
- numpy: 2.3.5
|
| 571 |
- safetensors: 0.8.0
|
| 572 |
+
- sglang: 0.5.23.dev384+g9ab74b851
|
| 573 |
- sympy: 1.14.0
|
| 574 |
- tilelang: 0.1.12
|
| 575 |
+
- torch: 2.14.1
|
| 576 |
+
- transformers: 5.19.0
|
| 577 |
|
| 578 |
### Change log:
|
| 579 |
|