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-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 -
Upload model-00113-of-000163.safetensors with huggingface_hub
Verified signature5f9b12c -
Upload model-00112-of-000163.safetensors with huggingface_hub
Verified signature93abd5c -
Upload model-00111-of-000163.safetensors with huggingface_hub
Verified signature3e3e200 -
Upload model-00110-of-000163.safetensors with huggingface_hub
Verified signature941b968 -
Upload model-00109-of-000163.safetensors with huggingface_hub
Verified signature6c19019 -
Upload model-00108-of-000163.safetensors with huggingface_hub
Verified signature91814ef -
Upload model-00107-of-000163.safetensors with huggingface_hub
Verified signature647afe7 -
Upload model-00106-of-000163.safetensors with huggingface_hub
Verified signature658962d -
Upload model-00105-of-000163.safetensors with huggingface_hub
Verified signature1d71971 -
Upload model-00104-of-000163.safetensors with huggingface_hub
Verified signature412761e -
Upload model-00103-of-000163.safetensors with huggingface_hub
Verified signature9a90b57 -
Upload model-00102-of-000163.safetensors with huggingface_hub
Verified signature3655c3b -
Upload model-00101-of-000163.safetensors with huggingface_hub
Verified signaturea1c0d65 -
Upload model-00100-of-000163.safetensors with huggingface_hub
Verified signaturec637c61 -
Upload model-00099-of-000163.safetensors with huggingface_hub
Verified signaturefc9cbf9 -
Upload model-00098-of-000163.safetensors with huggingface_hub
Verified signaturefc18cf4 -
Upload model-00097-of-000163.safetensors with huggingface_hub
Verified signature20bd282 -
Upload model-00096-of-000163.safetensors with huggingface_hub
Verified signature2337f9e -
Upload model-00095-of-000163.safetensors with huggingface_hub
Verified signaturee6a93c8 -
Upload model-00094-of-000163.safetensors with huggingface_hub
Verified signatureb31b6b3 -
Upload model-00093-of-000163.safetensors with huggingface_hub
Verified signature8687702 -
Upload model-00092-of-000163.safetensors with huggingface_hub
Verified signature9193146 -
Upload model-00091-of-000163.safetensors with huggingface_hub
Verified signature4835fc8 -
Upload model-00090-of-000163.safetensors with huggingface_hub
Verified signatured71db39 -
Upload model-00089-of-000163.safetensors with huggingface_hub
Verified signaturef88b46a -
Upload model-00088-of-000163.safetensors with huggingface_hub
Verified signature56c3d35 -
Upload model-00087-of-000163.safetensors with huggingface_hub
Verified signature1580800 -
Upload model-00086-of-000163.safetensors with huggingface_hub
Verified signatured0531e2 -
Upload model-00085-of-000163.safetensors with huggingface_hub
Verified signature7cfdf60 -
Upload model-00084-of-000163.safetensors with huggingface_hub
Verified signature0d86bd0 -
Upload model-00083-of-000163.safetensors with huggingface_hub
Verified signatureb6910a5 -
Upload model-00082-of-000163.safetensors with huggingface_hub
Verified signature7abc660 -
Upload model-00081-of-000163.safetensors with huggingface_hub
Verified signaturee256b94