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)# pip install -U transformers accelerate # 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, device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- 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
Upload 657f0f06e7ea1b09462a7a16_Feedback and evaluation-p-500.png
1
#200 opened over 1 year ago
by
likhonsheikh
Best practice for R1 models evaluation: Reasoning efficiency and Performance by MATH-Level
🔥🚀 1
1
#198 opened over 1 year ago
by
wangxingjun778
DeepSeek R1 full-power version occasionally ends without returning </think>.
👍 1
2
#196 opened over 1 year ago
by
yizhiezi
deepseek满血版偶现结束没有返回 </think>
2
#195 opened over 1 year ago
by
yizhiezi
Standing at a flag in Netherlands
#194 opened over 1 year ago
by
Sweetstacg
Delete Config.json
#193 opened over 1 year ago
by
jana0010
Update README.md
#192 opened over 1 year ago
by
caraanchoa
为助手回答添加 <think>\n> 标签,确保一致性
#191 opened over 1 year ago
by
REN0430
fix for transformers 4.49 compatibility
#189 opened over 1 year ago
by
katuni4ka
Question about experts select
#186 opened over 1 year ago
by
BXset
Hardware Requirements to run the original model - 671B params
👍 1
4
#185 opened over 1 year ago
by
EdilCamil
Holding paper in hand
1
#184 opened over 1 year ago
by
Loveyl
Update config.json
#182 opened over 1 year ago
by
Empolean2640
Regression in Reasoning Tag Output - Missing <think> in Model Responses
2
#181 opened over 1 year ago
by
divinerapier
Delete model.safetensors.index.json
#180 opened over 1 year ago
by
Huggingfaceliaj
Unknown quantization type, got fp8
#179 opened over 1 year ago
by
DenisFavaCerchiaro
如何取消/省略<think></think>过程。
3
#178 opened over 1 year ago
by
yech520
Request: DOI
🤗 1
#177 opened over 1 year ago
by
Tamwyn
Request: DOI
#176 opened over 1 year ago
by
saathwik
Request: DOI
#175 opened over 1 year ago
by
Paulabad
Draft model as accelerator for DeepSeek-R1?
5
#174 opened over 1 year ago
by
inputout
Deploying production ready service with Unsloth GGUF quants on your AWS account. (4 x L40S)
🔥 2
8
#171 opened over 1 year ago
by
samagra-tensorfuse
是否可以关注Perplexity推出的“r1-1776”模型?
4
#170 opened over 1 year ago
by
yanyihan
Just crossed 10,000 likes!
1
#169 opened over 1 year ago
by
clem
mac上面无法下载flash_attn
#168 opened over 1 year ago
by
earlyIsLate
Can this model be used for commercial use?
2
#167 opened over 1 year ago
by
henrycwf
90+ tokens per second for MI300x8 using batch_size = 1
1
#166 opened over 1 year ago
by
ghostplant
"aha moment" comment deleted by Perplexity (recovered)
👍 1
3
#164 opened over 1 year ago
by
FalconNet
'num_hidden_layers': 61, but layer 62 has weights.
#162 opened over 1 year ago
by
xinhe
Upload GTG Breaking every Limit
#161 opened over 1 year ago
by
GTGenesis
support prefix complete
❤️👍 3
3
#158 opened over 1 year ago
by
HuggineAllen
Create app.py
#157 opened almost 2 years ago
by
SpaceAgeRobotics
Brokersponsor
#155 opened almost 2 years ago
by
Brokersponsor
Update README.md
#154 opened almost 2 years ago
by
egegvner
Upload IMG_4530.png
#152 opened almost 2 years ago
by
Noemie202586
Upload IMG_1745.JPG
#151 opened almost 2 years ago
by
Ladib
Create Clara
1
#150 opened almost 2 years ago
by
Clblinks
If I understand correctly, evaluating MATH-500 requires 64*500 model calls?
1
#149 opened almost 2 years ago
by
Rorschaaaach
Request: DOI
🚀 1
#148 opened almost 2 years ago
by
Tarush-Appreciate
Update README.md
#147 opened almost 2 years ago
by
tekno-power
Update README.md
#146 opened almost 2 years ago
by
Ekimnedops6969
Update README.md
❤️ 1
1
#143 opened almost 2 years ago
by
MuhammadEhsan
Request for Information on Purchasing Reasoning API Key
2
#142 opened almost 2 years ago
by
brahamaandai
ssss
🔥 1
1
#140 opened almost 2 years ago
by
DZGT
Update model_max_length in tokenizer_config.json
👍 3
1
#139 opened almost 2 years ago
by
kkokkie2360
Host of the model
3
#138 opened almost 2 years ago
by
henrycwf