code-cleanup
Skill39k starsChanged 3 days agoApache-2.0View on GitHub
Audit and clean up SGLang production code -- dead or unreachable code, duplicate implementations, redundant flags and env vars, compatibility shims, misplaced modules, wrong hardware gates -- using a catalog of patterns from this repo's refactor and cleanup PRs, RFCs and reverts, and the evidence bar those PRs were held to. Use when asked to clean up or simplify an area, remove dead code, dedupe kernels or helpers, retire a flag, env var, backend or feature, or review a cleanup or refactor PR.
11 other projects use a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- EliasWickander/agent-skillstheir own version, first seen Nov 29, 2026
- alex20-create/code-care-skillstheir own version, first seen Nov 29, 2026
- jenreh/appkittheir own version, first seen Nov 14, 2026
- TidalPaladin/skillstheir own version, first seen Nov 8, 2026
- edloidas/skillstheir own version, first seen Nov 1, 2026
- snappedly/skillstheir own version, first seen Oct 13, 2026
Who's talking about sgl-project/sglang
- Vuk Rosić“SGLang Step by Step Beginner Tutorial”YouTube · Sep 4, 2025 · 4.9k views
- NVIDIA Developer“Inference Office Hours with SGLang: Performance Optimizations for LLM Serving”YouTube · Feb 6, 2026 · 3k views
- Fahd Mirza“How-To Use Any Transformers Model with SGLang Easily”YouTube · Jun 25, 2025 · 2.2k views
- Fahd Mirza“Control LLM Output with SGL - SGLang with GPT”YouTube · May 26, 2024 · 1.9k views
- Solopreneurs hub“SGLang: High-Performance LLM Serving for Low Latency AI Infra (GPU/Memory Optimized)”YouTube · Aug 14, 2026 · 1.1k views
The biggest 5 of 71 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 71
Talked about on GitHub, YouTube, Bluesky, Hacker News and Stack Overflow (71 times).
On GitHub · 44
- Sep 23, 2025Feature Request: support qwen3-vl series — ggml-org/llama.cpp153 reactions · 151 comments
- Jun 21, 2025[sglang] Tracking sglang compatibility in slime — THUDM/slime25 reactions · 1 comment
- Feb 18, 2026[Roadmap] Blackwell MXFP8 and NVFP4 RL training — radixark/miles19 reactions · 1 comment
- Nov 22, 2024[Roadmap] veRL Development Roadmap — verl-project/verl17 reactions · 7 comments
- Aug 16, 2025[Feature]: Add provider Sglang — BerriAI/litellm16 reactions · 8 comments
39 more on GitHub
- Apr 23, 2025Support for the Qwen3 models in engine-flow — NVIDIA/TensorRT-LLM16 reactions · 2 comments
- Apr 9, 2025[Feature]: Support structured output and tool call together — vllm-project/vllm14 reactions · 9 comments
- Jan 12, 2026[WIP][Spec Decode] DFlash — vllm-project/vllm13 reactions · 3 comments
- Jul 15, 2026[tml] Inkling model support — radixark/miles11 reactions · 6 comments
- Mar 24, 2026[Feature]: Implement `TRITON_MLA_SPARSE` backend for sm80/120/121 support of Sparse MLA — vllm-project/vllm10 reactions · 15 comments
- Nov 13, 2025Support rollout routing replay — THUDM/slime10 reactions
- Jun 23, 2025Support for Flash Attention 3 — huggingface/transformers10 reactions · 17 comments
- Mar 27, 2025veRL-SGLang Roadmap — zhaochenyang20/Awesome-ML-SYS-Tutorial10 reactions · 32 comments
- Jan 23, 2024Radix Attention support — vllm-project/vllm10 reactions · 2 comments
- Dec 23, 2025Development Roadmap - miles LoRA training support Q1 — radixark/miles8 reactions · 9 comments
- Jan 3, 2026[SGLANG]: 2026 H1 backend roadmap/improvements — ai-dynamo/dynamo7 reactions · 13 comments
- May 30, 2025Add DeepSeek 671B GRPO example — verl-project/verl7 reactions · 2 comments
- Jun 4, 2026DEP: Runtime-Free Router and Gateway On-Ramp — ai-dynamo/dynamo6 reactions · 16 comments
- May 18, 2026DeepSeek V4 kernel support status tracker — flashinfer-ai/flashinfer6 reactions · 9 comments
- Jan 28, 2026[Feature] Update Transformers to v5 — verl-project/verl6 reactions · 2 comments
- Jan 20, 2026Any plan to release flash-attn-cute package? — Dao-AILab/flash-attention6 reactions
- Nov 22, 2025[Kernel] Add NVFP4 MoE CUTLASS support for SM120 — vllm-project/vllm6 reactions · 9 comments
- Sep 22, 2025[Bugfix] Qwen3-next generate ! always — vllm-project/vllm6 reactions · 7 comments
- Aug 22, 2025Project Limit Request: sgl-kernel - 40 GB — pypi/support6 reactions · 6 comments
- Jun 6, 2025hotfix: fix the blackwell fmha stream — flashinfer-ai/flashinfer6 reactions · 1 comment
- May 19, 2025[RoadMap] Mooncake Store V2 — kvcache-ai/Mooncake6 reactions · 17 comments
- Mar 29, 2025[Model] Deepseek-v3 support — mlc-ai/mlc-llm6 reactions
- Feb 10, 2024Add instructions on running llava-v1.6-mistral-7b — haotian-liu/LLaVA6 reactions · 9 comments
- Aug 18, 2026[RFC] Moore Threads MUSA Support Roadmap — sgl-project/sglang-omni5 reactions
- Jun 17, 2026[refactor] weight update refactor — radixark/miles5 reactions · 2 comments
- Feb 28, 2026[Feature]: Eliminate redundant multimodal preprocessing for gRPC backends — smg-project/smg5 reactions · 2 comments
- Jan 4, 2026KTransformers Roadmap (2026 Q1) — kvcache-ai/ktransformers5 reactions · 11 comments
- Sep 20, 2025[FEAT] Deterministic rollout — THUDM/slime5 reactions · 1 comment
- Apr 18, 2025The tests presented in this repository are incorrect due to errors in launching sglang. — simon-mo/vLLM-Benchmark5 reactions · 3 comments
- Feb 27, 2025[Model] [Quantization] Support deepseek v3/r1 w8a8 int8 block-wise quantization — vllm-project/vllm5 reactions · 12 comments
- Nov 23, 2024[Usage] Batch evaluation using sqlang doesn't support llava-v1.5 model — haotian-liu/LLaVA5 reactions
- Nov 5, 2023Batch evaluation — haotian-liu/LLaVA5 reactions · 28 comments
- Aug 21, 2026Helion KDA backend port from sglang https://github.com/sgl-project/sg… — vllm-project/vllm4 reactions · 2 comments
- Mar 5, 2026feat(sglang): introduces SGLang provider support to OpenClaw — openclaw/openclaw4 reactions · 2 comments
- Jan 31, 2026Fix argument type error in _cudnn_gemm_fp4_requirement — flashinfer-ai/flashinfer4 reactions · 6 comments
- Sep 2, 2025[Feat] Single Batch Overlap (SBO): Overlaping of Down GEMM with Combine Send — deepseek-ai/DeepEP4 reactions · 2 comments
- Aug 1, 2025Qwen2.5-VL-7B egale3 train — sgl-project/SpecForge4 reactions · 36 comments
- Jul 25, 2025feat: masked layout fp4 gemm using cute-dsl — flashinfer-ai/flashinfer4 reactions · 2 comments
- Jul 8, 2025[sglang, megatron, perf] feat: speed up megatron sglang weight update by 10x — verl-project/verl4 reactions · 7 comments
On YouTube · 21
- Sep 4, 2025SGLang Step by Step Beginner Tutorial — Vuk Rosić4.9k views · 4 comments
- Feb 6, 2026Inference Office Hours with SGLang: Performance Optimizations for LLM Serving — NVIDIA Developer3k views · 1 comment
- Jun 25, 2025How-To Use Any Transformers Model with SGLang Easily — Fahd Mirza2.2k views · 7 comments
- May 26, 2024Control LLM Output with SGL - SGLang with GPT — Fahd Mirza1.9k views · 6 comments
- Aug 14, 2026SGLang: High-Performance LLM Serving for Low Latency AI Infra (GPU/Memory Optimized) — Solopreneurs hub1.1k views
16 more on YouTube
- Oct 13, 2026Supercharge LLM Inference Speed with SGLang & RadixAttention! 💻⚡ (Open Source) — AI Skill Vault144 views
- May 2, 2026⭐ sglang — 26,936 GitHub Stars — Observe AI93 views
- Nov 7, 2026llama.cpp vs vLLM vs SGLang: Which Is Fastest on One GPU? — Tensor Garage67 views
- Sep 13, 2026Sglang — Everything For AI42 views
- Nov 4, 2026Temperature 0 gave 7 different answers #determinism — Agentic Ajrak37 views
- Oct 25, 2026SGLang's 16 MiB All-Reduce Bug Returned the Wrong Sum — Ankit Kaushal37 views
- Feb 8, 2025GitHub - sgl-project/sglang: SGLang is a fast serving framework for large language models and vis... — GitHub Daily Trend AI Podcast34 views
- Oct 27, 2026SGLang & AKV: 10X Faster AI Agents Explained — The Employee Factorysays it tested it33 views
- Nov 6, 2026⚡ Serve LLMs and Vision Models with SGLang 🚀 — GitGemVault32 views
- Oct 27, 2026SGLang Atomic Uploads: Keep the Good Image When Writing Fails | Request Survival 02 — Ankit Kaushal27 views
- Oct 27, 2026SGLang: Why 6 Tokens Crashed a 3-Slot Request | Request Survival 01 — Ankit Kaushal25 views
- Nov 14, 2026SGLang: 30x faster on a 16 GB GPU — Agentic Ajraksays it tested it19 views
- Oct 8, 2026Sglang — Everything For AI16 views
- Sep 12, 2026739 PRs in one week isn't a project — it's a sprint to own LLM inference. — thezakulo14 views
- Jun 29, 2026Sglang — Everything For AI8 views
- Nov 15, 2026SGLang: Fast Inference Serving for LLMs and Multimodal Models | OpenViST Listing — OpenViST1 view
On Bluesky · 4
- Feb 7, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 sgl-project / sglang ⭐ 8,749 (+130) 🗒 Python SGLang is a fast serving framework for large language… — @github-trending.bsky.social4 likes and reposts
- Sep 15, 2026did you have a look to SGlang (github.com/sgl-project/...)? It's more focused on large models, but they integrate all major optimizations… — @aminesaboni.bsky.social1 likes and repost · 1 reply
- Jan 19, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 sgl-project / sglang ⭐ 442 (+134) 🗒 Python SGLang is a structured generation language designed for… — @github-trending.bsky.social1 likes and repost · 1 reply
- Sep 13, 2025you don't want to run models in prod directly with pytorch, it's a fuck ton of work to do properly. Use vLLM or sglang… — @timkellogg.me0 likes and reposts · 1 reply
On Hacker News · 1
- Oct 15, 2026SGLang – High-performance serving framework for LLM's and multimodal models1 point
On Stack Overflow · 1
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- jenreh/appkit★ 5same name
- CorySchulz/skills★ 2same name
- edloidas/skills★ 2same name
- snappedly/skills★ 2same name
- hempq/symfony-claude-code★ 1same name
- looties-io/looties-skills★ 1same name
- TidalPaladin/skills★ 1same name
- alex20-create/code-care-skills★ 0same name
- EliasWickander/agent-skills★ 0same name
- evanpersinger/claude-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- sglang-docs-mintlifyAGENTS.md
- add-jit-kernelSkill
- add-sgl-kernelSkill
- babysit-pr-to-pass-ciSkill
- ci-test-auditSkill
- ci-workflow-guideSkill
- clean-startup-logSkill
- compute-mamba-ratioSkill
- cookbook-add-modelSkill
- cookbook-migrate-modelSkill
- cookbook-review-prSkill
- debug-cuda-crashSkill
- debug-distributed-hangSkill
- env-var-conventionsSkill
- generate-profileSkill
- hybrid-cache-checkpointsSkill
- kernel-organizationSkill
- kl-consistency-testSkill
- large-class-styleSkill
- llm-torch-profiler-analysisSkill
- mechanical-refactor-verifySkill
- processor-mm-paritySkill
- processor-model-paritySkill
- rerun-testSkill
- scripted-runtime-notesSkill
- sglang-bisect-ci-regressionSkill
- sglang-cherrypickSkill
- sglang-multi-graph-checkSkill
- sglang-prod-incident-triageSkill
- sglang-runtime-contextSkill
- speculative-namingSkill
- write-sglang-testSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Read patterns.md first. It is the substance of this skill: each pattern is a rule, how to spot it, the cases where it is wrong, and the PRs …
- Very specific: line 49
Verify every candidate at every site: Read the code, not the grep line.
- Distinctive: line 55
Decide per finding: delete, dedupe, fix, keep, or report to the owner.
- Distinctive: line 60
Delete the whole footprint: definition, every reader, docs and cookbook rows, tests, benchmarks, CI and scripts that set it.
- Distinctive: line 64
No forwarding shims for internal moves, no comments narrating the change, no compatibility code for names that were never public.
- Distinctive: line 66
Keep relocation commits apart from semantic ones, and bug fixes apart from both.
- Distinctive: line 115
Behavior changes: before / after table. A cleanup with no behavior change says so.
- Distinctive: line 122
Do not add a line-count target or a deletion quota.
- Distinctive: line 150
If main changes a file you deleted while the PR is open: a change that extends a guard or a test means the file is alive, restore it.
- Distinctive: line 157
Check removals against the real parser, not grep.
- Very specific: line 168
When a newer PR applies a pattern, or a new pattern recurs across PRs, update patterns.md: keep the rule general and treat the PR numbers …
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Cleanup
Keeps production code under python/sglang/, sgl-kernel/ and rust/, and the docs that
describe it, free of code nothing runs, code that exists twice, and knobs that restate what
the code can decide. Neighbors:
- Tests and CI: ci-test-audit. A cleanup keeps finding tests that never run; hand them over with the evidence.
- Proving a move or split is a pure relocation: mechanical-refactor-verify.
- Where a kernel belongs, and which of several implementations of one kernel contract
survives: kernel-organization. Env vars:
env-var-conventions. The frozen large classes:
large-class-style. Comments:
.claude/rules/comment-style.md(a comment-only diff never touches one-line comments).
How to use it
Read patterns.md first. It is the substance of this skill: each pattern is a rule, how to spot it, the cases where it is wrong, and the PRs that applied or reverted it. Section G is the set of guardrails that reverted cleanups taught; the in-flight list at the end names migrations a cleanup must not fight.
The user names the scope: a directory, a subsystem, a kind of debt ("env vars that restate the GPU"), or a PR to review. Every finding is specific: the file and symbol, the pattern it matches, the evidence, and the action. "This module could be simpler" is not a finding.
Workflow
- Fix the base. Work from the latest main and record the SHA every comparison uses. Merge main again before opening the PR and re-run the leftover greps; main may have added a reader of something you deleted while the PR was open.
- Inventory with scripts before reading files.
- Identifier frequency over the whole repo, strings included: top-level defs whose name occurs only at their definition. Then drop the dynamic ones (A1, "Not this pattern").
- Env vars: reads (
envs.X.get(), rawos.environ,get_bool_env_var) vs declarations insrt/environ.pyandmultimodal_gen/envs.pyvs doc rows; flag names read under a different name than documented. - Architecture gates:
get_device_capability,is_sm_at_least,is_blackwell, `major=`, gfx substring tests, next to the kernels they guard.
- Dead locals:
ruff check --select F841(the repo hook does not select it). - Baseline: import every module under the packages in scope and run
pytest --collect-onlyon the test trees, on the base SHA.
- Verify every candidate at every site. Read the code, not the grep line. Check the
other platforms (ROCm, NPU, XPU, MUSA, CPU), out-of-tree users (the
sgl-kernelwheel API, plugin pins,from sglang import ...), open PRs that are about to use it (gh pr list --state all --search <symbol>), trackers closed by the inactivity bot (stalled, not finished), and its age: code merged in the last few weeks is usually waiting to be wired, not dead. - Decide per finding: delete, dedupe, fix, keep, or report to the owner. Default to keep and report when the decision is a product call (removing a user-facing feature, a backend that is someone's only path), when an owner reserved the directory, or when an in-flight migration covers it.
- Implement.
- Delete the whole footprint: definition, every reader, docs and cookbook rows, tests,
benchmarks, CI and scripts that set it. Grep the bare name, the dotted access and the
string across
python/ test/ docs/ scripts/ docker/ .github/ benchmark/ rust/ sgl-kernel/ .agents/until nothing is left. - No forwarding shims for internal moves, no comments narrating the change, no compatibility code for names that were never public.
- Keep relocation commits apart from semantic ones, and bug fixes apart from both.
- A test that toggled a deleted switch patches the gate instead, so the comparison survives.
- Format with the pinned hooks:
pre-commit run --files <changed files>.
- Delete the whole footprint: definition, every reader, docs and cookbook rows, tests,
benchmarks, CI and scripts that set it. Grep the bare name, the dotted access and the
string across
- Validate (see "Evidence by change type"): base vs branch on the same machine, on every architecture the changed code runs on.
- Land with the PR structure below; split only into steps that are each green.
Evidence by change type
Base vs branch on the same machine, the same command, failing test ids compared. Re-run
every branch-only failure serially on both trees before calling it a regression; parallel
runs produce port collisions (EADDRINUSE) that look like failures.
- Dead code deletion: whole-repo grep including strings and configs; the import walk and
--collect-onlyshow no new failures; the tests that cover the neighborhood pass. A deleted AOT op needs a clean rebuild of sgl-kernel. - Refactor that claims no behavior change: greedy tokens and logprobs compared bitwise, base vs branch. A small accuracy eval cannot resolve it: identical code has moved GSM8K by 0.03 on 200 questions.
- Dedup of two implementations: outputs bit-identical (
torch.equal, or identical generated code) over the shapes and dtypes every caller uses, on each architecture claimed, including edge inputs (zero tokens, fully masked rows, ties, all-underflow). Force the merged path when the default config skips it, and log or count that it ran. If not bit-exact, keep both and say why in one line. - Kernel rewrite or move between packages: the above, plus CUDA graph / piecewise graph
/
torch.compilepaths, the custom-op registration, and the nightly accuracy test of an affected model; JIT lands with a bitwise JIT-vs-AOT test before the AOT copy goes. - Backend or feature removal: a fallback story, parity numbers for the replacement, every caller ported, platform owners' runs, and a deprecation issue when users may depend on it.
- Flag, env var or endpoint removal: the deprecation shape used (alias,
Deprecated*Action,_DEPRECATED_ENVS), YAML configs still parse, the old defaults preserved, docs and cookbook updated, the result checked against the real parser. - Default change: end-to-end accuracy with sgl-eval on the target hardware, a log line or trace proving the new default path ran, and perf where the path is a fast path.
- Architecture gate change: the gate written as a pure function of the capability tuple
and unit-tested on CPU across families (or
current_archpatched), a probe on each architecture it touches, and the kernel's tests on the hardware of the lane they are registered on. - Diffusion fast path: the tier it runs at, scored with
multimodal_gen/test/quality_tier_admission.py, andtorch.equalatexact.
PR structure
Title [Refactor] <area>: <what>. In the body, in this order:
- Motivation: what drifted and how much, in one paragraph.
- Bugs fixed (review these first): area, problem, fix, and the regression test that fails on main.
- Behavior changes: before / after table. A cleanup with no behavior change says so.
- What was deleted or merged, grouped by pattern, with the proof for each group.
- Kept on purpose: things that look removable and are not, with the reason.
- For the owners (not changed here): findings that need a product or owner decision.
- Validation per hardware with the base and head SHA each run used, and not validated: platforms and paths you could not run.
Do not add a line-count target or a deletion quota; the value of a cleanup is in the silent failures it finds, not its size.
Reviewing a cleanup or refactor PR
- Does each deletion have a proof that covers string lookups and other platforms?
- Is every merged pair shown bit-identical, or kept with a reason?
- Does the "mechanical" part reproduce exactly (mechanical-refactor-verify), with the behavior changes listed separately?
- Are user-facing names retired with an alias and warning (C4, C5), and internal ones moved without shims (E1)?
- Were the hardware lanes the change touches actually run, including nightly-only tests of affected models?
- Does it fight an in-flight migration from the list in patterns.md?
- Is each problem found in review classified as introduced by the PR or pre-existing on the base SHA, and does every result name the SHA it ran on?
Traps
- macOS
git grepdoes not support\|; use-Ewith|. Paths with non-ASCII characters needLC_ALL=en_US.UTF-8. - zsh does not word-split
$VARand treats$VAR:tas a modifier: use${=VAR}and"${VAR}:path", or write the loop in Python. A keep-list that silently fails to split deletes what it was meant to keep. CUDA_VISIBLE_DEVICES=(empty) crashes collection in some test utilities; hide GPUs with a valid index set instead.- A test that passes on sm_103 has not been validated on sm_100; validate on the lane's own architecture.
- If main changes a file you deleted while the PR is open: a change that extends a guard or a test means the file is alive, restore it; a mechanical sync keeps it deleted.
from sgl_kernel import Xunder an XPU branch resolves tosgl-kernel-xpu; it is not a reader of the CUDA AOT op.DeprecationWarningraised from library code is hidden by default; a deprecation users must see needslogger.warning,UserWarningorFutureWarning.- argparse prefix matching: a deleted flag that prefixes one live flag silently binds to it. Check removals against the real parser, not grep.
- Tests that fake
server_argswithMagicMocknever notice a read of a deleted field; build one realServerArgs. /rerun-teston a unittest file takesfile.py::Class.method;Class::methodfails withAttributeErrorbefore any test runs.- Subagents fanning out over files: give them a fixed brief, have them prove each verdict, and re-verify every proposed deletion yourself; "covered by X" claims from a quick pass are leads, not findings.
Keeping the catalog current
When a newer PR applies a pattern, or a new pattern recurs across PRs, update
patterns.md: keep the rule general and treat the PR numbers as replaceable evidence. When
a tracker in the in-flight list finishes, remove its entry.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

