Sglang Prod Incident Triage logo

Sglang Prod Incident Triage

Community
BBuf
sglang-prod-incident-triage

Replay-first debug flow for SGLang serving problems. Use when a live or recent server shows health-check failures, latency or throughput regressions, queue growth, timeouts, distributed stalls, crash dumps, wrong outputs after deploys, or PD/EP/HiCache issues, and the job is to turn the problem into a replay plus the right next debug tool.

Overview

PublisherBBuf
RepositoryAI-Infra-Auto-Driven-SKILLS
Skill namesglang-prod-incident-triage
Stars
946
Forks
83
Bundled files
6
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by BBuf on GitHub. Read the source before you install it.

Installation

Install the Sglang Prod Incident Triage AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/BBuf/AI-Infra-Auto-Driven-SKILLS/tree/main/skills/sglang-prod-incident-triage
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/BBuf/AI-Infra-Auto-Driven-SKILLS.git /tmp/AI-Infra-Auto-Driven-SKILLS
mkdir -p .claude/skills
cp -r /tmp/AI-Infra-Auto-Driven-SKILLS/skills/sglang-prod-incident-triage .claude/skills/sglang-prod-incident-triage
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sglang Prod Incident Triage in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sglang Prod Incident Triage on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sglang Prod Incident Triage is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SGLang Serving Debug

Use the maintained source contracts when applying historical evidence to a current branch. The review/history corpora retain their own capture dates; they do not certify today's dispatch or numerical defaults. For kernel replacements, verify that the real model executes the candidate before treating end-to-end tests as coverage.

Overview

Use this skill to turn a live serving problem into a debug path you can replay.

Use one loop:

  • collect a baseline bundle
  • save the failing request or crash dump
  • replay on a clean target
  • only then switch tools

Do not start with profiling.

As of SGLang v0.5.21 (2026-09-29), two extra live-server signals matter:

  • --enable-session-radix-cache plus /close_session: agent or RL rollouts that forget to close sessions can look like unexplained KV growth
  • the opt-in Rust ingress (SGLANG_RUST_SERVER=1) has no API-key boundary; if the incident is auth-related, confirm which server binary is actually serving before blaming application tokens

This skill should work with more focused skills instead of re-implementing them:

  • debug-cuda-crash when replay plus coredump points to a CUDA crash path
  • debug-distributed-hang when the problem is clearly a TP/PP/DP/EP hang
  • llm-torch-profiler-analysis when the issue is already narrowed to a compute-side path

Three examples are included:

  • TTFT spike with low queue time
  • replay-first CUDA crash flow
  • request-shaped distributed hang flow

Output Contract

Return:

  • problem class
  • what was checked
  • strongest signal so far
  • current best guess
  • what was ruled out
  • next step
  • production risk

When To Use It

  • /health or /health_generate is unhealthy
  • latency or throughput regressed under serving load
  • queue size grows while health still looks green
  • one request class times out or hangs
  • the server crashes only after some requests
  • outputs changed after a deploy, topology change, or weight switch
  • one older commit is known-good and a newer commit is known-bad

Workflow

1. Collect a baseline bundle

