.. meta::
   :description: Overview of the SGLang-Neuron plug-in, which runs SGLang LLM serving on AWS Trainium3 and SGLang Diffusion on Trainium2 from a Neuron container image.
   :keywords: SGLang, SGLang-Neuron, SGLang Diffusion, AWS Neuron, Trainium, Trn3, Trn2, prefill-decode disaggregation, NIXL, EFA, overview
   :date-modified: 2026-11-16

.. _sglang-neuron-overview:

What is SGLang-Neuron?
======================

.. note::

   SGLang-Neuron is in public preview. Features, APIs, and supported models can change in later releases.

The SGLang-Neuron plug-in is a Neuron platform for `SGLang <https://github.com/sgl-project/sglang>`__. With SGLang-Neuron, you serve open models on AWS Trainium with the same SGLang launcher, server flags, and HTTP API that you use on other hardware. SGLang-Neuron is released by RadixArk in collaboration with the AWS Neuron team. Its source code is in the `sglang-neuron repository on GitHub <https://github.com/sgl-project/sglang-neuron>`__.

Applies to
----------

- **LLMs:** trn3.48xlarge instances. Kimi-K3 needs a Trn3 UltraServer, with at least two trn3.48xlarge instances connected by a switch.
- **Diffusion models:** trn2.48xlarge instances.
- **Software:** SGLang-Neuron 0.1.0 on Neuron SDK 2.33.0, in the container image ``public.ecr.aws/neuron/pytorch-inference-sglang-neuron:v0.1.0-neuron-py314-sdk-2.33.0-ubuntu26.04``.

How SGLang-Neuron works
-----------------------

SGLang selects its hardware platform at start. The container image sets ``SGLANG_PLATFORM=neuron``, so SGLang loads the Neuron platform from the plug-in. You do not set more options to select it. The plug-in runs the models on TorchNeuron (``torch-neuronx``), and it compiles each model's graphs with the Neuron compiler.

The plug-in runs all supported LLMs on one runtime with fully asynchronous scheduling and execution. The diffusion models run on a separate Neuron platform for SGLang Diffusion, with NKI kernels for attention and for the variational autoencoder (VAE).

The plug-in checks each launch before it starts. If a launch asks for a feature or a layout that the plug-in does not serve, the launch stops with a message that names the setting. The plug-in also refuses a request that it cannot serve exactly. It does not serve the request with the option removed. For the features that each model serves, see :ref:`sglang-neuron-feature-compatibility-ref`.

The first start of a model compiles its programs. The server writes the compiled programs to the directories that ``TORCH_NEURONX_NEFF_CACHE_DIR``, ``TORCH_NEURONX_HLO_CACHE_DIR``, and ``NKI_COMPILE_CACHE_URL`` name. The example scripts point them at the mounted ``/cache`` directory. Later starts with the same cache directory load the programs and do not compile them again.

Aggregated and disaggregated serving
------------------------------------

SGLang-Neuron serves LLMs in two layouts:

- **Aggregated serving.** One server on one node does both the prefill (the prompt) and the decode (the answer). Use this layout for the smaller models, such as Qwen3-8B.
- **Prefill-decode (PD) disaggregated serving.** A prefill server on one node computes the KV cache of each prompt. It sends the KV cache to a decode server on a different node with NIXL over Elastic Fabric Adapter (EFA). The decode server generates the answer. A balancer in front of the two servers sends each request to both. The large models, such as GPT-OSS-120B, Kimi-K3, and GLM-5.2, use this layout.

Both servers of a PD pair must run the same container image, because the KV transfer uses the patched NIXL in the image. For the layout of each model, see :ref:`sglang-neuron-supported-models-ref`.

What the container image contains
---------------------------------

In this public preview, the container image is the only supported way to run SGLang-Neuron. The image contains:

- SGLang at commit ``43881a7``, with its runtime dependencies and the SGLang Diffusion packages for all five diffusion models in :ref:`sglang-neuron-supported-models-ref`.
- The SGLang-Neuron plug-in.
- The Neuron SDK 2.33.0 packages: the compiler, the runtime, ``torch``, and ``torch-neuronx``.
- NIXL, with the patches that disaggregated serving needs.
- Example scripts for each model at ``/opt/sglang-neuron/examples/<folder>/``.
- The Hugging Face CLI (``hf``), to download checkpoints.

When to use SGLang-Neuron
-------------------------

Use SGLang-Neuron when:

- Your serving stack already uses SGLang, and you want to run it on Trainium with no change to your launch commands or clients.
- You serve one of the models in :ref:`sglang-neuron-supported-models-ref`.
- You generate reinforcement learning (RL) rollouts with SGLang.

Use :ref:`vLLM Neuron <vllm-neuron-home>` when your stack uses vLLM, or when you serve a model that SGLang-Neuron does not support.

Related concepts
----------------

- :ref:`Inference on AWS Neuron <inference-home>`
- :ref:`vLLM Neuron <vllm-neuron-home>`
- :ref:`TorchNeuron: Native PyTorch on AWS Neuron <torch-neuron-home>`

Further reading
---------------

- :ref:`Quickstart: Serve Qwen3-8B with SGLang-Neuron <sglang-neuron-quickstart>`
- :ref:`Tutorial: Serve GPT-OSS-120B with prefill-decode disaggregation <sglang-neuron-gpt-oss-disaggregated-tutorial>`
- :ref:`SGLang-Neuron feature compatibility <sglang-neuron-feature-compatibility-ref>`
- :ref:`SGLang-Neuron release notes <sglang_rn>`
