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
Fix `chat_template` crash when assistant message omits the `content` key
#248 opened 9 days ago
by
qgallouedec
[Feature request] Eliminate pre-attention RMSNorm in MLA-models via scale invariance + weight folding
#247 opened 15 days ago
by
graefics
DeepSeek-R1-1
#246 opened about 1 month ago
by
usmanashe26
Install & run deepseek-ai/DeepSeek-R1 easily using llmpm
#245 opened 2 months ago
by
sarthak-saxena
Using DeepSeek R1 via API Gateway
3
#244 opened 3 months ago
by
xujfcn
Deepseek R1 Request
1
#243 opened 3 months ago
by
bach619
Add MMLU-Pro evaluation result (84.0)
2
#242 opened 4 months ago
by
burtenshaw
Add GPQA evaluation result
1
#241 opened 4 months ago
by
burtenshaw
Add GPQA evaluation results
1
#240 opened 4 months ago
by
nielsr
Upload internal.py
1
#239 opened 4 months ago
by
Ananthusajeev190
[Alignment Analysis] R1 hallucinates medical false equivalencies unless strictly constrained (Diabetes vs Psychiatry)
3
#237 opened 4 months ago
by
felps333
[Hallucination Report] Model hallucinates biological validity in psychiatric analogies
1
#236 opened 4 months ago
by
felps333
Set Max Model Length to correct value
1
#233 opened 8 months ago
by
chandra-reddy
Update README.md
1
#232 opened 8 months ago
by
vivienfanghua
Update README.md
1
#231 opened 9 months ago
by
Brokersponsor
Model's Resource Utilization
4
#230 opened 9 months ago
by
kalashshah19
Update README.md
1
#229 opened 9 months ago
by
ahmedgg12
Tokenizer difference between deepseek and qwen3
1
#227 opened 11 months ago
by
yangsketch
updated version?
👍 1
1
#226 opened 12 months ago
by
CHNtentes
日期出现乱码
2
#225 opened 12 months ago
by
CloudChina
Update README.md
1
#223 opened about 1 year ago
by
Xternn
DeepSeek R1 model Bad Cases Genuine User Reviews and Comments Collection
1
#221 opened about 1 year ago
by
DeepNLP
Update README.md
2
#220 opened about 1 year ago
by
Rudra160113
Update README.md
1
#219 opened about 1 year ago
by
pezhmansamaniii
Update README.md
1
#218 opened about 1 year ago
by
pezhmansamaniii
🚩 Report: Copyright infringement
1
#217 opened about 1 year ago
by
king455
Remove "NOTE: Hugging Face's Transformers has not been directly supported yet." in README
1
#216 opened about 1 year ago
by
andrewrreed
Update README.md
1
#215 opened about 1 year ago
by
rshaikh22
World's Largest Dataset
1
#214 opened about 1 year ago
by deleted
Request: DOI
1
#213 opened about 1 year ago
by
yahyaali77824
Knowledge / Training Cutoff of DeepSeek R1
👍 1
1
#212 opened about 1 year ago
by
MengboZhou
Update README.md
1
#211 opened about 1 year ago
by
Rainbowbeast
Make config params float to avoid warning in Transformers
1
#210 opened about 1 year ago
by
Rocketknight1
Update README.md
1
#209 opened about 1 year ago
by
Brokersponsor
Update README.md
1
#207 opened about 1 year ago
by
mehdi131
Update README.md
1
#206 opened about 1 year ago
by
YUIHG
DeepSeek中o1-1217的数据是哪里来的。我好像没在OpenAI的官方途径找到,谢谢🙏
4
#205 opened about 1 year ago
by
747860199qq
Any R1 reasoning researchers looking for samples?
1
#204 opened about 1 year ago
by
natcolley
Update README.md
1
#203 opened about 1 year ago
by
umar759
Request: DOI
1
#202 opened about 1 year ago
by
Yenugu12
Create 9889555
1
#201 opened about 1 year ago
by
keyi8
Upload 657f0f06e7ea1b09462a7a16_Feedback and evaluation-p-500.png
1
#200 opened about 1 year ago
by
likhonsheikh
Best practice for R1 models evaluation: Reasoning efficiency and Performance by MATH-Level
🔥🚀 1
1
#198 opened about 1 year ago
by
wangxingjun778
DeepSeek R1 full-power version occasionally ends without returning </think>.
👍 1
2
#196 opened about 1 year ago
by
yizhiezi
deepseek满血版偶现结束没有返回 </think>
2
#195 opened about 1 year ago
by
yizhiezi
Standing at a flag in Netherlands
#194 opened about 1 year ago
by
Sweetstacg
Delete Config.json
#193 opened about 1 year ago
by
jana0010
Update README.md
#192 opened about 1 year ago
by
caraanchoa
为助手回答添加 <think>\n> 标签,确保一致性
#191 opened about 1 year ago
by
REN0430