--- id: sgl-kernel version: "0.3.21" 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) license_treatment: permissive maintenance: active --- # sgl-kernel — Kernel Library for SGLang License: permissive · Maintenance: active · Downloads: 162.7K/mo ## 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 above — 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 pip install sgl-kernel uv add sgl-kernel poetry add sgl-kernel ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 162.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm inference kernels, cuda optimization for language models, custom gpu kernels llm, efficient inference primitives, vision-language model acceleration, sglang kernel library, llm compute optimization, cuda-kernels, llm-inference, gpu-acceleration [View on SkillFed](https://skillfed.io/packages/sgl-kernel) · [View on PyPI](https://pypi.org/project/sgl-kernel/)