【vLLM】使用vLLM部署本地模型
·
官网
GitHub源码
https://github.com/vllm-project/vllm
官方文档
https://docs.vllm.ai/en/stable/
部署命令示例1
https://recipes.vllm.ai/
部署命令示例2
https://docs.vllm.ai/projects/recipes/en/latest/CONTRIBUTING.html
所有命令参数
https://docs.vllm.ai/en/stable/configuration/engine_args/
拉取docker镜像
docker pull vllm/vllm-openai:latest
启动模型
示例
docker run --name vllm-Qwen3.5-4B ^
--gpus all ^
-p 8080:8080 ^
-v C:\xudawu\development\20260703_models_openai:/models ^
--ipc=host ^
vllm/vllm-openai:latest /models/Qwen3.5-4B ^
--host 0.0.0.0 ^
--port 8080 ^
--max-model-len 33264 ^
--reasoning-parser qwen3 ^
--tool-call-parser qwen3_coder ^
--enable-auto-tool-choice ^
--served-model-name Qwen3.5-4B-FP4 ^
--max-num-seqs 1 ^
--enable-chunked-prefill ^
--gpu-memory-utilization 0.85
--enable-prefix-caching ^
--cpu-offload-gb 10 ^
--enforce-eager
使用cpu-offload-gb将模型卸载到内存时,大部分模型还需要使用--enforce-eager,会降低模型生成tokens速度
要使用的gpu_id
--device-ids 2,3,5,7
使用序号为2、3、5、7的显卡
模型切分到多少张显卡
-tp 8
使用8张显卡
量化
vllm的量化docs
https://docs.vllm.ai/projects/llm-compressor/en/latest/steps/compress/#prerequisites
更多推荐


所有评论(0)