程序员开发实例大全宝库

网站首页 > 编程文章 正文

centos7.8环境下ollama和vllm两种方式安装DeepSeek-R1-32B模型

zazugpt 2025-04-09 22:34:53 编程文章 31 ℃ 0 评论

环境

centos7.8

python3.8

vllm0.5.5

显卡Quadro RTX 6000

驱动NVIDIA-SMI 570.124.04 Driver Version: 570.124.04

cuda版本为 Cuda compilation tools, release 12.4, V12.4.131

通过ollama安装

用docker安装ollama比较顺利

docker pull registry.cn-hangzhou.aliyuncs.com/zrng/ollama:0.4.6
docker run -d -v ollamagpu:/root/.ollamagpu -e OLLAMA_HOST=0.0.0.0 -e OLLAMA_ORIGINS=* --gpus all --ulimit memlock=-1 --ulimit stack=67108864 \ -v /usr/lib/x86_64-linux-gnu/libcuda.so:/usr/lib/x86_64-linux-gnu/libcuda.so -p 11435:11434 --name ollamagpu registry.cn-hangzhou.aliyuncs.com/zrng/ollama:0.4.6
docker exec -it ollamagpu  ollama run deepseek-r1:32b

通过vllm安装

安装一定要注意python、cuda、驱动、vllm、pytorch版本要匹配!!!

vllm serve  /home/admin/deepseek/modles/DeepSeek-R1-Distill-Qwen-7B  --host=0.0.0.0 --port=8000    --trust-remote-code   --max-model-len=8172 --block-size=8 --gpu-memory-utilization=0.75  --swap-space=4   --max-num-seqs=2   --dtype=half      --max-parallel-loading-workers=1

vllm跑14b就报显存溢出了。

curl测试

curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{
  "model": "/home/admin/deepseek/modles/DeepSeek-R1-Distill-Qwen-7B",
  "prompt": "Hello!",
  "max_tokens": 50 
}'

curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
  "model": "/home/admin/deepseek/modles/DeepSeek-R1-Distill-Qwen-7B",
  "messages": [
    {"role": "user", "content": "用一句话解释量子计算"}
  ]
}'

chatbox测试

使用jmeter做一下压力测试

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表