oc9-sglang:0.5.9opencloudos/opencloudos9-cuda-devel:12.8[all] 扩展,包含 vLLM、flashinfer 等推理依赖)/workspacedocker build -t oc9-sglang:0.5.9 .
docker run --rm --gpus all oc9-sglang:0.5.9 \
python3 -c "import sglang as sgl; print(sgl.__version__)"
下载模型权重(以 Qwen2.5-7B-Instruct 为例):
sudo dnf install -y git-lfs
sudo git lfs install
sudo mkdir -p /models
sudo git clone https://www.modelscope.cn/Qwen/Qwen2.5-7B-Instruct.git \
/models/Qwen2.5-7B-Instruct
启动 OpenAI 兼容服务:
docker run -itd --name sglang_serving --rm \
--gpus all \
--shm-size 16g \
-p 30000:30000 \
-v /models/Qwen2.5-7B-Instruct:/models/Qwen2.5-7B-Instruct \
oc9-sglang:0.5.9 \
python3 -m sglang.launch_server \
--model-path /models/Qwen2.5-7B-Instruct \
--host 0.0.0.0 \
--port 30000
curl http://localhost:30000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen2.5-7B-Instruct",
"messages": [{"role": "user", "content": "你好"}],
"max_tokens": 128
}'
bash ../test.sh oc9-sglang:0.5.9
Content type
Image
Digest
sha256:b39327b80…
Size
12.8 GB
Last updated
6 months ago
docker pull ocpub/oc9-sglang:0.5.9