GPUStack GPU 集群管理
GPUStack 用于管理异构 GPU 集群和大模型部署,提供模型市场、OpenAI 兼容 API、GPU 调度和多节点 worker。适合中小团队快速搭建内部推理平台。
核心概念:server、worker、model、backend(vLLM/SGLang/llama.cpp)和 GPU 资源池。
Docker 启动 server:
docker run -d --name gpustack \
--gpus all \
-p 80:80 -p 10150:10150 \
-v gpustack-data:/var/lib/gpustack \
gpustack/gpustack
获取初始密码:
docker exec gpustack cat /var/lib/gpustack/initial_admin_password
添加 worker:
docker run -d --name gpustack-worker \
--gpus all \
-e GPUSTACK_SERVER_URL=http://server:80 \
-e GPUSTACK_TOKEN=<TOKEN> \
gpustack/gpustack
部署模型(UI 或 API):
curl -X POST http://localhost/v1/models \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"name":"qwen2.5-7b","source":"huggingface","huggingface_repo_id":"Qwen/Qwen2.5-7B-Instruct"}'
OpenAI 兼容调用:
curl http://localhost/v1-openai/chat/completions \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"model":"qwen2.5-7b","messages":[{"role":"user","content":"你好"}]}'
GPUSTACK_SERVER_URL 和端口。gpustack-data。