SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.
Borrowing it
Nothing to install: this file belongs to sgl-project/sglang. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/sgl-project/sglang/main/.agents/skills/add-sgl-kernel/SKILL.mdgit clone --depth 1 https://github.com/sgl-project/sglangWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sgl-project/sglang/add-sgl-kernel)<a href="https://agentmods.dev/skills/sgl-project/sglang/add-sgl-kernel"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/add-sgl-kernel/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sgl-project/sglang/add-sgl-kernel"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/add-sgl-kernel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Snyk pass
- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.03592 |
| Opus 5.5 | $0.00012 | $0.01437 |
| Sonnet 5.5 | $0.00006 | $0.00718 |
| Haiku 4.5 | $0.00003 | $0.00359 |
Grade A, and why
add-sgl-kernel scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 371 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Tutorial: Adding a New Kernel to sgl-kernel (AOT / Heavyweight)
Apply kernel-organization for the public operator namespace, logical grouping, lazy registry metadata, and test placement. The implementation tutorial below does not replace that API contract.
This tutorial walks through adding a simple element-wise scale operation as an AOT kernel. We'll implement scale(x, factor) = x * factor to demonstrate the complete workflow.
Goal
Add a new operation that scales each element of a tensor by a scalar factor:
- Input: tensor
x(CUDA) and scalarfactor(float) - Output:
x * factor(element-wise, in-place or into pre-allocatedout) - Supported dtypes: FP16 (
torch.float16), BF16 (torch.bfloat16), FP32 (torch.float32)- Dispatched via
DISPATCH_PYTORCH_DTYPE_TO_CTYPE_FLOAT_FP16macro (defined inpython/sglang/kernels/aot/include/utils.h)
- Dispatched via
Two rules of thumb (must follow)
- Prefer
python/sglang/kernels/jitfirst when the kernel does not depend on CUTLASS or another large C++ project. This is the default path for lightweight kernels that benefit from rapid iteration. - Prefer
sgl-kernelwhen the kernel does depend on CUTLASS or another large C++ project, or when it should be part of the AOT wheel / torch op registration flow. - Exception: if the dependency is
flashinfer, or CUTLASS that is already provided throughflashinfer, the kernel can still be implemented asjit_kernel.
In addition, every new kernel must ship with:
- Tests (pytest)
- A benchmark script (
marker.do_benchfromsglang.kernels.jit.benchmark— it works for any callable, not only JIT kernels)
Repository integration map
You will typically touch these files/areas:
- Implementation:
python/sglang/kernels/aot/csrc/elementwise/scale.cu(pick the right subdirectory) - Public declarations:
python/sglang/kernels/aot/include/sgl_kernel_ops.h - Torch extension registration:
python/sglang/kernels/aot/csrc/common_extension.cc - Build:
python/sglang/kernels/aot/CMakeLists.txt(set(SOURCES ...)) - Python API:
python/sglang/kernels/aot/python/sgl_kernel/andpython/sglang/kernels/aot/python/sgl_kernel/__init__.py - Tests:
python/sglang/kernels/aot/tests/test_scale.py - Benchmarks:
python/sglang/kernels/aot/benchmark/bench_scale.py
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · -16 lines 841317903dcd
- 1mo ago Changed · +19 lines b5b1e2ed4d92
- 2mo ago First seen · 368 lines · 31 tokens per session scan A 1560d3d9f4c9
add-sgl-kernel is a skill published in the GitHub repository sgl-project/sglang (38,324 stars, last pushed today), licensed Apache-2.0. It adds 31 tokens to every session and 3,592 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
cpp-coding-standards
C++ coding standards based on the C++ Core Guidelines (isocpp.github.io). Use when writing, reviewing, or refactoring C++ code to enforce modern, safe, and idiomatic practices.
ax-cpp-ai
Use when writing C++ code with axllm for named deployment profiles, generic provider clients, model selection, OpenAI-compatible calls, Responses, Gemini, Anthropic, routers, and balancers.
ax-cpp-gen
Use when writing C++ code with axllm for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.
ax-cpp-agent
Use when writing C++ code with axllm for agents, child delegation, tools, MCP, citations, persistent playbook learning, stage instructions, runtime state, final typed responses, and direct-respond executor skipping.
ax-cpp-flow
Use when writing C++ code with axllm for flows, nodes, program graphs, nested programs, dynamic options, caching, and optimizer components.
ax-cpp-signature
Use when writing C++ code with axllm for string signatures, field descriptors, JSON schema output, validation, and typed tool argument shapes.