作为开放的云与 AI 服务提供商,火山引擎同时提供豆包大模型和开源模型方案满足企业的 AI 业务需求。随着开源模型构建复杂度显著上升,火山引擎可以提供包括 DeepSeek 在内的开源模型强化学习精调、蒸馏和大规模推理的整套方案,帮助您实现效率、性能和最优推理成本之间的极致平衡。
DeepSeek 发布的 DeepSeek-R1(MoE 架构,671B)以及系列 DeepSeek-R1-Distill 模型效果达到同类模型相同水平,成本低 90%到 95%,凭借模型开源、算法创新、极致性价比吸引全球注意。
现在,您可以灵活选择火山引擎火山方舟、机器学习平台、GPU 服务器部署调用 DeepSeek-R1 全尺寸模型。接下来一个月,火山引擎会持续推出 PD 分离、性能优化能力,针对您自研垂域模型的训练和推理,提供端到端的满血版 AI Infra 解决方案。
为您提供更好用的开源模型整套解决方案,相信火山引擎也是更好的选择。
提供基于 H20(ml.hpcpni3ln.45xlarge)规格的 DeepSeek-R1-Distill-Llama-70B 模型部署示例,方便您更直观灵活、安全的使用 DeepSeek R1 模型。
准备云基础、镜像仓库、VPC、机器学习平台相关产品的资源,创建机器学习平台的队列。具体可联系火山引擎销售或者其他偏好的沟通方式。
如果您从 HuggingFace 下载模型文件,遇到各种网络问题,可以通过 HuggingFace 的国内镜像加快下载速度。这里使用机器学习平台的开发机下载 DeepSeek-R1-Distill-Llama-70B 模型为例,为您自助从 HuggingFace 下载模型文件提供参考。
vemlp-cn-beijing.cr.volces.com/preset-images/pytorch:2.4.1-cu12.4.1-py3.10-ubuntu20.04
# 开发机安装tmux并新建一个会话,避免远程连接异常断开,导致模型权重文件下载中断。 sudo apt-get update yum install tmux -y tmux new -s model # 下载HuggingFace_hub pip install -U huggingface_hub # 设置HF-mirror环境变量 export HF_ENDPOINT=https://hf-mirror.com # 下载模型,需要指定模型的保存位置 huggingface-cli download --resume-download deepseek-ai/DeepSeek-R1-Distill-Llama-70B --local-dir /file_system/common-models/DeepSeek-R1-Distill-Llama-70B
最后模型 DeepSeek-R1-Distill-Llama-70B: /file_system/common-models/DeepSeek-R1-Distill-Llama-70B
可以通过开发机持续进行数据参数、模型参数的调整,进行模型开发构建,然后将模型配置打包生成新的环境镜像。
针对主流、领先的开源模型,火山引擎也提供 TOS(对象存储)预置模型权重文件,方便您自助复制,加速试验。
登录到机器学习平台开发机的 WebIDE,打开终端,下载预置模型权重文件:
#开发机安装tmux并新建一个会话,避免远程连接异常断开,导致模型权重文件下载中断。 sudo apt-get update yum install tmux -y tmux new -s model #初始化配置,在 access_key_id 和 secret_access_key 分别输入账户对应的 AK、SK vim ~/.tosutilconfig # Tosutil 是用于访问和管理火山引擎对象存储(TOS)的命令行工具。开发机内置了 tosutil 工具,仅需简单配置即可使用。 # 查看tos bucket内的文件目录 tosutil ls tos://preset-models-cn-beijing/deepseek-ai //后为配置的远程连接bucket名称 # 执行命令,把预置模型权重文件从对象存储bucket拷贝到当前账号的vePFS。以cn-beijing region的预置模型权重文件为例,桶名称:tos://preset-models-cn-beijing # 更多预置模型权重文件可以联系火山引擎获取 # 700GB约需要8m17s tosutil cp tos://preset-models-cn-beijing/deepseek-ai/DeepSeek-R1-Distill-Llama-70B/ /file_system/common-models/ -r -u -j=32 -p=4 -nfj=16 # 同样如果需要将模型权重文件同步到自己账号的对象存储。可以执行命令反向操作 tosutil cp /file_system/common-models/DeepSeek-R1-Distill-Llama-70B/ tos://${repleace_with_your_tos_bucket_name} -r -u -j=32 -p=4 -nfj=16
创建在线服务,并部署模型实例。在部署模型实例过程中,选择您专属 VPC 网络环境、API 网关、镜像、配置入口命令、挂载模型权重文件的共享文件系统路径和计算资源即可实现一键模型部署。
在镜像入口选择输入镜像地址:vemlp-cn-beijing.cr.volces.com/preset-images/dockerhub-vllm:v0.7.1
入口命令:
# vllm 的 DeepSeek-R1-Distill-Llama-70B 蒸馏模型的入口命令 python3 -m vllm.entrypoints.openai.api_server --port 50050 --model /file_system/common-models/DeepSeek-R1-Distill-Llama-70B --served-model-name DeepSeek-R1-Distill-Llama-70B --tensor-parallel-size 2 --max-num-seqs 64 --max_model_len=2048 sleep inf 30d # DeepSeek-R1-Distill-Llama-70B 蒸馏模型FP8 quantization启动的入口命令 python3 -m vllm.entrypoints.openai.api_server --port 50050 --model /file_system/common-models/DeepSeek-R1-Distill-Llama-70B --served-model-name DeepSeek-R1-Distill-Llama-70B --tensor-parallel-size 2 --quantization fp8 --kv-cache-dtype fp8_e4m3 --max-num-seqs 64 --max_model_len=2048 sleep inf 30d # DeepSeek R1 推荐使用SGLang镜像,显存占用消耗更少、推理性能优化更好 # vemlp-cn-beijing.cr.volces.com/preset-images/sglang:0.4.2 python3 -m sglang.launch_server --model-path /file_system/common-models/DeepSeek-R1 --tp 8 --trust-remote-code --mem-fraction-static 0.9 --host 0.0.0.0 --port 50050 sleep inf
提交服务,等待环境初始化后,服务进入运行中状态。
在在线服务详情页-部署
页面获取实例的公网调用地址,配置调用参数,然后进入服务实例的 WebShell,发起服务调用测试。
# curl语句 DeepSeek-R1-Distill-Llama-70B 配置调用参数 curl https://xx.apigateway-cn-beijing.volceapi.com/mlp/s-20250202183843-***/v1/completions \ -H "Content-Type: application/json" \ -d '{ "model": "DeepSeek-R1-Distill-Llama-70B", "prompt": "San Francisco is a", "max_tokens": 7, "temperature": 0 }' # curl语句 DeepSeek-R1-Distill-Llama-70B 也可以使用IP:Port的形式 curl 192.168.32.*:50050/v1/completions \ -H "Content-Type: application/json" \ -d '{ "model": "DeepSeek-R1-Distill-Llama-70B", "prompt": "San Francisco is a", "max_tokens": 7, "temperature": 0 }' # curl语句 DeepSeek-R1 或者V3 参考调用示例 curl -X POST \ "192.168.32.*:50050/v1/chat/completio ns" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer EMPTY" \ -d '{ "model": "DeepSeek-R1", "messages": [ { "role": "system", "content": "You are a helpful AI assistant" }, { "role": "user", "content": "你是谁" } ], "temperature": 0, "max_tokens": 8192 }'
随后即可在服务详情页的实时日志中查看服务的吞吐指标。
如需公网访问请确认网络配置。
- 私有网络、子网、安全组,选择负载均衡器所在私有网络,并为该安全组放通入向端口,例如 50050 。
- 端口,添加自定义端口,监听端口 50050,调用端口任意,用途 HTTP。
- 负载均衡,选择公网类型的负载均衡以支持公网访问。
如您需进一步交流,可直接联系火山引擎销售人员预约体验。火山引擎为您提供最佳的框架选型及优化选项建议,加速 AI 创新实验。
模型名 | 模型大小 | 机型(推荐) | 模型权重文件地址(cn-beijing 为例) | 推理引擎启动参数配置(推荐) |
---|---|---|---|---|
DeepSeek-V3 | FP8: | Hopper GPU 96GiB * 8 |
|
|
DeepSeek-R1 | FP8: | Hopper GPU 96GiB * 8 |
|
|
DeepSeek-R1-Distill-Qwen-1.5B | BF16: | Hopper GPU 96GiB * 1 |
|
|
DeepSeek-R1-Distill-Qwen-7B | BF16: 15.23 GB | Hopper GPU 96GiB * 1 |
|
|
DeepSeek-R1-Distill-Llama-8B | BF16: | Hopper GPU 96GiB * 1 |
|
|
DeepSeek-R1-Distill-Qwen-14B | BF16: | Hopper GPU 96GiB * 1 |
|
|
DeepSeek-R1-Distill-Qwen-32B | BF16: | Hopper GPU 96GiB * 1 |
|
|
DeepSeek-R1-Distill-Llama-70B | BF16: | Hopper GPU 96GiB * 2 |
|
|
环境要求 | docker 镜像地址 |
---|---|
基础环境镜像 | cuda124+pytorch2.4 |
vLLM 的预置镜像 | Version: 0.7.1-post1 |
SGLang 预置镜像 | Version: 0.4.2.post1 |
您可以在实例列表页签查看部署的实例运行状态及其他信息。