What problem does it solve? Serving LLMs in production wastes compute when every request recomputes shared prefixes like system prompts, few-shot examples, and tool definitions, and generating valid JSON or regex-constrained output from models is unreliable without constrained decoding. ## Core Features & Use Cases - RadixAttention Prefix Caching: Automatically caches and reuses KV cache for shared prefixes across requests, delivering 5-10x speedups for agent workflows and few-shot prompting. - Structured Generation: Constrain outputs with JSON schemas, regex patterns, or EBNF grammars for guaranteed-valid structured data extraction. - Production Deployment: OpenAI-compatible API server with tensor parallelism, FP8/AWQ/GPTQ quantization, Prometheus metrics, Kubernetes manifests, and autoscaling guidance. - Use Case: Build an agent that handles hundreds of queries against the same system prompt and tool definitions; SGLang caches the shared prefix so each new request only computes the unique user query, cutting latency from 1.8s to 0.35s. ## Quick Start Install sglang with pip, launch a server for a Llama model on port 30000, and send a chat completion request to the OpenAI-compatible endpoint.