Text Generation
Transformers
Safetensors
deepseek_v3
conversational
custom_code
Eval Results
text-generation-inference
fp8
Instructions to use deepseek-ai/DeepSeek-R1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-R1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-R1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use deepseek-ai/DeepSeek-R1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/DeepSeek-R1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-R1
- SGLang
How to use deepseek-ai/DeepSeek-R1 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 "deepseek-ai/DeepSeek-R1" \ --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": "deepseek-ai/DeepSeek-R1", "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 "deepseek-ai/DeepSeek-R1" \ --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": "deepseek-ai/DeepSeek-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-R1 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-R1
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,172 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
library_name: transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
# DeepSeek-R1
|
| 6 |
<!-- markdownlint-disable first-line-h1 -->
|
|
@@ -236,4 +402,4 @@ DeepSeek-R1 series support commercial use, allow for any modifications and deriv
|
|
| 236 |
```
|
| 237 |
|
| 238 |
## 9. Contact
|
| 239 |
-
If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
library_name: transformers
|
| 4 |
+
datasets:
|
| 5 |
+
- nvidia/OpenCodeReasoning
|
| 6 |
+
language:
|
| 7 |
+
- aa
|
| 8 |
+
- ab
|
| 9 |
+
- ae
|
| 10 |
+
- af
|
| 11 |
+
- ak
|
| 12 |
+
- am
|
| 13 |
+
- an
|
| 14 |
+
- ar
|
| 15 |
+
- as
|
| 16 |
+
- av
|
| 17 |
+
- ay
|
| 18 |
+
- az
|
| 19 |
+
- ba
|
| 20 |
+
- be
|
| 21 |
+
- bg
|
| 22 |
+
- bh
|
| 23 |
+
- bi
|
| 24 |
+
- bm
|
| 25 |
+
- bn
|
| 26 |
+
- bo
|
| 27 |
+
- br
|
| 28 |
+
- bs
|
| 29 |
+
- ca
|
| 30 |
+
- ce
|
| 31 |
+
- ch
|
| 32 |
+
- co
|
| 33 |
+
- cr
|
| 34 |
+
- cs
|
| 35 |
+
- cu
|
| 36 |
+
- cv
|
| 37 |
+
- cy
|
| 38 |
+
- da
|
| 39 |
+
- de
|
| 40 |
+
- dv
|
| 41 |
+
- dz
|
| 42 |
+
- ee
|
| 43 |
+
- el
|
| 44 |
+
- en
|
| 45 |
+
- eo
|
| 46 |
+
- es
|
| 47 |
+
- et
|
| 48 |
+
- eu
|
| 49 |
+
- fa
|
| 50 |
+
- ff
|
| 51 |
+
- fi
|
| 52 |
+
- fj
|
| 53 |
+
- fo
|
| 54 |
+
- fr
|
| 55 |
+
- fy
|
| 56 |
+
- ga
|
| 57 |
+
- gd
|
| 58 |
+
- gl
|
| 59 |
+
- gn
|
| 60 |
+
- gu
|
| 61 |
+
- gv
|
| 62 |
+
- ha
|
| 63 |
+
- he
|
| 64 |
+
- hi
|
| 65 |
+
- ho
|
| 66 |
+
- hr
|
| 67 |
+
- ht
|
| 68 |
+
- hu
|
| 69 |
+
- hy
|
| 70 |
+
- hz
|
| 71 |
+
- ia
|
| 72 |
+
- id
|
| 73 |
+
- ie
|
| 74 |
+
- ig
|
| 75 |
+
- ii
|
| 76 |
+
- ik
|
| 77 |
+
- io
|
| 78 |
+
- is
|
| 79 |
+
- it
|
| 80 |
+
- iu
|
| 81 |
+
- ja
|
| 82 |
+
- jv
|
| 83 |
+
- ka
|
| 84 |
+
- kg
|
| 85 |
+
- ki
|
| 86 |
+
- kj
|
| 87 |
+
- kk
|
| 88 |
+
- kl
|
| 89 |
+
- km
|
| 90 |
+
- kn
|
| 91 |
+
- ko
|
| 92 |
+
- kr
|
| 93 |
+
- ks
|
| 94 |
+
- ku
|
| 95 |
+
- kv
|
| 96 |
+
- kw
|
| 97 |
+
- ky
|
| 98 |
+
- la
|
| 99 |
+
- lb
|
| 100 |
+
- lg
|
| 101 |
+
- li
|
| 102 |
+
- ln
|
| 103 |
+
- lo
|
| 104 |
+
- lt
|
| 105 |
+
- lu
|
| 106 |
+
- lv
|
| 107 |
+
- mg
|
| 108 |
+
- mh
|
| 109 |
+
- mi
|
| 110 |
+
- mk
|
| 111 |
+
- ml
|
| 112 |
+
- mn
|
| 113 |
+
- mr
|
| 114 |
+
- ms
|
| 115 |
+
- mt
|
| 116 |
+
- my
|
| 117 |
+
- na
|
| 118 |
+
- nb
|
| 119 |
+
- nd
|
| 120 |
+
- ne
|
| 121 |
+
- ng
|
| 122 |
+
- nl
|
| 123 |
+
- nn
|
| 124 |
+
- 'no'
|
| 125 |
+
- nr
|
| 126 |
+
- nv
|
| 127 |
+
- ny
|
| 128 |
+
- oj
|
| 129 |
+
- oc
|
| 130 |
+
- om
|
| 131 |
+
- or
|
| 132 |
+
- os
|
| 133 |
+
- pa
|
| 134 |
+
- pi
|
| 135 |
+
- pl
|
| 136 |
+
- ps
|
| 137 |
+
- pt
|
| 138 |
+
- qu
|
| 139 |
+
- rm
|
| 140 |
+
- rn
|
| 141 |
+
- ro
|
| 142 |
+
- ru
|
| 143 |
+
- rw
|
| 144 |
+
- sa
|
| 145 |
+
- sc
|
| 146 |
+
- sd
|
| 147 |
+
- se
|
| 148 |
+
- sg
|
| 149 |
+
- si
|
| 150 |
+
- sk
|
| 151 |
+
- sl
|
| 152 |
+
- sm
|
| 153 |
+
- sn
|
| 154 |
+
- so
|
| 155 |
+
- sq
|
| 156 |
+
- sr
|
| 157 |
+
- ss
|
| 158 |
+
- st
|
| 159 |
+
- su
|
| 160 |
+
- sv
|
| 161 |
+
- sw
|
| 162 |
+
- ta
|
| 163 |
+
- te
|
| 164 |
+
metrics:
|
| 165 |
+
- accuracy
|
| 166 |
+
- bertscore
|
| 167 |
+
base_model:
|
| 168 |
+
- deepseek-ai/DeepSeek-V3-0324
|
| 169 |
+
new_version: deepseek-ai/DeepSeek-V3-0324
|
| 170 |
---
|
| 171 |
# DeepSeek-R1
|
| 172 |
<!-- markdownlint-disable first-line-h1 -->
|
|
|
|
| 402 |
```
|
| 403 |
|
| 404 |
## 9. Contact
|
| 405 |
+
If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).
|