---
title: 安装验证
description: "1. 验证SGLang是否安装成功。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengai/ecosystemEnable/sglang/kunpengsglang_04_0006.html
sourcePath: /source/zh/kunpengai/ecosystemEnable/sglang/kunpengsglang_04_0006.html
indexId: 4d0e442712a5a27a88477275cbb5a904ac3b27ed93bb8a5f1ec641fd77ee788c70
---
# 安装验证

1. 验证SGLang是否安装成功。
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 python3 - <<'PY' import sglang import sgl_kernel import torch print("sglang_version=" + getattr(sglang, "__version__", "unknown")) print("sgl_kernel_import=ok") print("torch_cuda=" + str(torch.version.cuda)) print("cuda_built=" + str(torch.backends.cuda.is_built())) print("cuda_available=" + str(torch.cuda.is_available())) assert getattr(sglang, "__version__", "") == "0.5.10" assert torch.backends.cuda.is_built() assert torch.cuda.is_available() PY

  预期输出如下信息。 1 2 3 4 5 sglang_version=0.5.10 sgl_kernel_import=ok torch_cuda=13.0 cuda_built=True cuda_available=True

2. 最小启动示例。以启动SGLang推理服务为例。
  1 2 3 4 python3 -m sglang.launch_server \ --model-path facebook/opt-125m \ --host 0.0.0.0 \ --port 30000

  服务启动后，可使用如下命令确认接口可访问：

  1 curl http://127.0.0.1:30000/health

  facebook/opt-125m为小规模公开模型，适合用于确认服务进程和接口可启动；生产环境请替换为实际业务模型。
