Kernels
Build compute kernels and load them dynamically from the Hugging Face Hub into Python libraries and applications.
At a Glance
The kernels Python package and kernel-builder are open source under the Apache License 2.0 and free to use, modify and distribute.
Engagement
Available On
Alternatives
Listed Nov 2026
About Kernels
Kernels is a Hugging Face open-source project that lets Python libraries and applications load compute kernels directly from the Hugging Face Hub. It consists of the kernels Python package for loading kernels and the kernel-builder tooling for building, packaging, and distributing them. The documentation lists v0.18.1 as the latest stable version.
What It Is
The Kernel Hub treats kernels as a first-class repository type on the Hub, with dedicated pages that surface supported hardware and versions. Hub kernels differ from traditional Python kernel packages: a kernel can be loaded from paths outside PYTHONPATH, multiple versions of the same kernel can be loaded in one Python process, and kernels must support recent Python versions and various PyTorch build configurations (different CUDA versions and C++ ABIs), along with older C library versions.
How the Workflow Works
Users install the package with pip (requires torch>=2.5 and CUDA in the quickstart), then call get_kernel with a Hub repository such as kernels-community/activation and a version. The returned module exposes the kernel functions, which run on tensors such as CUDA tensors. Kernel authors use kernel-builder to write, build with Nix, develop locally, and publish kernels. The docs also cover locking kernel versions, using layers, a kernels CLI (cache, info, lock, download, benchmark, verify-signature), and guides for developing kernels with agents.
Hardware Support
The README groups hardware into tiers. CUDA and CPU are tier 1 and validated in CI. ROCm, XPU, Metal, and TPU are tier 2. Huawei NPU and Neuron are tier 3. Neuron and TPU support are described as experimental.
Community Discussions
Be the first to start a conversation about Kernels
Share your experience with Kernels, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache-2.0)
The kernels Python package and kernel-builder are open source under the Apache License 2.0 and free to use, modify and distribute.
- Load compute kernels from the Hugging Face Hub with the kernels Python package
- kernel-builder to build, package and distribute kernels
- Licensed under Apache License 2.0
- Hub hosting, storage, and compute on Hugging Face are priced separately
Capabilities
Key Features
- Load compute kernels from the Hugging Face Hub via a Python package
- Portable loading from paths outside PYTHONPATH
- Multiple versions of the same kernel in one Python process
- Compatibility with various PyTorch, CUDA and C++ ABI configurations
- kernel-builder for building, packaging and distributing kernels
- Nix-based kernel builds
- Version locking for kernels
- kernels CLI including cache, info, lock, download, benchmark and verify-signature
- Layers API
- Agent skills installation and guide for developing kernels with agents
- Hardware support across CUDA, CPU, ROCm, XPU, Metal, TPU, Huawei NPU and Neuron
