Text Generation
Transformers
Safetensors
English
deepseek_v3
deepseek
unsloth
conversational
custom_code
text-generation-inference
Instructions to use unsloth/DeepSeek-R1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/DeepSeek-R1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/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("unsloth/DeepSeek-R1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("unsloth/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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/DeepSeek-R1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/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": "unsloth/DeepSeek-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/DeepSeek-R1
- SGLang
How to use unsloth/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 "unsloth/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": "unsloth/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 "unsloth/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": "unsloth/DeepSeek-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/DeepSeek-R1 with Docker Model Runner:
docker model run hf.co/unsloth/DeepSeek-R1
Commit History
-
Upload model-00162-of-000163.safetensors with huggingface_hub
Verified signaturedfbeb53 -
Upload model-00161-of-000163.safetensors with huggingface_hub
Verified signatureea60eec -
Upload model-00160-of-000163.safetensors with huggingface_hub
Verified signature2a2ef06 -
Upload model-00159-of-000163.safetensors with huggingface_hub
Verified signature07d8ba0 -
Upload model-00158-of-000163.safetensors with huggingface_hub
Verified signatureab5a1cc -
Upload model-00157-of-000163.safetensors with huggingface_hub
Verified signature4b1f0eb -
Upload model-00156-of-000163.safetensors with huggingface_hub
Verified signature7bbf638 -
Upload model-00155-of-000163.safetensors with huggingface_hub
Verified signature479a1c0 -
Upload model-00154-of-000163.safetensors with huggingface_hub
Verified signature54dedea -
Upload model-00153-of-000163.safetensors with huggingface_hub
Verified signature6b9aadd -
Upload model-00152-of-000163.safetensors with huggingface_hub
Verified signature692b64d -
Upload model-00151-of-000163.safetensors with huggingface_hub
Verified signature31d0675 -
Upload model-00150-of-000163.safetensors with huggingface_hub
Verified signaturefc13986 -
Upload model-00149-of-000163.safetensors with huggingface_hub
Verified signature161edb6 -
Upload model-00148-of-000163.safetensors with huggingface_hub
Verified signature0d9dde1 -
Upload model-00147-of-000163.safetensors with huggingface_hub
Verified signaturee6b9c1a -
Upload model-00146-of-000163.safetensors with huggingface_hub
Verified signatured55030c -
Upload model-00145-of-000163.safetensors with huggingface_hub
Verified signatureee28cde -
Upload model-00144-of-000163.safetensors with huggingface_hub
Verified signature376a88a -
Upload model-00143-of-000163.safetensors with huggingface_hub
Verified signature05bdf0e -
Upload model-00142-of-000163.safetensors with huggingface_hub
Verified signature0fea323 -
Upload model-00141-of-000163.safetensors with huggingface_hub
Verified signature8ee9c53 -
Upload model-00140-of-000163.safetensors with huggingface_hub
Verified signature8761fb9 -
Upload model-00139-of-000163.safetensors with huggingface_hub
Verified signature8b1e92e -
Upload model-00138-of-000163.safetensors with huggingface_hub
Verified signature8f3f4b7 -
Upload model-00137-of-000163.safetensors with huggingface_hub
Verified signature6dd5fbd -
Upload model-00136-of-000163.safetensors with huggingface_hub
Verified signatureb892ee1 -
Upload model-00135-of-000163.safetensors with huggingface_hub
Verified signature9cba435 -
Upload model-00134-of-000163.safetensors with huggingface_hub
Verified signature87f77f7 -
Upload model-00133-of-000163.safetensors with huggingface_hub
Verified signatureb0fd793 -
Upload model-00132-of-000163.safetensors with huggingface_hub
Verified signature51ca160 -
Upload model-00131-of-000163.safetensors with huggingface_hub
Verified signaturee8d7964 -
Upload model-00130-of-000163.safetensors with huggingface_hub
Verified signature50dba75 -
Upload model-00129-of-000163.safetensors with huggingface_hub
Verified signature6dc581a -
Upload model-00128-of-000163.safetensors with huggingface_hub
Verified signatured7fa4fd -
Upload model-00127-of-000163.safetensors with huggingface_hub
Verified signaturead030ab -
Upload model-00126-of-000163.safetensors with huggingface_hub
Verified signature8588694 -
Upload model-00125-of-000163.safetensors with huggingface_hub
Verified signaturef2c9e11 -
Upload model-00124-of-000163.safetensors with huggingface_hub
Verified signature8a19708 -
Upload model-00123-of-000163.safetensors with huggingface_hub
Verified signatureb4a5d36 -
Upload model-00122-of-000163.safetensors with huggingface_hub
Verified signature18cb66b -
Upload model-00121-of-000163.safetensors with huggingface_hub
Verified signaturea162b7a -
Upload model-00120-of-000163.safetensors with huggingface_hub
Verified signature4e19bd3 -
Upload model-00119-of-000163.safetensors with huggingface_hub
Verified signaturec1fd4d2 -
Update README.md
Verified signature56a2008 -
Upload model-00118-of-000163.safetensors with huggingface_hub
Verified signature26b7f64 -
Upload model-00117-of-000163.safetensors with huggingface_hub
Verified signaturec3ce5dc -
Upload model-00116-of-000163.safetensors with huggingface_hub
Verified signature0d2e2e1 -
Upload model-00115-of-000163.safetensors with huggingface_hub
Verified signatured7d43eb -
Upload model-00114-of-000163.safetensors with huggingface_hub
Verified signature15b5a64