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
Upload folder using huggingface_hub
Browse files- .meta.json +7 -6
- README.md +5 -4
.meta.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
{
|
| 2 |
-
"Pillow": "12.
|
| 3 |
-
"flashinfer-python": "0.
|
| 4 |
-
"huggingface_hub": "1.
|
| 5 |
-
"numpy": "2.
|
| 6 |
"safetensors": "0.8.0",
|
|
|
|
| 7 |
"sympy": "1.14.0",
|
| 8 |
"tilelang": "0.1.12",
|
| 9 |
-
"torch": "2.
|
| 10 |
-
"transformers": "5.
|
| 11 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"Pillow": "12.2.0",
|
| 3 |
+
"flashinfer-python": "0.7.2",
|
| 4 |
+
"huggingface_hub": "1.33.0",
|
| 5 |
+
"numpy": "2.3.5",
|
| 6 |
"safetensors": "0.8.0",
|
| 7 |
+
"sglang": "0.5.23.dev384+g9ab74b851",
|
| 8 |
"sympy": "1.14.0",
|
| 9 |
"tilelang": "0.1.12",
|
| 10 |
+
"torch": "2.14.1",
|
| 11 |
+
"transformers": "5.19.0"
|
| 12 |
}
|
README.md
CHANGED
|
@@ -46,8 +46,9 @@ 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
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
| File path | Size |
|
| 53 |
|------|------|
|
|
@@ -61,7 +62,7 @@ Note:
|
|
| 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=
|
| 65 |
sglang serve \
|
| 66 |
--model-path $model_id \
|
| 67 |
--trust-remote-code \
|
|
@@ -95,7 +96,7 @@ from safetensors.torch import save_file
|
|
| 95 |
from transformers import AutoTokenizer
|
| 96 |
|
| 97 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 98 |
-
save_folder = "/tmp/
|
| 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
|
|
|
|
| 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 inference with DSpark/MTP and CUDA Graph was validated for both
|
| 50 |
+
text-only and image-plus-text requests on two NVIDIA H20 GPUs, using the
|
| 51 |
+
versions listed under Test environment.
|
| 52 |
|
| 53 |
| File path | Size |
|
| 54 |
|------|------|
|
|
|
|
| 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=tiny-random/deepseek-v4.1-flash-1017
|
| 66 |
sglang serve \
|
| 67 |
--model-path $model_id \
|
| 68 |
--trust-remote-code \
|
|
|
|
| 96 |
from transformers import AutoTokenizer
|
| 97 |
|
| 98 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 99 |
+
save_folder = "/tmp/tiny-random/deepseek-v41-flash-1017"
|
| 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
|