Official commands

Copy-paste commands. Every one carries its official source — when the source changes, this changes.

This is the value we add. Official docs are split across api-docs, GitHub READMEs and Hugging Face model cards. Finding "how do I run it" takes several tabs. Here it is in one place.

Download a model

官方來源:https://huggingface.co/deepseek-ai

MethodCommand
Hugging Face CLIhuggingface-cli download deepseek-ai/DeepSeek-V3
Hugging Face CLI(到指定目录)huggingface-cli download deepseek-ai/DeepSeek-R1 --local-dir ./DeepSeek-R1
git-lfsgit lfs install && git clone https://huggingface.co/deepseek-ai/DeepSeek-V3
ModelScope(国内)modelscope download --model deepseek-ai/DeepSeek-R1

Serve a model

官方來源:https://github.com/deepseek-ai/DeepSeek-V3

MethodCommand
vLLMvllm serve deepseek-ai/DeepSeek-V3 --trust-remote-code --tensor-parallel-size 8
SGLangpython -m sglang.launch_server --model deepseek-ai/DeepSeek-V3 --tp 8
transformers(单机最小)from transformers import AutoModelForCausalLM, AutoTokenizer

DeepSeek Harness

官方來源:https://github.com/deepseek-ai/deepseek-harness

MethodCommand
启动 Web UInpx @deepseek-ai/dsh web
安装插件dsh plugin --profile web add <plugin>
查看版本npx @deepseek-ai/dsh --version

Call the API

官方來源:https://api-docs.deepseek.com/

MethodCommand
端点POST https://api.deepseek.com/chat/completions
模型名deepseek-chat / deepseek-reasoner
curl 最小示例curl https://api.deepseek.com/chat/completions -H "Authorization: Bearer $KEY" -d '{"model":"deepseek-chat","messages":[{"role":"user","content":"hi"}]}'

Quantize

官方來源:https://huggingface.co/deepseek-ai

MethodCommand
GGUF(llama.cpp)python convert_hf_to_gguf.py ./DeepSeek-R1-Distill-Qwen-7B --outtype q4_k_m
官方已发布量化版搜 Hugging Face 上的 -GGUF / -AWQ / -GPTQ 后缀

Caveats

Related

Official resources · Infrastructure · Self-hosting