@huggingface/kernels is an AI Code tool. JavaScript library for loading optimized WebGPU kernels for browser-based AI inference. Key features include 207+ Optimized Kernels, Hub-Based Loading, and Fleet Benchmarking Suite. Best for software developers and engineers, data scientists and analysts and content creators.
About @huggingface/kernels
@huggingface/kernels is an open-source JavaScript library that loads and runs 207+ optimized WebGPU compute kernels from Hugging Face Hub, enabling fast local AI inference in web browsers without server dependencies.
Key Features
207+ Optimized Kernels.
Hub-Based Loading.
Fleet Benchmarking Suite.
Complete Versioned Packages.
Browser-Native AI Inference.
Open Source and Free.
Frequently Asked Questions
@huggingface/kernels is a JavaScript library that lets developers load and run optimized WebGPU compute kernels for running AI models directly in web browsers. It provides 207+ pre-built kernels for operations like matrix multiplication, attention, and normalization that power local AI inference without needing a server.
Yes, @huggingface/kernels is completely free and open source under the Apache-2.0 license. You can use it in commercial and personal projects without licensing fees. All kernels are available on Hugging Face Hub at no cost.
@huggingface/kernels requires a browser with WebGPU support. Chrome 113+ and Edge have WebGPU enabled by default. Firefox requires enabling WebGPU in settings. Safari support varies by version. You can check compatibility by testing for 'gpu' in navigator in JavaScript.
Benchmarks show @huggingface/kernels performs 2.57x faster than ORT WebGPU on Apple M4 GPU across 809 test cases. The library stands out by providing individually versioned, testable kernels with built-in correctness validation and performance evidence from real devices through the Fleet benchmarking tool.






