sglang-kernel
Kernel Library for SGLang
What it is and what it does
sglang-kernel is a library of hand-optimized CUDA kernels designed to accelerate inference for large language models and vision-language models. It provides custom compute primitives that integrate with PyTorch, allowing LLM inference engines to execute critical operations more efficiently on NVIDIA GPUs.
The package is distributed as pre-compiled wheels for x86_64 and aarch64 architectures, with no runtime Python dependencies. It requires torch == 2.13.0 and Python ≥3.10, and is intended to be used as a low-level acceleration layer within larger inference frameworks rather than as a standalone application. The source code lives in the sglang project repository.
Use it for:
- Accelerate batch matrix multiplication and attention operations in LLM inference engines
- Optimize vision-language model inference by providing specialized CUDA kernels for image and token processing
- Reduce latency and increase throughput in production LLM serving systems that depend on custom kernel performance
- Integrate with PyTorch-based inference frameworks that need fine-grained control over GPU compute primitives
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sglang-kernel provides optimized CUDA compute primitives for LLM inference engines, enabling efficient inference for large language models and vision-language models through custom kernel operations.
Yes, if you are building or deploying an LLM inference engine that benefits from custom CUDA kernels and you have torch == 2.13.0 and Python ≥3.10 available. The active maintenance, permissive license, and high repository engagement suggest solid backing. Install friction is moderate due to compiled wheels, but no runtime dependencies simplify integration. Not suitable as a standalone package; it is a dependency for inference frameworks.
Install
sglang-kernel on PyPI
pip
pip install sglang-kerneluv
uv add sglang-kernelpoetry
poetry add sglang-kernelInstalling sglang-kernel
Before you install
Medium install friction due to compiled wheel distribution (aarch64 and x86_64 variants). Active maintenance with recent release 8 days ago and 31807 repository stars. Requires torch == 2.13.0 and Python ≥3.10.
License in practice
Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions. You must include license and copyright notices and document changes.
Quickstart
pip install sglang-kernel
# Import and use within inference framework that depends on sglang-kernel
Requires torch == 2.13.0 and Python ≥3.10. NVIDIA CUDA GPU required. Known segmentation fault with CUDA 12.6; update ptxas to 12.8.
Verify before relying
- Whether pre-built wheels cover all target architectures and CUDA versions needed for your deployment
- Performance gains relative to standard PyTorch operations for your specific model and batch sizes
- Exact kernel operations exposed and their integration patterns within inference frameworks
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 — 8 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 643,262/month — #5,608 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sglang_kernel-0.4.6.post1-cp310-abi3-manylinux2014_aarch64.whl; sglang_kernel-0.4.6.post1-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
sgl-kernelsgl-kernel provides optimized CUDA compute…
permissive · top 15,000 on PyPI
slangtorchslangtorch lets you write PyTorch kernels in…
permissive · top 15,000 on PyPI
sgl-deep-gemmsgl-deep-gemm provides optimized GEMM (matrix…
permissive · top 15,000 on PyPI
sglangSGLang is a serving framework that runs large…
permissive · top 1,000 on PyPI
liger-kernelLiger Kernel provides optimized Triton kernels…
permissive · top 15,000 on PyPI
apache-tvm-ffiProvides a stable, minimal C ABI and FFI for…
permissive · top 5,000 on PyPI
flashinfer-pythonFlashInfer provides optimized GPU kernels for…
permissive · top 5,000 on PyPI
helionHelion is a Python-embedded domain-specific…
unclear · top 15,000 on PyPI
kernels-datakernels-data provides Python bindings for…
unclear · top 5,000 on PyPI
cpm-kernelsProvides CUDA kernels optimized for CPM,…
permissive · top 15,000 on PyPI