vLLM加载lora

下载Huggingface模型

安装包

复制代码
pip install huggingface_hub  -i https://pypi.tuna.tsinghua.edu.cn/simple

下载

复制代码
from huggingface_hub import snapshot_download

sql_lora_path = snapshot_download(repo_id="Djs07/qwen2.5-1.5b-lora")

会放在~/.cache/huggingface/hub/ 目录下

启动服务

先把lora模型拷贝到当前目录再执行

复制代码
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --enable-lora --lora-modules Qwen-Lora=models--Djs07--qwen2.5-1.5b-lora/snap
shots/8d7d20b1cbb95e7de29abe404e900c106fa8c8cb/

测试

模型改为上面设置的名字

复制代码
curl http://172.17.0.3:10000/v1/completions   -H "Content-Type: application/json"     -d '{                                                       
        "model": "Qwen-Lora",                                                                                                                                                      
        "prompt": "San Francisco is a",                                                                                                                                            
        "max_tokens": 7,                                                                                                                                                           
        "temperature": 0                                                                                                                                                           
    }'
相关推荐
Raas1001 天前
MAI Gateway实战部署:AI网关怎么部署?从0到1上手指南
人工智能·gateway·ai网关·企业级ai网关·企业级产品·ai技术交流
4SAPI2 天前
会议智能处理大模型 API 生产选型指南:4SAPI、硅基流动与 OpenRouter 的架构权衡
人工智能·架构·自动化·gateway·php
JJJennie7772 天前
MAI Gateway实战部署:大模型网关部署方案?从0到1上手指南
数据库·人工智能·gateway·ai网关
Raas1003 天前
AI网关用开源够用吗?MAI Gateway入选2026年企业级AI网关推荐清单
人工智能·开源·gateway·ai网关·mai gateway·企业级ai网关·企业级产品
Raas1003 天前
MAI Gateway(魔芋企业级AI网关)选购攻略:AI网关厂商排名?避坑指南与对比
大数据·人工智能·网关·gateway·mai gateway·企业级产品
JJJennie7773 天前
大模型网关部署方案?MAI Gateway从部署到上线全流程
人工智能·gateway·ai网关
JJJennie7774 天前
MAI Gateway私有化部署全攻略:大模型网关怎么部署?附架构图
开源·gateway·ai网关
Raas1004 天前
MAI Gateway选购攻略:开源AI网关有哪些?避坑指南与对比
大数据·人工智能·gateway·ai网关·企业级ai网关·企业级ai产品
Orange_sparkle5 天前
Pi Agent Gateway 使用指南:给 Pi 配上可视化、可扩展的 Agent 工作台
ai·gateway·pi·pi sdk