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
| Method | Command |
|---|---|
| Hugging Face CLI | huggingface-cli download deepseek-ai/DeepSeek-V3 |
| Hugging Face CLI(到指定目录) | huggingface-cli download deepseek-ai/DeepSeek-R1 --local-dir ./DeepSeek-R1 |
| git-lfs | git 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
| Method | Command |
|---|---|
| vLLM | vllm serve deepseek-ai/DeepSeek-V3 --trust-remote-code --tensor-parallel-size 8 |
| SGLang | python -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
| Method | Command |
|---|---|
| 启动 Web UI | npx @deepseek-ai/dsh web |
| 安装插件 | dsh plugin --profile web add <plugin> |
| 查看版本 | npx @deepseek-ai/dsh --version |
Call the API
官方來源:https://api-docs.deepseek.com/
| Method | Command |
|---|---|
| 端点 | 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
| Method | Command |
|---|---|
| GGUF(llama.cpp) | python convert_hf_to_gguf.py ./DeepSeek-R1-Distill-Qwen-7B --outtype q4_k_m |
| 官方已发布量化版 | 搜 Hugging Face 上的 -GGUF / -AWQ / -GPTQ 后缀 |
Caveats
- Full models (V3/R1) need multiple GPUs — 671B parameters is not a single-machine job.
- The Distill series (1.5B–70B) runs on one machine or a consumer GPU.
--trust-remote-codeis required; DeepSeek uses custom model classes.- The official docs are authoritative; this is a summary.