Instructions to use deepseek-ai/DeepSeek-R1-Distill-Qwen-32B 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-32B 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-32B") 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-32B") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-32B") 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-Distill-Qwen-32B 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-32B" # 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-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
- SGLang
How to use deepseek-ai/DeepSeek-R1-Distill-Qwen-32B 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-32B" \ --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-32B", "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-32B" \ --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-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-R1-Distill-Qwen-32B with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
Poor performance in the leaderboard?
Why does the model perform so poorly in the open LLM leaderboard, especially compared to the smaller https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
?
Also, don't you guys think it's hallucinating like crazy? I'm actually talking about 14B version, but they are similar. For example ask it "events in 1987". Compare it with gpt-4o-mini, (not even o1 mini). Result= 4o-mini gives events that are really from 1987, while r1-distilled barely gets one or two events correctly...
the 14B has no chat template thats why the math scores >0.0, the others on the leaderboard are with chat_template enabled so the score is affected.
@clefourrier do you think we could get the models evaluated without chat_template in the board or we still on the math eval turbulences?
Hi everyone!
Here are the results without the chat template:
{'Model name': 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
'Precision': 'torch.bfloat16',
'Revision': 'd66bcfc2f3fd52799f95943264f32ba15ca0003d',
'Average': 38.37,
'IFEval': 40.16,
'BBH': 46.1,
'MATH Lvl 5': 46.68,
'GPQA': 23.15,
'MUSR': 25.16,
'MMLU-PRO': 48.98}
The results on the Leaderboard are these:
{'Model name': 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
'Precision': 'torch.bfloat16',
'Revision': '4569fd730224ec487752bd4954399c6e18bf3aa6',
'Average': 20.12,
'IFEval': 41.86,
'BBH': 17.15,
'MATH Lvl 5': 0.0,
'GPQA': 4.59,
'MUSR': 16.14,
'MMLU-PRO': 40.96}
It's true, that usually the chat template affects the scores, notably MATH Lvl 5
I think it would be fair to replace the results on the leaderboard by those (edit) without chat template :)
I think it would be fair to replace the results on the leaderboard by those with chat template :)
but the ones with chat_template enabled are providing very low score compared to the tests without chat_template.
.. none of them (with or without template) are actually reflecting the model true performance at all..
Edited to without, wrote too fast, good catch!
They reflect the performance of the model when evaluated in the exact same setup as the other models on the leaderboard.