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-00032-of-000163.safetensors with huggingface_hub
Verified signature3254eab -
Upload model-00031-of-000163.safetensors with huggingface_hub
Verified signaturedb4d14c -
Upload model-00030-of-000163.safetensors with huggingface_hub
Verified signature1822a17 -
Upload model-00029-of-000163.safetensors with huggingface_hub
Verified signaturea44e484 -
Upload model-00028-of-000163.safetensors with huggingface_hub
Verified signaturefd3714d -
Upload model-00027-of-000163.safetensors with huggingface_hub
Verified signature1e43cac -
Upload model-00026-of-000163.safetensors with huggingface_hub
Verified signature571914b -
Upload model-00025-of-000163.safetensors with huggingface_hub
Verified signaturea2271ca -
Upload model-00024-of-000163.safetensors with huggingface_hub
Verified signaturece24a05 -
Upload model-00023-of-000163.safetensors with huggingface_hub
Verified signature3658d5a -
Upload model-00022-of-000163.safetensors with huggingface_hub
Verified signature90823f0 -
Upload model-00021-of-000163.safetensors with huggingface_hub
Verified signature424fef0 -
Upload model-00020-of-000163.safetensors with huggingface_hub
Verified signature822edcd -
Upload model-00019-of-000163.safetensors with huggingface_hub
Verified signature2a5e5fd -
Upload model-00018-of-000163.safetensors with huggingface_hub
Verified signature292054f -
Upload model-00017-of-000163.safetensors with huggingface_hub
Verified signature56da86d -
Upload model-00016-of-000163.safetensors with huggingface_hub
Verified signature41f1b53 -
Upload model-00015-of-000163.safetensors with huggingface_hub
Verified signature8f02870 -
Upload model-00014-of-000163.safetensors with huggingface_hub
Verified signature641356b -
Upload model-00013-of-000163.safetensors with huggingface_hub
Verified signature2f09b3d -
Upload model-00012-of-000163.safetensors with huggingface_hub
Verified signatureb8c7c1d -
Upload model-00011-of-000163.safetensors with huggingface_hub
Verified signaturea31bb8b -
Upload model-00010-of-000163.safetensors with huggingface_hub
Verified signature7170f10 -
Upload model-00009-of-000163.safetensors with huggingface_hub
Verified signature1ed1264 -
Upload model-00008-of-000163.safetensors with huggingface_hub
Verified signature2b0a1e2 -
Upload model-00007-of-000163.safetensors with huggingface_hub
Verified signatureb912094 -
Upload model-00006-of-000163.safetensors with huggingface_hub
Verified signature89386b5 -
Upload model-00005-of-000163.safetensors with huggingface_hub
Verified signature13d2c11 -
Upload model-00004-of-000163.safetensors with huggingface_hub
Verified signature11adc4a -
Upload model-00003-of-000163.safetensors with huggingface_hub
Verified signatureb3aea26 -
Upload model-00002-of-000163.safetensors with huggingface_hub
Verified signaturef21381d -
Upload model-00001-of-000163.safetensors with huggingface_hub
Verified signature324a327 -
Upload folder using huggingface_hub
Verified signature962089c -
initial commit
Verified signature07b233c