Instructions to use deepseek-ai/DeepSeek-R1-Distill-Llama-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-R1-Distill-Llama-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1-Distill-Llama-8B") 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-Llama-8B") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Llama-8B") 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-Llama-8B 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-Llama-8B" # 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-Llama-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
- SGLang
How to use deepseek-ai/DeepSeek-R1-Distill-Llama-8B 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-Llama-8B" \ --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-Llama-8B", "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-Llama-8B" \ --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-Llama-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-R1-Distill-Llama-8B with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
Fix chat_template crash when assistant message omits the `content` key
#35 opened 8 days ago
by
qgallouedec
Update README.md
#34 opened 4 months ago
by
cherry0328
download deepseek r1 llam 8b
#33 opened 8 months ago
by
suiyumeng
Suggestions for the right learning curve for Agents using R1-distill
#32 opened 8 months ago
by
D-Leap07
[Possible bug] Tokenizer removes thinking part
1
#31 opened 10 months ago
by
haritzpuerto
add AIBOM
1
#30 opened 11 months ago
by
RiccardoDav
why the model inference so slowly??
#29 opened about 1 year ago
by
LuYinMiao
How to disable the thinking mode?
👍 3
2
#26 opened about 1 year ago
by
fmmarkmq
How to solve this Warning?
#25 opened about 1 year ago
by
KevinWangHP
Does Recommended Usage apply to the distilled models?
#24 opened about 1 year ago
by
yarnsp
🚩 Report: Not working
#23 opened about 1 year ago
by
laozhan
Output bug
#22 opened about 1 year ago
by
DazWilliams
Example Prompts
1
#21 opened about 1 year ago
by
agat
duplicated bos_token when using apply_chat_template with Tokenizer
1
#20 opened about 1 year ago
by
irvingjr
tokenizer.model
#19 opened over 1 year ago
by
Lozai
Update README.md
#18 opened over 1 year ago
by
tekno-power
<think> tag is missing in the latest revision
2
#17 opened over 1 year ago
by
ajsqr
微调DeepSeek-R1打造SQL语言转自然语言视频教程
#16 opened over 1 year ago
by
leo009
One more "0" in model-00001-of-000002.safetensors?
#15 opened over 1 year ago
by
PPrimo
Excellent models !!! - Plans for Mistral Nemo and/or Gemma 2 Distills ?
➕ 3
#14 opened over 1 year ago
by
DavidAU
Adding Evaluation Results
#12 opened over 1 year ago
by
Mikhil-jivus
Missing multilanguage capabilities
6
#11 opened over 1 year ago
by
h4rz3rk4s3
run in colab t4
#9 opened over 1 year ago
by
rakmik
Adding Evaluation Results
#8 opened over 1 year ago
by
T145
Add pipeline tag, link to paper
#7 opened over 1 year ago
by
nielsr
Do the distilled models also have 128K context?
👍 1
2
#4 opened over 1 year ago
by
Troyanovsky
How was this quantized?
1
#3 opened over 1 year ago
by
imq
missing special_tokens_map.json file
#2 opened over 1 year ago
by
vince62s