Instructions to use onnxruntime/DeepSeek-R1-Distill-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onnxruntime/DeepSeek-R1-Distill-ONNX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="onnxruntime/DeepSeek-R1-Distill-ONNX")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("onnxruntime/DeepSeek-R1-Distill-ONNX", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use onnxruntime/DeepSeek-R1-Distill-ONNX with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "onnxruntime/DeepSeek-R1-Distill-ONNX" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onnxruntime/DeepSeek-R1-Distill-ONNX", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/onnxruntime/DeepSeek-R1-Distill-ONNX
- SGLang
How to use onnxruntime/DeepSeek-R1-Distill-ONNX 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 "onnxruntime/DeepSeek-R1-Distill-ONNX" \ --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": "onnxruntime/DeepSeek-R1-Distill-ONNX", "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 "onnxruntime/DeepSeek-R1-Distill-ONNX" \ --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": "onnxruntime/DeepSeek-R1-Distill-ONNX", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use onnxruntime/DeepSeek-R1-Distill-ONNX with Docker Model Runner:
docker model run hf.co/onnxruntime/DeepSeek-R1-Distill-ONNX
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,9 +23,10 @@ huggingface-cli download onnxruntime/DeepSeek-R1-Distill-ONNX --include deepseek
|
|
| 23 |
# Install the CPU package of ONNX Runtime GenAI
|
| 24 |
pip install onnxruntime-genai
|
| 25 |
|
| 26 |
-
# Please adjust the model directory (-m) accordingly
|
| 27 |
-
curl
|
| 28 |
-
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
For CUDA:
|
|
@@ -37,9 +38,10 @@ huggingface-cli download onnxruntime/DeepSeek-R1-Distill-ONNX --include deepseek
|
|
| 37 |
# Install the CUDA package of ONNX Runtime GenAI
|
| 38 |
pip install onnxruntime-genai-cuda
|
| 39 |
|
| 40 |
-
# Please adjust the model directory (-m) accordingly
|
| 41 |
-
curl
|
| 42 |
-
|
|
|
|
| 43 |
```
|
| 44 |
|
| 45 |
For DirectML:
|
|
@@ -51,9 +53,10 @@ huggingface-cli download onnxruntime/DeepSeek-R1-Distill-ONNX --include deepseek
|
|
| 51 |
# Install the DirectML package of ONNX Runtime GenAI
|
| 52 |
pip install onnxruntime-genai-directml
|
| 53 |
|
| 54 |
-
# Please adjust the model directory (-m) accordingly
|
| 55 |
-
curl
|
| 56 |
-
|
|
|
|
| 57 |
```
|
| 58 |
|
| 59 |
|
|
|
|
| 23 |
# Install the CPU package of ONNX Runtime GenAI
|
| 24 |
pip install onnxruntime-genai
|
| 25 |
|
| 26 |
+
# Please adjust the model directory (-m) accordingly
|
| 27 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
|
| 28 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-chat.py -o model-chat.py
|
| 29 |
+
python model-chat.py -m /path/to/cpu-int4-rtn-block-32-acc-level-4/ -e cpu
|
| 30 |
```
|
| 31 |
|
| 32 |
For CUDA:
|
|
|
|
| 38 |
# Install the CUDA package of ONNX Runtime GenAI
|
| 39 |
pip install onnxruntime-genai-cuda
|
| 40 |
|
| 41 |
+
# Please adjust the model directory (-m) accordingly
|
| 42 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
|
| 43 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-chat.py -o model-chat.py
|
| 44 |
+
python model-chat.py -m /path/to/gpu-int4-rtn-block-32/ -e cuda
|
| 45 |
```
|
| 46 |
|
| 47 |
For DirectML:
|
|
|
|
| 53 |
# Install the DirectML package of ONNX Runtime GenAI
|
| 54 |
pip install onnxruntime-genai-directml
|
| 55 |
|
| 56 |
+
# Please adjust the model directory (-m) accordingly
|
| 57 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
|
| 58 |
+
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-chat.py -o model-chat.py
|
| 59 |
+
python model-chat.py -m /path/to/gpu-int4-rtn-block-32/ -e dml
|
| 60 |
```
|
| 61 |
|
| 62 |
|