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, 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=40) 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 comment-sample.xlsx
#133 opened over 1 year ago
by
faham123
non-reasoning data
#132 opened over 1 year ago
by
mccatec
能不能放一些 4bit的权重,现在手里面的卡都不支持FP8
🔥 2
1
#131 opened over 1 year ago
by
zhnagchenchne
For the universe! DeepPhaser.py DeepCoralX.py and DeepSynapse.py
❤️👀 2
3
#129 opened over 1 year ago
by
karmikovic
Request: Create distill of Mistral Small 24B
3
#128 opened over 1 year ago
by
Kenshiro-28
which vision model is R1 using for text extraction from image or pdfs.
2
#127 opened over 1 year ago
by
ashutoshroy02
Request: DOI
#125 opened over 1 year ago
by
Yungchizzy
Little brother(s) of big DeepSeek-R1 ?
2
#124 opened over 1 year ago
by
MrDevolver
Upload gugagagaggagagagga.pdf
1
#123 opened over 1 year ago
by
HahahhahH
Change quant_method to bitsandbytes_4bit
#121 opened over 1 year ago
by
ngoc24794
Unknown quantization type
5
#120 opened over 1 year ago
by
Reewaz321
UPdate config.json
#119 opened over 1 year ago
by
keerthanaOfficial2001
所以部署一个671B的模型 显存需要多少 有什么基准的硬件配置?
27
#118 opened over 1 year ago
by
cena163
Distill Compatibility for PC w/ Ryzen 7 Pro 8840HS w/ 780M Graphics 2x32GB RAM 1TB DDR5 SSD
1
#115 opened over 1 year ago
by
arzx
Upload gitattributes.txt
#114 opened over 1 year ago
by
SafeerChalil
Introducing Deepseek's TinyZero
❤️ 1
1
#113 opened over 1 year ago
by
DeepSeekModerator
Create Kuch v
1
#112 opened over 1 year ago
by
gamerdowntown
Request: DOI
#111 opened over 1 year ago
by
Hassanabbas2975
quantization fp8 error occuring while using pipeline approach or transformer based approach
1
#110 opened over 1 year ago
by
neethuvm
Deepseek-R1
#109 opened over 1 year ago
by
KudanTao
deepseek-r1 源码中采用 MLA 架构的 KV Cache 压缩存储策略的实现似乎与文中说的不一致,这是为什么?代码中似乎没实现这个大优化
👍 3
2
#108 opened over 1 year ago
by
Darkdust
Eating food in a car
#106 opened over 1 year ago
by
Ayinbaby1313
Update README.md
#103 opened over 1 year ago
by
jungvaclav
error while downloading model
👍 11
8
#102 opened over 1 year ago
by
heikhama1982
Upload IMG_20250112_172711.jpg
#101 opened over 1 year ago
by
aamir1
help from italy
5
#100 opened over 1 year ago
by
MMPPIIAA
R1 distill to Mistral Small?
❤️ 10
4
#99 opened over 1 year ago
by
nfunctor
Running this model on Google Colab?
👍 1
3
#98 opened over 1 year ago
by
Zakia
请问下deepseek的同学,能不能train出一个 stable 的 moe model?
#97 opened over 1 year ago
by
tflchina
How to download DeepSeek-R1 7B parameters
1
#96 opened over 1 year ago
by
barqawiz
HuggingFace version does NOT use efficient MLA caching
2
#95 opened over 1 year ago
by
Avelina
Found a bug
#93 opened over 1 year ago
by
amalgunatilake
Let's Give Credit Where It’s Due: Adding Source Links to AI Responses
👀🔥 1
3
#88 opened over 1 year ago
by
Munis01
When will this be available in Transformers library?
👍 2
#87 opened over 1 year ago
by
solwol
cannot regenerate (blank respone)
#86 opened over 1 year ago
by
pluhong
A Bug using hugging face API
3
#85 opened over 1 year ago
by
Kevin355
Do we need an authorization access to use this ?
#84 opened over 1 year ago
by
Natwar
where is the source code for this Model ? - what does they prodoudly say by open-source models?
1
#83 opened over 1 year ago
by
tstarksys
智王发布deepseek-r1懒人包,解压即用Deepseek-r1 Lazy Package, easy to decompress and use
1
#81 opened over 1 year ago
by
zwpython
model-00078-of-000163.safetensors not marked safe?
2
#80 opened over 1 year ago
by
aborst
Create Dare
#79 opened over 1 year ago
by
Dara996
problem with using serverless inference
1
#78 opened over 1 year ago
by
manju2345
Some weird sensorship on unsensitive topic. 对非敏感话题的奇怪审查。
8
#77 opened over 1 year ago
by
junnanwu
Upload dkfoEtm3H4bMcaI0KEJbq.1023.jpeg
#76 opened over 1 year ago
by
luckysalami089
Update README.md
#75 opened over 1 year ago
by
NuoNb
🚩 Report: Ethical issue(s)
#74 opened over 1 year ago
by
Typeofprototype
Deepseek-R1 falls: ZW demon redesigns' Nine Birds' Deepseek-R1沦陷:zw魔改版“九只鸟”
#73 opened over 1 year ago
by
zwpython
Consistency, can Deepseek pass?一致性,deepseek能及格吗?
#71 opened over 1 year ago
by
zwpython