kernels
Download compute kernels
What it is and what it does
kernels is a Python package that downloads and loads compute kernels from Hugging Face Hub directly into your application at runtime. Rather than bundling kernels statically, it treats them as portable, versioned artifacts that can be loaded from outside the standard Python path, allowing multiple versions of the same kernel to coexist in a single process. The package is built to handle the complexity of varied build configurations across environments.
The typical workflow is to call `get_kernel()` with a Hub repository identifier and optional version number, then invoke kernel functions. This is most useful for performance-critical operations where hand-optimized kernels can provide significant speedup. The package depends on huggingface-hub for Hub communication, packaging and pyyaml for metadata handling, and sigstore for verification.
Use it for:
- Load optimized kernels from the Hub to accelerate compute-intensive operations in applications.
- Use multiple versions of the same kernel in a single process for testing or gradual migration.
- Deploy applications that rely on optimized kernels without pre-installing them in the container.
- Access community-contributed kernels for specialized operations without vendoring custom code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Loads optimized compute kernels from Hugging Face Hub into Python applications at runtime, enabling dynamic kernel loading without modifying PYTHONPATH.
Yes, if you are building applications that benefit from optimized kernels and want to manage them as versioned Hub artifacts. The package is actively maintained, has no known vulnerabilities, and low install friction. However, it requires Python 3.10+ and a working compute environment; without those, it will not function. The Hub kernel ecosystem is still young, so verify that the kernels you need are available and compatible before committing to this approach.
Install
kernels on PyPI
pip
pip install kernelsuv
uv add kernelspoetry
poetry add kernelsInstalling kernels
Before you install
Low friction installation with a pure-Python wheel. Active maintenance as of 49 days ago. Requires external CUDA and compute dependencies not managed by pip.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution required.
Quickstart
pip install kernels
from kernels import get_kernel
activation = get_kernel("kernels-community/activation", version=1)
Requires Python 3.10+. Kernels are designed for GPU compute and require a compatible CUDA environment to function.
Verify before relying
- Whether all kernel implementations in the Hub are compatible with your installed compute environment.
- Performance characteristics and overhead of dynamic kernel loading compared to static imports.
- Specific PyTorch version requirements beyond what the description excerpt states.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — huggingface-hub, kernels-data, packaging, pyyaml, sigstore, tomli, typing-extensions, tomlkit |
| Maintenance | actively maintained — 49 days since the last release |
| First released | |
| Downloads | 3,147,289/month — #2,728 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kernels-0.16.0-py3-none-any.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
kernels-datakernels-data provides Python bindings for…
unclear · top 5,000 on PyPI
datasetsLoads and preprocesses datasets from the…
permissive · top 1,000 on PyPI
hf-transferAccelerates file transfers to and from the…
unclear · top 5,000 on PyPI
hfA command-line interface for interacting with…
permissive · top 15,000 on PyPI
sgl-kernelsgl-kernel provides optimized CUDA compute…
permissive · top 15,000 on PyPI
cpm-kernelsProvides CUDA kernels optimized for CPM,…
permissive · top 15,000 on PyPI
sglang-kernelsglang-kernel provides optimized CUDA compute…
permissive · top 15,000 on PyPI
nvidia-cutlass-dsl-libs-cu12Provides a Python DSL for writing…
unclear · top 5,000 on PyPI
kconfiglibKconfiglib is a Python implementation of the…
permissive · top 5,000 on PyPI