Skip to main content
You can install SGLang using one of the methods below. This page primarily applies to common NVIDIA GPU platforms. For other platforms, please refer to the dedicated pages for AMD GPUs, Intel Xeon CPUs, TPU, Ascend NPUs, and Intel XPU.

Quick Installation

1

Install with pip or uv (Recommended)

It is recommended to use uv for faster installation:
This will install SGLang with CUDA 12.9 support by default, which is compatible with most recent NVIDIA GPUs.
2

Verify Installation

After installation, verify that SGLang is working:

Installation Methods

Method 1: Install with pip or uv

The simplest way to install SGLang:
For CUDA 13 support on B300/GB300 GPUs, Docker is recommended. If you don’t have Docker access:
1

Install PyTorch with CUDA 13

2

Install SGLang

3

Install sgl_kernel for CUDA 13

Install the appropriate wheel from sgl-project whl releases:
Replace X.Y.Z with the sgl_kernel version from uv pip show sgl_kernel.
CUDA_HOME not set:If you encounter OSError: CUDA_HOME environment variable is not set, try one of these solutions:
Reinstall FlashInfer:
Blackwell GPU (B300/GB300) ptxas error:

Method 2: Install from Source

For development or to use the latest features:
For development, use the dev docker image lmsysorg/sglang:dev. See the development guide for details.

Method 3: Using Docker

Docker images are available at lmsysorg/sglang.
Replace <secret> with your Hugging Face hub token.
The runtime variant is ~40% smaller than the full image by excluding build tools and development dependencies, making it ideal for production deployments.

Method 4: Using Kubernetes

Check out OME, a Kubernetes operator for enterprise-grade LLM serving.
For models that fit on one node:
For large models requiring multiple GPU nodes:

Method 5: Using Docker Compose

For production, use the k8s-sglang-service.yaml instead.
1

Copy compose.yml

Download the compose.yml to your local machine.
2

Launch the service

Method 6: Using SkyPilot

Deploy on Kubernetes or 12+ clouds with SkyPilot.
1

Install SkyPilot

Follow SkyPilot’s documentation to install and configure cloud access.
2

Create sglang.yaml

sglang.yaml
3

Deploy

For autoscaling and failure recovery, check out the SkyServe + SGLang guide.

Method 7: AWS SageMaker

AWS provides SGLang DLCs with routine security patching.To host with your own container:
1

Build Docker container

Build with sagemaker.Dockerfile and the serve script.
2

Push to AWS ECR

build-and-push.sh
3

Deploy model

Use deploy_and_serve_endpoint.py to deploy. See sagemaker-python-sdk for more details.
Customize server parameters using environment variables with the SM_SGLANG_ prefix. For example, SM_SGLANG_MODEL_PATH=Qwen/Qwen3-0.6B and SM_SGLANG_REASONING_PARSER=qwen3.

Hardware-Specific Installation

AMD GPUs (ROCm)

For AMD GPUs like MI300X:
See the AMD GPU documentation for system optimization and tuning guides.

Google TPU

SGLang supports TPUs through the SGLang-JAX backend:
See the TPU documentation for feature support and optimized models.

Intel CPUs

See the CPU Server documentation for Intel Xeon CPU deployment instructions.

Ascend NPUs

See the Ascend NPU documentation for Huawei Ascend NPU installation.

Dependencies

SGLang has the following core dependencies (from pyproject.toml):
  • Python: >=3.10
  • PyTorch: 2.9.1 (CUDA 12.9 by default)
  • FlashInfer: 0.6.4 (attention kernel backend)
  • Transformers: 4.57.1
  • FastAPI: Web server framework
  • OpenAI: 2.6.1 (API compatibility)
  • sgl-kernel: 0.3.21 (custom CUDA kernels)
Optional dependencies:
  • Diffusion: For image/video generation models
  • Tracing: OpenTelemetry integration
  • Test: Development and testing tools

Common Notes

FlashInfer: Default attention kernel backend. Only supports sm75 and above (T4, A10, A100, L4, L40S, H100, B200, etc.).If you encounter FlashInfer issues on supported GPUs, switch to alternative backends:
Shared Memory: Docker and Kubernetes deployments require sufficient shared memory (--shm-size 32g for Docker, update /dev/shm size for Kubernetes).

Next Steps

After installation:
  1. Launch your first server
  2. Send API requests
  3. Explore server arguments
  4. Learn about model support