Text Generation
Transformers
Safetensors
English
deepseek_v3
deepseek
unsloth
conversational
custom_code
text-generation-inference
fp8
Instructions to use unsloth/DeepSeek-R1-0528 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/DeepSeek-R1-0528 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/DeepSeek-R1-0528", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/DeepSeek-R1-0528", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("unsloth/DeepSeek-R1-0528", trust_remote_code=True) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/DeepSeek-R1-0528 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/DeepSeek-R1-0528" # 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-0528", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/DeepSeek-R1-0528
- SGLang
How to use unsloth/DeepSeek-R1-0528 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-0528" \ --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-0528", "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-0528" \ --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-0528", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use unsloth/DeepSeek-R1-0528 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/DeepSeek-R1-0528 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/DeepSeek-R1-0528 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/DeepSeek-R1-0528 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="unsloth/DeepSeek-R1-0528", max_seq_length=2048, ) - Docker Model Runner
How to use unsloth/DeepSeek-R1-0528 with Docker Model Runner:
docker model run hf.co/unsloth/DeepSeek-R1-0528
Add files using upload-large-folder tool
Browse files- model-00130-of-000163.safetensors +3 -0
- model-00131-of-000163.safetensors +3 -0
- model-00134-of-000163.safetensors +3 -0
- model-00135-of-000163.safetensors +3 -0
- model-00137-of-000163.safetensors +3 -0
- model-00142-of-000163.safetensors +3 -0
- model-00147-of-000163.safetensors +3 -0
- model-00152-of-000163.safetensors +3 -0
- model-00153-of-000163.safetensors +3 -0
- model-00157-of-000163.safetensors +3 -0
model-00130-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bafcb421c7636a8d1407735e9c39d9f94cfe9174f10ebffb6390f54390201f90
|
| 3 |
+
size 4302384963
|
model-00131-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9146678be71605b04509509ae8c8600b3361581c1f7886feb3d37d3083288630
|
| 3 |
+
size 4302350432
|
model-00134-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98f7d0813233387a7d64c248ffbf283af447335acf8f9e592e8d6f17e7af3cea
|
| 3 |
+
size 4302384504
|
model-00135-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20972203f8a8d7a39feb0a8a4922c52cc558dd267b33412569a4318a254cefdf
|
| 3 |
+
size 4302384961
|
model-00137-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b32673bdf13a28353c89b421bf762b4834cdec4a4b8aaf86889eea6419b04734
|
| 3 |
+
size 4302384692
|
model-00142-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86e044ffe01a23253c3c858bd4ab8d5c3a7da8672d3406a003dc01bd498fde0a
|
| 3 |
+
size 4302317817
|
model-00147-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2cdb286ada9e0d41a4ad87b05b1b6529e323f88162493e03f5fd82b7834808cb
|
| 3 |
+
size 4302350602
|
model-00152-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23f08d37d3ac71ffa5fdcbaff61fab2c3994377a5bb71e29f08d08e056760294
|
| 3 |
+
size 4302350808
|
model-00153-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62d77a232eb76e49ce27b37dd8a712c2bf0ae381c0f867b401747a44fb58f73a
|
| 3 |
+
size 4302384504
|
model-00157-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3ebf2a57c3a9eb542e1b5a7330051bba280fe048e7c07f1a61bf1c618b51c9d
|
| 3 |
+
size 4302384963
|