华为昇腾910B通过vllm部署InternVL3-8B教程

前言

本文主要借鉴:VLLM部署deepseek,结合自身进行整理

下载模型

python 复制代码
from modelscope import snapshot_download
model_dir = snapshot_download('OpenGVLab/InternVL3-8B', local_dir="xxx/OpenGVLab/InternVL2_5-1B")

环境配置

auto-dl上选择单卡910B即可,Pytorch框架只有一个CANN版本选择,选这个即可。

安装vllm和vllm ascend

bash 复制代码
git clone --depth 1 --branch v0.7.3 https://github.com/vllm-project/vllm
cd vllm
VLLM_TARGET_DEVICE=empty pip install . --extra-index https://download.pytorch.org/whl/cpu/


git clone  --depth 1 --branch v0.7.3rc1 https://github.com/vllm-project/vllm-ascend.git
cd vllm-ascend
pip install -e . --extra-index https://download.pytorch.org/whl/cpu/

手动安装torch-npu

bash 复制代码
mkdir pta
cd pta
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
tar -xvf pytorch_v2.5.1_py310.tar.gz
pip install ./torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
swift 复制代码
pip install torchvision==0.20.1

启动指令

python 复制代码
vllm serve /root/xxx/xxx/InternVL3-8B --max-model-len 4096 --port 8000 --tensor-parallel-size 1 --trust-remote-code --served-model-name InternVL3-8B

启动成功如下图所示:

通过curl去进行验证

python 复制代码
curl http://localhost:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "InternVL3-8B",
        "messages": [
            {
                "role": "user", 
                "content": "你是谁?"
            }
        ]
    }'
相关推荐
在未来等你4 小时前
RAG实战指南 Day 24:上下文构建与提示工程
nlp·rag·retrieval-augmented generation·prompt engineering·context management
charlee445 小时前
PandasAI连接LLM进行智能数据分析
ai·数据分析·llm·pandasai·deepseek
EdisonZhou6 小时前
多Agent协作入门:群聊编排模式
llm·aigc·.net core
SEO_juper9 小时前
企业级 AI 工具选型报告:9 个技术平台的 ROI 对比与部署策略
人工智能·搜索引擎·百度·llm·工具·geo·数字营销
同志们11 小时前
LiteLLM Go: 多平台LLM客户端统一接口实现
llm·go
Q同学11 小时前
SciMaster:无需微调,在人类最后考试上刷新 SOTA
人工智能·llm·agent
聚客AI12 小时前
🚀深度解析Agentic RAG:如何突破模型的知识边界
人工智能·llm·掘金·日新计划
青Cheng序员石头15 小时前
【转译】Agentic AI 与 AI Agent:五大差异及其重要性
llm·aigc·agent
青Cheng序员石头15 小时前
Prompt Engineering vs Vibe Coding vs Context Engineering
langchain·llm·aigc
数据智能老司机15 小时前
构建由 LLM 驱动的 Neo4j 应用程序——使用 Neo4j 和 Haystack 实现强大搜索功能
langchain·llm·aigc