华为昇腾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": "你是谁?"
            }
        ]
    }'
相关推荐
掘金安东尼1 天前
智能体走出聊天框:互联互通的两条路与可核验边界
llm
Cosolar1 天前
让 Agent 别猜:一条禁止手写 SQL 的红线,撑起 23 万次可信取数
人工智能·llm·agent
kleigsm1 天前
我给 LLM Agent 做红队,发现“提示词加固”反而让攻击成功率翻倍
llm
掘金安东尼2 天前
2026年11月18日:32GB 内存能跑起来的本地模型性能排序
llm·mac·ollama
AAA修煤气灶刘哥2 天前
一口气拍 30 秒,MAGI-2 能接下 Seedance 2.5 的活吗?
人工智能·llm
AAA修煤气灶刘哥2 天前
QQ 音乐怎么在 25 毫秒内,决定一句话该交给谁?
人工智能·算法·llm
东东吖3 天前
07-LangChain Agent智能助手构建笔记
langchain·llm·agent
东东吖3 天前
06-LangChain 结构化输出学习笔记
langchain·llm·agent
东东吖3 天前
04-LangChain Message 与提示词模板学习笔记
langchain·llm·agent
东东吖3 天前
03-LangSmith 使用学习笔记
langchain·llm·agent