What problem does it solve?
Fast, reliable LLM serving that can produce strictly structured outputs while avoiding repeated recomputation of long shared prefixes across requests.
Core Features & Use Cases
- RadixAttention prefix caching: Automatically caches and reuses KV cache for common prompt prefixes (e.g., system prompts, tool specs, few-shot examples) to reduce latency and cost.
- Structured generation controls: Constrain outputs using JSON schema, regex, or grammar for tools, extraction, and agentic workflows.
- Production-grade serving: Run an OpenAI-compatible API server with batching, multi-GPU tensor parallelism, and optional speculative decoding for throughput.
Use case example: You run an agent that repeatedly calls the same tools with a stable system prompt and tool definitions; SGLang reuses cached prefixes so only the new user content is computed, enabling faster JSON tool-call results.
Quick Start
Launch the SGLang server for your model at port 30000 with RadixAttention enabled by running: python -m sglang.launch_server --model-path meta-llama/Meta-Llama-3-8B-Instruct --port 30000 --enable-radix-cache