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
Document tested SGLang environment
Browse files
README.md
CHANGED
|
@@ -48,9 +48,8 @@ Note:
|
|
| 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 with DSpark/MTP and CUDA Graph was validated on two NVIDIA H20 GPUs
|
| 52 |
-
|
| 53 |
-
`0.5.23.dev384+g9ab74b851`, FlashInfer 0.7.2, and Transformers 5.19.0.
|
| 54 |
|
| 55 |
| File path | Size |
|
| 56 |
|------|------|
|
|
@@ -64,7 +63,7 @@ Note:
|
|
| 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.
|
| 67 |
-
model_id=
|
| 68 |
sglang serve \
|
| 69 |
--model-path $model_id \
|
| 70 |
--trust-remote-code \
|
|
@@ -98,7 +97,7 @@ from safetensors.torch import save_file
|
|
| 98 |
from transformers import AutoTokenizer
|
| 99 |
|
| 100 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash"
|
| 101 |
-
save_folder = "/tmp/
|
| 102 |
source_revision = "314113f8a7dadb388215396ba5fbee2c610a04d6"
|
| 103 |
implementation_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 104 |
implementation_revision = "1bae0e1088993b9b82de08f59de5be5a34e42170"
|
|
@@ -569,15 +568,16 @@ main()
|
|
| 569 |
|
| 570 |
### Test environment:
|
| 571 |
|
| 572 |
-
- Pillow: 12.
|
| 573 |
-
- flashinfer-python: 0.
|
| 574 |
-
- huggingface_hub: 1.
|
| 575 |
-
- numpy: 2.
|
| 576 |
- safetensors: 0.8.0
|
|
|
|
| 577 |
- sympy: 1.14.0
|
| 578 |
- tilelang: 0.1.12
|
| 579 |
-
- torch: 2.
|
| 580 |
-
- transformers: 5.
|
| 581 |
|
| 582 |
### Change log:
|
| 583 |
|
|
|
|
| 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 with DSpark/MTP and CUDA Graph was validated on two NVIDIA H20 GPUs
|
| 52 |
+
using the versions listed under Test environment.
|
|
|
|
| 53 |
|
| 54 |
| File path | Size |
|
| 55 |
|------|------|
|
|
|
|
| 63 |
```bash
|
| 64 |
# Requires an SGLang preview/main build with DeepSeek-V4.1 support.
|
| 65 |
# Runs the target model and its embedded three-stage DSpark/MTP draft with TP=2.
|
| 66 |
+
model_id=yujiepan/deepseek-v4.1-flash-tiny-random
|
| 67 |
sglang serve \
|
| 68 |
--model-path $model_id \
|
| 69 |
--trust-remote-code \
|
|
|
|
| 97 |
from transformers import AutoTokenizer
|
| 98 |
|
| 99 |
source_model_id = "deepseek-ai/DeepSeek-V4.1-Flash"
|
| 100 |
+
save_folder = "/tmp/yujiepan/deepseek-v41-flash-tiny-random"
|
| 101 |
source_revision = "314113f8a7dadb388215396ba5fbee2c610a04d6"
|
| 102 |
implementation_model_id = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
|
| 103 |
implementation_revision = "1bae0e1088993b9b82de08f59de5be5a34e42170"
|
|
|
|
| 568 |
|
| 569 |
### Test environment:
|
| 570 |
|
| 571 |
+
- Pillow: 12.2.0
|
| 572 |
+
- flashinfer-python: 0.7.2
|
| 573 |
+
- huggingface_hub: 1.33.0
|
| 574 |
+
- numpy: 2.3.5
|
| 575 |
- safetensors: 0.8.0
|
| 576 |
+
- sglang: 0.5.23.dev384+g9ab74b851
|
| 577 |
- sympy: 1.14.0
|
| 578 |
- tilelang: 0.1.12
|
| 579 |
+
- torch: 2.14.1
|
| 580 |
+
- transformers: 5.19.0
|
| 581 |
|
| 582 |
### Change log:
|
| 583 |
|