Skip to main content
You can install SGLang using any of the methods below. Please go through System Settings section to ensure the clusters are operating at optimal performance. Feel free to leave an issue here at sglang if you encounter any issues or have any problems.

Component Version Mapping For SGLang

ComponentVersionObtain Way
HDK25.5.2link
CANN9.0.0Obtain Images
TorchNPU26.0.0link
MemFabric1.0.8pip install memfabric-hybrid==1.0.8
Triton3.2.1.dev20260530pip install triton-ascend==3.2.1.dev20260530 \
--extra-index-url=https://mirrors.huaweicloud.com/ascend/repos/pypi/nightly \
--trusted-host mirrors.huaweicloud.com
SGLang NPU Kernel2026.05.01.post3link
MemFabric-zbal1.1.1pip install memfabric-zbal==1.1.1

Obtain CANN Image

Ensure sufficient disk space before pulling images. Each Docker image requires at least 30GB of free space.
You can obtain the dependency of a specified version of CANN through an image.
Command

Preparing the Running Environment

Method 1: Installing from source with prerequisites

Python Version

Only python==3.11 is supported currently. If you don’t want to break system pre-installed python, try installing with conda.
Command
Note on Anaconda repository restrictions If you encounter an error like “Terms of Service have not been accepted” during the conda create step, the default Anaconda repository is blocking package downloads. To resolve this, configure a mirror (e.g., Tsinghua Open Source Mirror):
Command
Edit the system-level conda config to remove any hardcoded defaults, e.g., vi ~/miniconda3/.condarc Then remove the failed environment and recreate it:
Command

CANN

Prior to start work with SGLang on Ascend you need to install CANN Toolkit, Kernels operator package and NNAL version 9.0.0, check the installation guide

MemFabric-Hybrid

If you want to use PD disaggregation mode, you need to install MemFabric-Hybrid. MemFabric-Hybrid is a drop-in replacement of Mooncake Transfer Engine that enables KV cache transfer on Ascend NPU clusters.
Command

MemFabric-zbal

MemFabric-zbal is a Zero Buffer Acceleration Library of high-performance operators for LLM inference and training on Ascend, accelerating computation by eliminating intermediate memory buffers; it is required only on aarch64 clusters and is installed in addition to MemFabric-Hybrid.
Command

PyTorch and PyTorch Framework Adaptor on Ascend

Command
If you are using other versions of torch and install torch_npu, check installation guide

Triton on Ascend

We provide our own implementation of Triton for Ascend.
Command
For installation of Triton on Ascend nightly builds or from sources, follow installation guide

SGLang Kernels NPU

We provide SGL kernels for Ascend NPU, check installation guide.

DeepEP-compatible Library

We provide a DeepEP-compatible Library as a drop-in replacement of deepseek-ai’s DeepEP library, check the installation guide.

Some other dependencies

Command

Installing SGLang from source

Command

Method 2: Using Docker Image

Obtain Image

You can download the SGLang image or build an image based on Dockerfile to obtain the Ascend NPU image.
Ensure sufficient disk space before pulling images. Each Docker image requires at least 30GB of free space. If you need to download model weights, check the model size at ModelScope to reserve enough space.
  1. Download SGLang image
We publish both stable releases and daily builds. Choose a stable release tag (e.g., v0.5.13.post1-cann9.0.0-a3) if you prefer a validated version, or a daily build tag (e.g., main-cann9.0.0-a3) if you need the latest development changes.
Command
  1. Build an image based on Dockerfile
Command

Create Docker

Notice: --privileged and --network=host are required by RDMA, which is typically needed by Ascend NPU clusters.
Command
SGLang will serve on http://127.0.0.1:30000 by default. You can change the host and port by --host and --port parameters.

System Settings

CPU performance power scheme

The default power scheme on Ascend hardware is ondemand which could affect performance, changing it to performance is recommended.
Command

Disable NUMA balancing

Command

Prevent swapping out system memory

Command

Running SGLang Service

Running Service For Large Language Models

PD Mixed Scene

Command

PD Disaggregation Scene

  1. Launch Prefill Server
Command
  1. Launch Decode Server
Command
  1. Launch Router
Command
The 8995 in command script is the disaggregation bootstrap port. It must match the --disaggregation-bootstrap-port value set on the prefill server in step 1.

Running Service For Multimodal Language Models

PD Mixed Scene

Command

Testing the Service

Once the server prints The server is fired up and ready to roll! in the logs, it is ready to accept requests.

Which port to send requests to

The port you use depends on your deployment mode:
SGLang defaults to port 30000 when --port is not specified. The examples in this guide use explicit ports for clarity.

Health Check

Command
A successful response returns HTTP 200 with an empty body.

Generate (Native Endpoint)

Command
The expected output should contain “Paris”.

Chat Completions (OpenAI-Compatible)

Command
Some models return responses accompanied with thinking process content. To disable this output, configure parameters as follows:
Command
The expected output should contain “Paris”.

Multimodal Chat Completions

The image URL in the example below references an external resource (raw.githubusercontent.com). Make sure the server has internet access so the image can be downloaded at inference time. Alternatively, you can use a locally accessible URL or base64-encoded image data.
Command