Instructions to use deepseek-ai/DeepSeek-R1-0528 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-R1-0528 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/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("deepseek-ai/DeepSeek-R1-0528", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deepseek-ai/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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deepseek-ai/DeepSeek-R1-0528 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/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": "deepseek-ai/DeepSeek-R1-0528", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-R1-0528
- SGLang
How to use deepseek-ai/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 "deepseek-ai/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": "deepseek-ai/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 "deepseek-ai/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": "deepseek-ai/DeepSeek-R1-0528", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-R1-0528 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-R1-0528
When will it be available via API
Why this model is not available via the DeepSeek API platform?
I want to try it via an API call, not via chat interface. I was unable to find any API keys after registration. And I also have a balance on my DeepSeek account. I'd rather use it via the official API. But looks like this feature won't be available in the foreseeable future.
llm.vin has a API, https://docs.llm.vin (no API key required)
Correct me if I'm dumb, it doesn't work, even with examples provided in the official documentation. As for the API keys (if I still want them), I was unable to find this menu item in the interface.
alex@M1 ~ % curl "https://api.llm.vin/v1/chat/compilations"
-H "Content-Type: application/json"
-d '{
"model": "grok-3-mini",
"messages": [
{
"role": "user",
"content": "Write a one-sentence bedtime story about a unicorn."
}
]
}'
Cannot POST /v1/chat/compilationsalex@M1 ~ %
No matter, which model I use, I see the same error.
By the way, it's suspicious to be true for free..., especially, when it comes to Grok (proprietary model)
It was a typo in the documentation and is being fixed.
curl "https://api.llm.vin/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-3-mini",
"messages": [
{
"role": "user",
"content": "Write a one-sentence bedtime story about a unicorn."
}
]
}'
It was a typo in the documentation and is being fixed.
curl "https://api.llm.vin/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-3-mini", "messages": [ { "role": "user", "content": "Write a one-sentence bedtime story about a unicorn." } ] }'
OMG, it really works! Thank you! Are you involved with this project?
Yes I am, glad to see its working now!