Confirm the ingress first: Python /server_info.frontend is python. Rust ingress lacks /v1/loads, /metrics, /configure_logging, /hicache/*, /set_trace_level, /start_profile and /ready; 404 there is an ingress limitation. Rust health stays 503 until startup warmup succeeds.

If a live server is reachable, collect a read-only bundle before anything more intrusive:

bash
python3 scripts/incident_artifact_tool.py collect-bundle \
  --base-url http://127.0.0.1:30000 \
  --outdir /tmp/incident_bundle

python3 scripts/incident_artifact_tool.py summarize-bundle \
  /tmp/incident_bundle

If the server is protected:

bash
python3 scripts/incident_artifact_tool.py collect-bundle \
  --base-url http://127.0.0.1:30000 \
  --token "$SGLANG_BEARER_TOKEN" \
  --outdir /tmp/incident_bundle

The bundle script collects:

  • /ready
  • /health
  • /health_generate
  • /model_info
  • /server_info
  • /v1/loads?include=all
  • /v1/loads?include=core,queues,disagg,spec
  • /metrics
  • /hicache/storage-backend on a best-effort basis

If stale or corrupt HiCache contents are the working diagnosis, capture the bundle and relevant request dumps before calling POST /hicache/storage-backend/clear. That endpoint clears the attached backend's contents without detaching it; treat it as destructive and use it only when losing the cached contents is acceptable. Attach, detach, and clear details are in references/endpoints-and-signals.md.

Use the summary for a quick read on:

  • health vs. active health state
  • topology and runtime flags
  • point-in-time queue and token usage
  • TTFT / E2E / queue-time heuristics from Prometheus metrics

If the summary says the bundle was captured while the server was idle, recollect it during traffic or move quickly to dump plus replay.

If no live server is reachable, start from the best dump or log already available:

  • crash dump
  • request dump
  • logs
  • CUDA coredump
  • OTel trace
  • torch profile

2. Save the failing request

Read references/decision-tree.md only if the problem class is still unclear:

  • server down or unhealthy
  • latency or throughput regression
  • wrong output or behavior regression
  • intermittent timeout or hang

Then preserve the request payload that actually triggers the problem:

  • crash path: use --crash-dump-folder
  • non-crash path: enable request dump or save the exact trigger request

Do not jump straight from a live symptom to low-level debugging without first saving something you can replay.

3. Replay on a clean target

Read references/endpoints-and-signals.md when you need help reading the baseline bundle or the replay target.

Read references/replay-trace-profile.md when you need the replay, trace, profile, or bisect paths.

Standard order:

  1. collect baseline bundle
  2. capture request dump or crash dump
  3. restart a clean debug target if needed
  4. replay the same issue
  5. collect replay-time logs and dumps

4. Only go deeper after replay

Replay

Use replay when:

  • a crash dump exists
  • a request dump exists
  • the problem depends on request shape or workload mix

If a crash dump exists, summarize it first:

bash
python3 scripts/incident_artifact_tool.py summarize-dump \
  --input-file /path/to/crash_dump.pkl

Then replay:

bash
python3 /path/to/sglang/scripts/playground/replay_request_dump.py \
  --input-file /path/to/crash_dump.pkl \
  --host 127.0.0.1 \
  --port 30000 \
  --parallel 128

If safe_pickle_load blocks a locally captured trusted dump, use:

bash
python3 scripts/replay_trusted_request_dump.py \
  --input-file /path/to/request_dump.pkl \
  --host 127.0.0.1 \
  --port 30000 \
  --parallel 1

If replay indicates a CUDA crash path, restart the same build with coredumps enabled before reproducing again:

bash
SGLANG_CUDA_COREDUMP=1 \
SGLANG_CUDA_COREDUMP_DIR=/tmp/sglang_cuda_coredumps \
python -m sglang.launch_server \
  --model-path ... \
  --crash-dump-folder /tmp/sglang_crash_dump \
  ...

Then inspect the generated coredump:

bash
cuda-gdb "$(which python3)" \
  -ex "target cudacore /tmp/sglang_cuda_coredumps/cuda_coredump_<host>.<pid>.<ts>"

For a replay-first crash example, read references/case-studies.md.

OTel trace

Use tracing when:

  • request-stage timing is unclear
  • router vs. worker attribution is unclear
  • PD prefill/decode transfer may be implicated

If tracing was enabled at startup, you can change the level without restart:

bash
curl "http://127.0.0.1:30000/set_trace_level?level=1"
curl "http://127.0.0.1:30000/set_trace_level?level=2"
Torch profile

Use profiling when:

  • the issue is already narrowed to compute-side ownership
  • replay already reproduces the problem
  • metrics and loads do not explain the regression

At that point, switch to llm-torch-profiler-analysis. Do not duplicate its profiling workflow here.

For a low-noise latency example, read references/case-studies.md.

Distributed hang

If this looks like a collective stall, save the failing request, replay it on a clean target, collect the replay-time bundle and stacks, then switch to debug-distributed-hang.

For an example of that flow, read references/case-studies.md.

Regression between two commits

If one commit is known-good and another is known-bad, build a deterministic harness before doing deeper manual debugging:

  1. choose a stable reproducer: request replay, benchmark command, or correctness check
  2. make the harness return 0 on good behavior and non-zero on bad behavior
  3. run git bisect start <bad> <good>
  4. run git bisect run <harness>
  5. return here only after a candidate commit is isolated

Prefer replay-backed bisect when the regression depends on request shape or long-running serving state.

5. Switch tools when the boundary is clear

Switch tools once the fault class is clear:

  • llm-torch-profiler-analysis for kernel and overlap attribution
  • debug-distributed-hang for collective or rank-divergence hangs
  • debug-cuda-crash for CUDA crash reproduction and kernel API logging

Do not switch tools before collecting the first bundle unless the user already has decisive logs or dumps.

References

Load only what the current step needs:

Scripts

If a live bundle was collected, include its path.

If replay, trace, or profiling was chosen, say why bundle plus dump were not enough.

Current upstream debug controls — 2026-10-05

SGLang-repo companion skills now live under .agents/skills/ (#40515): debug-cuda-crash, debug-distributed-hang, generate-profile, and sglang-bisect-ci-regression. Verify the repository copy before invoking it.

--crash-dump-folder X configures CUDA coredumps when their environment keys are unset, with CUDA_COREDUMP_FILE=X/%h/core.cuda.%t.%p and CUDA_COREDUMP_PIPE=/tmp/corepipe.cuda.%h.%p. Before a crash, py-spy and user-triggered CUDA dumps are enabled by default, with a 60 s coredump wait. SGLANG_CUDA_COREDUMP=1 uses its separate cuda_coredump_%h.%p.%t naming; by import-order code reading its already-set path wins. This precedence was not GPU-tested. A configured pipe can also capture a wedged kernel.

Source: crash dump hook, Rust ingress.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sglang Prod Incident Triage AI skill do?

Replay-first debug flow for SGLang serving problems. Use when a live or recent server shows health-check failures, latency or throughput regressions, queue growth, timeouts, distributed stalls, crash dumps, wrong outputs after deploys, or PD/EP/HiCache issues, and the job is to turn the problem into a replay plus the right next debug tool.

Why use Sglang Prod Incident Triage on TypingMind?

Because you install it once and use it with any model. Sglang Prod Incident Triage is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sglang Prod Incident Triage in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/BBuf/AI-Infra-Auto-Driven-SKILLS/tree/main/skills/sglang-prod-incident-triage. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sglang Prod Incident Triage?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sglang Prod Incident Triage?

As many as you like. As long as a model supports skills, you can use Sglang Prod Incident Triage with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sglang Prod Incident Triage AI skill free?

It is published on GitHub by BBuf. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