Instructions to use deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B") 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-Distill-Qwen-1.5B") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B") 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-Distill-Qwen-1.5B 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-Distill-Qwen-1.5B" # 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-Distill-Qwen-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
- SGLang
How to use deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B 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-Distill-Qwen-1.5B" \ --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-Distill-Qwen-1.5B", "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-Distill-Qwen-1.5B" \ --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-Distill-Qwen-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
Fix chat_template crash when assistant message omits the `content` key
#48 opened 23 days ago
by
qgallouedec
Install & run this model easily using llmpm
#47 opened 3 months ago
by
sarthak-saxena
Update README.md
#46 opened 4 months ago
by
cherry0328
1111
#45 opened 6 months ago
by
MaoYang1910
DeepSeek-R1-Distill-Qwen-1.5B
#44 opened 7 months ago
by
olares
aime24 benchmark on deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
#43 opened 7 months ago
by
explorer-e
Model Weights with FP32
#42 opened 8 months ago
by
carducaldeira
Create DeepSeek-R1-Distill-Qwen-1.5B
#41 opened 9 months ago
by
jacdada
Request: DOI
1
#40 opened 9 months ago
by
Ihor-sandbx
mmb
#39 opened 10 months ago
by
lomoonmoonbird
Upload Elliote_Wave_Example_1.jpg
#38 opened 11 months ago
by
sagartachtode
add AIBOM
1
#36 opened 12 months ago
by
RiccardoDav
bos_token_id=eos_token_id=151643
#35 opened about 1 year ago
by
gaussclb
first request
#34 opened about 1 year ago
by
Anyz01
tokenizer.model file for DeepSeek-R1-Distill-Qwen-1.5B
1
#33 opened about 1 year ago
by
SouravD-Me
Request: DOI
1
#32 opened about 1 year ago
by
nyein23
Adding ONNX file of this model
2
#31 opened about 1 year ago
by
mrm8848
How to export this model to onnx ?
#30 opened about 1 year ago
by
hmsjwzb
Fine Tuning
👀 2
1
#28 opened about 1 year ago
by
Carulus
Error:Sliding Window Attention is enabled but not implemented for `sdpa`; unexpected results may be encountered
👍 13
3
#27 opened over 1 year ago
by
fffutr30
Distillation dataset released?
👀 2
#26 opened over 1 year ago
by
Winmodel
bos_token_id mismatch between model config and tokenizer
2
#25 opened over 1 year ago
by
guangy10
JAX Implementation!
👍 4
1
#24 opened over 1 year ago
by
jrosseruk
Step by step guide for Distillation
#23 opened over 1 year ago
by
Pradeep1995
max_position_embeddings and tokenizer max discrepancies
1
#22 opened over 1 year ago
by
ghpu
R1 not putting out the full model response with transformers pipeline
1
#21 opened over 1 year ago
by
rcgalbo
Using it on mobile
1
#20 opened over 1 year ago
by
chandan867
update Qwen/Qwen2.5-1.5B-Instruct to deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B, i got an error
#19 opened over 1 year ago
by
fengkai-llm
model.safetensors file's tensors are all odd aligned causing performance issues when mmap'ing the file in place
#18 opened over 1 year ago
by
iankronquist
TypeError: forward() missing 1 required positional argument: 'attention_masks'
1
#16 opened over 1 year ago
by
lmlmvxi
Using the Model
1
#14 opened over 1 year ago
by
joel1610-hon
Failed to load the model
1
#13 opened over 1 year ago
by
Raulol19
Upload IMG_1608.jpeg
#12 opened over 1 year ago
by
Ayomide223
how to fine tune?
2
#10 opened over 1 year ago
by
NickyNicky
How to turn off the r1 mode when running it with huggingface api?
4
#9 opened over 1 year ago
by
securealex
Add pipeline tag, link to paper
#7 opened over 1 year ago
by
nielsr
comfyui-deepseek-r1
#6 opened over 1 year ago
by
zwpython
is `config.json` correct?
#4 opened over 1 year ago
by
J22
System Prompt
🔥 6
3
#3 opened over 1 year ago
by
Wanfq
YAML Metadata Warning: empty or missing yaml metadata in repo card
#2 opened over 1 year ago
by
JLouisBiz