sgl-kernel
Kernel Library for SGLang
What it is and what it does
sgl-kernel is a compiled CUDA kernel library designed to accelerate large language model inference by providing optimized compute primitives. It exposes custom kernel operations that LLM inference engines like SGLang and LightLLM use to speed up matrix operations and other compute-intensive tasks during model execution. The package ships as pre-built wheels for x86_64 and aarch64 architectures, requiring Python ≥3.10 and torch == 2.9.1.
The library is intended for developers building or extending LLM inference systems who need lower-level kernel control and optimization. It has no Python runtime dependencies beyond torch, making it a thin wrapper around CUDA code. Installation is straightforward via pip, though the strict torch version requirement means you must align your environment carefully. The project is actively maintained with recent commits and has accumulated significant adoption in the LLM inference ecosystem.
Use it for:
- Accelerate matrix operations in custom LLM inference engines by replacing generic CUDA kernels with optimized primitives.
- Build vision-language model inference pipelines that require specialized compute kernels for efficient token processing.
- Integrate into SGLang or LightLLM deployments to improve throughput and latency of model serving.
- Develop custom LLM serving frameworks that need fine-grained control over GPU compute without writing raw CUDA code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sgl-kernel provides optimized CUDA compute primitives for LLM inference, enabling efficient execution of custom kernel operations for large language models and vision-language models.
Yes, if you are building or extending an LLM inference engine and your environment uses torch == 2.9.1. The library is actively maintained, has no Python runtime dependencies, and is already proven in production LLM systems. The strict torch version requirement is a real constraint—verify compatibility before committing. No known security vulnerabilities.
Install
sgl-kernel on PyPI
pip
pip install sgl-kerneluv
uv add sgl-kernelpoetry
poetry add sgl-kernelInstalling sgl-kernel
Before you install
Medium install friction due to compiled wheel distribution (x86_64 and aarch64 manylinux2014 wheels available). Requires torch == 2.9.1 as a hard dependency. Active maintenance with recent commits and no runtime Python dependencies simplifies integration once the torch version constraint is satisfied.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects, provided you include the license and attribution notices.
Quickstart
pip install sgl-kernel
import sgl_kernel
# Use optimized kernels via sgl_kernel module in your inference engine
Requires torch == 2.9.1 and Python ≥3.10; NVIDIA GPU with CUDA support required for runtime execution.
Verify before relying
- Whether torch == 2.9.1 is pinned strictly or if compatible newer/older versions work in practice
- GPU compute capability requirements beyond what the description implies
- Performance characteristics relative to other LLM inference kernel libraries
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 212 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 162,742/month — #10,590 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sgl_kernel-0.3.21-cp310-abi3-manylinux2014_aarch64.whl; sgl_kernel-0.3.21-cp310-abi3-manylinux2014_x86_64.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
liger-kernelLiger Kernel provides optimized Triton kernels…
permissive · top 15,000 on PyPI
sgl-deep-gemmsgl-deep-gemm provides optimized GEMM (matrix…
permissive · top 15,000 on PyPI
sglang-kernelsglang-kernel provides optimized CUDA compute…
permissive · top 15,000 on PyPI
sglangSGLang is a serving framework that runs large…
permissive · top 1,000 on PyPI
mineru-vl-utilsProvides a lightweight Python wrapper to…
permissive · top 15,000 on PyPI
flashinfer-pythonFlashInfer provides optimized GPU kernels for…
permissive · top 5,000 on PyPI
apache-tvm-ffiProvides a stable, minimal C ABI and FFI for…
permissive · top 5,000 on PyPI
fa3-fwdProvides a lightweight Flash-Attention-3…
permissive · top 15,000 on PyPI
kernels-datakernels-data provides Python bindings for…
unclear · top 5,000 on PyPI
smg-grpc-servicerProvides gRPC servicer implementations that…
permissive · top 5,000 on PyPI