sglang-serving

Launch and tune SGLang servers with constrained decoding and RadixAttention.

17|3|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/jayll1303/AIEKit --skill sglang-serving
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sglang-serving
Source: https://github.com/jayll1303/AIEKit/tree/main/.kiro/skills/sglang-serving
Command: npx skills add https://github.com/jayll1303/AIEKit --skill sglang-serving

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Deploying and tuning LLM inference servers that require structured outputs, shared-prefix caching, and multi-GPU scaling is complex and error-prone. This skill consolidates launch patterns, performance tuning, and diagnostics for SGLang Runtime to reliably serve constrained JSON/regex/EBNF outputs, enable RadixAttention prefix caching, and run quantized models in production.

Core Features & Use Cases

  • Server Launch & Configuration: Examples and recommended flags for launching sglang.launch_server with model-path, port, tensor parallelism (tp), mem-fraction, and chunked prefill.
  • RadixAttention & Prefix Caching: Strategies and monitoring tips for maximizing throughput on shared-prefix workloads such as long system prompts and few-shot examples.
  • Structured Output: Native constrained decoding via json_schema, regex, and EBNF for always-valid JSON, format-constrained responses, and grammar-enforced outputs.
  • Quantized & Multi-GPU Serving: Guidance for serving FP8, AWQ, GPTQ models, TP/DP configurations, and recommendations to avoid OOM and NCCL/NVLink pitfalls.
  • Diagnostics & Tuning: Procedures for VRAM estimation, cache hit monitoring, chunked prefill sizing, TP requirements, and resolving model load failures.
  • Use Case Example: Serve a user-profile JSON API that enforces a schema and scales across GPUs using RadixAttention to accelerate many clients sharing the same system prompt.

Quick Start

Launch an SGLang server for meta-llama/Llama-3.1-8B-Instruct on port 30000 and verify the /v1/models endpoint returns the model list.

Frequently Asked Questions about sglang-serving

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I serve LLMs with structured JSON or regex constrained decoding?

Serve LLMs with structured constrained decoding using native json_schema, regex, and EBNF formats to enforce always-valid JSON and grammar-constrained responses. This ensures format-constrained outputs directly during high-throughput inference.

How does RadixAttention prefix caching improve LLM inference throughput?

RadixAttention prefix caching improves LLM inference throughput by storing and reusing computations for shared-prefix workloads like long system prompts and few-shot examples. This maximizes throughput when many clients share identical context prefixes.

What's the best way to configure tensor parallelism for multi-GPU LLM serving?

Configure tensor parallelism for multi-GPU LLM serving by setting tp and dp flags during server launch. This scales inference across GPUs while avoiding NCCL/NVLink pitfalls and OOM errors through recommended mem-fraction tuning and VRAM estimation.

Can I serve quantized FP8, AWQ, and GPTQ models with SGLang?

You can serve quantized FP8, AWQ, and GPTQ models with SGLang to reduce memory footprint. The runtime provides specific guidance for quantized model serving scenarios to ensure stable multi-GPU deployment without OOM errors.

Why does my LLM inference server run out of memory or fail to load models?

LLM inference servers run out of memory or fail to load models due to incorrect mem-fraction sizing or TP requirements. Diagnose OOM errors and model load failures using provided VRAM estimation procedures and chunked prefill tuning recommendations.

How do I launch an OpenAI-compatible API server for Llama models?

Launch an OpenAI-compatible API server for Llama models using sglang.launch_server with model-path and port flags. Verify the /v1/models endpoint returns the model list to confirm successful deployment of the high-throughput runtime.