# What is SGLang?

> SGLang is an open-source engine for serving LLMs. Its RadixAttention reuses the KV cache across requests, and it adds structured output and an OpenAI-compatible API.

Source: https://www.honeyhive.ai/learn/sglang (updated 2026-11-19)

SGLang is an open-source framework for serving large language models. The project's [README](https://github.com/sgl-project/sglang) calls it an inference framework for language, vision-language and diffusion models, licensed Apache-2.0 and optimized for agentic workloads, large-scale serving and reinforcement learning rollouts. Its best-known idea is RadixAttention, which reuses the [KV cache](/learn/kv-cache) across requests.

## Where it came from

SGLang started as a language plus a runtime. The 2023 [paper](https://arxiv.org/abs/2312.07104) by Lianmin Zheng, Ying Sheng and colleagues describes a Python-embedded frontend for programs with multiple generation calls, control flow and structured inputs and outputs, and a runtime that executes them. The authors report up to 6.4 times higher throughput than state-of-the-art inference systems on workloads such as agent control, JSON decoding, retrieval-augmented generation and multi-turn chat.

Today the project presents itself mainly as a serving engine. Its [docs](https://docs.sglang.io/) describe a serving framework for large language and multimodal models, from a single GPU to distributed clusters, and the repository says it is hosted by LMSYS, a non-profit.

## RadixAttention

Many programs that call a model send the same prefix again and again: a system prompt, few-shot examples, a chat history. The LMSYS [launch post](https://www.lmsys.org/blog/2024-01-17-sglang/) (January 2024) explains that SGLang keeps the KV cache of prompts and generation results in a radix tree that maps token sequences to cache tensors. The tensors stay on the GPU, one token per page, while the tree lives on the CPU. When memory fills, it evicts least recently used leaf nodes, and a cache-aware scheduler orders requests to raise the hit rate.

The same post reports up to 5 times higher throughput than Guidance and vLLM in its tests, on Llama-7B with one A10G GPU and Mixtral-8x7B on eight A10G GPUs. Those numbers are from 2024 against vLLM 0.2.5, so treat them as the shape of the idea, not a current ranking. This is the engine-side version of [prompt caching](/learn/prompt-caching): the provider features reuse a shared prefix, and RadixAttention does it for a model you host yourself.

## What else it does

| Capability | What the docs say |
|---|---|
| Structured output | [JSON schema, regex or EBNF](https://docs.sglang.io/advanced_features/structured_outputs.html), one per request. XGrammar is the default backend; Outlines and Llguidance are selected with `--grammar-backend` |
| Parallelism and quantization | Server [arguments](https://docs.sglang.io/advanced_features/server_arguments.html) include `--tp-size` for tensor parallelism and `--quantization` |
| Scheduling | The same [arguments page](https://docs.sglang.io/advanced_features/server_arguments.html) shows `--schedule-policy` defaulting to `fcfs`, with other policies such as `lpm` available |
| Hardware | The [README](https://github.com/sgl-project/sglang) lists NVIDIA, AMD Instinct, Google TPU, Intel, Apple Silicon, Huawei Ascend NPUs and Moore Threads |
| Models | The [docs](https://docs.sglang.io/) name Llama, Qwen and DeepSeek, and the [repository](https://github.com/sgl-project/sglang) topics add GLM, GPT-OSS and MiniMax |

See [structured output](/learn/structured-output-llm) for why constrained decoding matters and [LLM inference](/learn/llm-inference) for the serving basics around it.

## Running it

The quickstart in the [docs](https://docs.sglang.io/basic_usage/send_request.html) launches a server with one command:

```bash
python3 -m sglang.launch_server --model-path qwen/qwen2.5-0.5b-instruct --host 0.0.0.0
```

The server then answers OpenAI-style requests. The docs point the OpenAI Python client at `http://127.0.0.1:{port}/v1` and call `client.chat.completions.create`, so code written for a hosted API usually needs only a new base URL and model name. The model in that example, Qwen2.5-0.5B-Instruct, is one of the [open-weight models](/learn/open-weight-models) it can serve.

## Version 1.0

A tracking [issue](https://github.com/sgl-project/sglang/issues/50045) opened on November 12, 2026 describes 1.0 as a stability release that hardens existing features rather than adding new ones. It promises no major restructuring of core features before the release branch, explicit errors for unsupported settings, and a compatibility policy for 1.x covering CLI flags, environment variables, HTTP routes and the Python `Engine` API. It also lists breaking changes, such as removing some deprecated flags. As of November 19, 2026 the issue says no release date has been set, and the latest tagged release is [v0.5.23](https://github.com/sgl-project/sglang/releases/tag/v0.5.23) from November 2, 2026.

## What to track

A self-hosted engine gives you numbers an API hides, such as cache hit rate and queue time, but your application still needs to record what each call did. HoneyHive's [tracing concepts](https://docs.honeyhive.ai/v2/tracing/concepts.md) describe events that capture inputs, outputs and metadata such as token counts, which lets you compare latency and [time to first token](/learn/time-to-first-token) before and after a change in prefix or engine settings. More in [LLM observability](/learn/llm-observability).

## FAQ

### What is SGLang?

An open-source inference framework. The [GitHub project](https://github.com/sgl-project/sglang) describes it as covering large language, vision-language and diffusion models, under the Apache-2.0 license.

### What is RadixAttention?

SGLang's method for reusing the KV cache between requests. The LMSYS [blog post](https://www.lmsys.org/blog/2024-01-17-sglang/) says it keeps the cache of prompts and generations in a radix tree instead of discarding it after each request.

### Is SGLang OpenAI compatible?

Yes. The [docs](https://docs.sglang.io/basic_usage/send_request.html) show the standard OpenAI Python client pointed at a local SGLang server's /v1 route, calling chat completions.

### Who maintains SGLang?

The [repository](https://github.com/sgl-project/sglang) says SGLang is hosted by LMSYS, a non-profit open-source organization.

### Has SGLang reached version 1.0?

Not as of November 19, 2026. A [tracking issue](https://github.com/sgl-project/sglang/issues/50045) opened on November 12, 2026 calls 1.0 a stability release and says no release date has been set.
