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-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 -
Upload model-00080-of-000163.safetensors with huggingface_hub
Verified signature2ef9d67 -
Upload model-00079-of-000163.safetensors with huggingface_hub
Verified signature1cc09e4 -
Upload model-00078-of-000163.safetensors with huggingface_hub
Verified signatureb03ee99 -
Upload model-00077-of-000163.safetensors with huggingface_hub
Verified signature2ec59cc -
Upload model-00076-of-000163.safetensors with huggingface_hub
Verified signaturecce2135 -
Upload model-00075-of-000163.safetensors with huggingface_hub
Verified signaturebcd074f -
Upload model-00074-of-000163.safetensors with huggingface_hub
Verified signature3d9ee0c -
Upload model-00073-of-000163.safetensors with huggingface_hub
Verified signaturef4cd1f7 -
Upload model-00072-of-000163.safetensors with huggingface_hub
Verified signature84362e5 -
Upload model-00071-of-000163.safetensors with huggingface_hub
Verified signaturef47ac2d -
Upload model-00070-of-000163.safetensors with huggingface_hub
Verified signature3a3121e -
Upload model-00069-of-000163.safetensors with huggingface_hub
Verified signatured2cfce4 -
Upload model-00068-of-000163.safetensors with huggingface_hub
Verified signaturea64c915 -
Upload model-00067-of-000163.safetensors with huggingface_hub
Verified signature9bd0456 -
Upload model-00066-of-000163.safetensors with huggingface_hub
Verified signature3618186 -
Upload model-00065-of-000163.safetensors with huggingface_hub
Verified signature3103e80 -
Upload model-00064-of-000163.safetensors with huggingface_hub
Verified signatureab2c649 -
Upload model-00063-of-000163.safetensors with huggingface_hub
Verified signature8f97248 -
Upload model-00062-of-000163.safetensors with huggingface_hub
Verified signature97ad7c4 -
Upload model-00061-of-000163.safetensors with huggingface_hub
Verified signature592dce3 -
Upload model-00060-of-000163.safetensors with huggingface_hub
Verified signature9e00eef