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-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 -
Upload model-00059-of-000163.safetensors with huggingface_hub
Verified signaturea5f8580 -
Upload model-00058-of-000163.safetensors with huggingface_hub
Verified signature8a04d16 -
Update README.md
Verified signature65dd04e -
Upload model-00057-of-000163.safetensors with huggingface_hub
Verified signatured23c331 -
Create README.md
Verified signature690675a -
Upload model-00056-of-000163.safetensors with huggingface_hub
Verified signature4977277 -
Upload model-00055-of-000163.safetensors with huggingface_hub
Verified signatureb9eec0e -
Upload model-00054-of-000163.safetensors with huggingface_hub
Verified signature734f2e4 -
Upload model-00053-of-000163.safetensors with huggingface_hub
Verified signaturef13a3ba -
Upload model-00052-of-000163.safetensors with huggingface_hub
Verified signature6844d1d -
Upload model-00051-of-000163.safetensors with huggingface_hub
Verified signatureeb6878b -
Upload model-00050-of-000163.safetensors with huggingface_hub
Verified signature698d1b7 -
Upload model-00049-of-000163.safetensors with huggingface_hub
Verified signaturec467472 -
Upload model-00048-of-000163.safetensors with huggingface_hub
Verified signaturef0e011f -
Upload model-00047-of-000163.safetensors with huggingface_hub
Verified signature0f4d523 -
Upload model-00046-of-000163.safetensors with huggingface_hub
Verified signature67ab61c -
Upload model-00045-of-000163.safetensors with huggingface_hub
Verified signatured597e4c -
Upload model-00044-of-000163.safetensors with huggingface_hub
Verified signature4c26876 -
Upload model-00043-of-000163.safetensors with huggingface_hub
Verified signatureb4a032f -
Upload model-00042-of-000163.safetensors with huggingface_hub
Verified signature7b0cd09 -
Upload model-00041-of-000163.safetensors with huggingface_hub
Verified signature1191393 -
Upload model-00040-of-000163.safetensors with huggingface_hub
Verified signature2188524 -
Upload model-00039-of-000163.safetensors with huggingface_hub
Verified signature4bea7bf -
Upload model-00038-of-000163.safetensors with huggingface_hub
Verified signature62d20f2 -
Upload model-00037-of-000163.safetensors with huggingface_hub
Verified signaturea3da5f7 -
Upload model-00036-of-000163.safetensors with huggingface_hub
Verified signature834bb26 -
Upload model-00035-of-000163.safetensors with huggingface_hub
Verified signature61b92d3 -
Upload model-00034-of-000163.safetensors with huggingface_hub
Verified signature01e88c1 -
Upload model-00033-of-000163.safetensors with huggingface_hub
Verified signaturedfc5f5c