---
title: "Introducing @huggingface/kernels: 200+ WebGPU Kernels for Local AI"
description: "Hugging Face’s WebAI team is releasing @huggingface/kernels, a JavaScript loader for optimized WebGPU kernels hosted on the Hub, alongside an initial collection of 207 Apache-2.0 kernels. Each kernel repository packages a versioned contract, metadata, correctness cases, benchmark cases, and parameterized WGSL shader templates, while the loader derives outputs and selects variants for a request and device. Fleet adds browser-based correctness and performance testing, with consent-based private evidence used to identify failures, compare variants, and guide optimization. In comparisons against ORT WebGPU on an Apple M4, matching cases showed a 2.57x geometric-mean speedup and a 1.90x median speedup, though the measurements cover individual GPU operations and exclude setup costs. The project is also intended as a shared foundation for browser inference and future integration with higher-level tooling."
---

# Introducing @huggingface/kernels: 200+ WebGPU Kernels for Local AI

[Hugging Face](https://yomu.fyi/company/hugging-face) · Nico Martin, Joshua · Sep 1, 2026

**Type:** Announcement

## Summary

Hugging Face’s WebAI team is releasing @huggingface/kernels, a JavaScript loader for optimized WebGPU kernels hosted on the Hub, alongside an initial collection of 207 Apache-2.0 kernels. Each kernel repository packages a versioned contract, metadata, correctness cases, benchmark cases, and parameterized WGSL shader templates, while the loader derives outputs and selects variants for a request and device. Fleet adds browser-based correctness and performance testing, with consent-based private evidence used to identify failures, compare variants, and guide optimization. In comparisons against ORT WebGPU on an Apple M4, matching cases showed a 2.57x geometric-mean speedup and a 1.90x median speedup, though the measurements cover individual GPU operations and exclude setup costs. The project is also intended as a shared foundation for browser inference and future integration with higher-level tooling.

## Context

Browser inference requires efficient GPU operations across different devices and browser implementations. WebGPU provides portability, but equivalent shaders can perform differently depending on workgroup sizes, memory access, vectorization, data types, fusion strategies, input shapes, and available features.

## Approach / What changed

The release packages 207 WebGPU kernels as versioned Hub repositories, provides the @huggingface/kernels JavaScript loader, and launches Fleet for consent-based browser testing and benchmarking. Kernel repositories include manifests, metadata, correctness and benchmark cases, and parameterized WGSL shader templates.

## Takeaways

- Each kernel’s manifest defines its inputs, outputs, attributes, type constraints, and shape derivation rules; the loader uses that contract to allocate outputs and expose a stable JavaScript-facing interface.
- Against ORT WebGPU on an Apple M4, 809 matching cases produced 629 wins, 176 losses, and 4 ties, with a 2.57x geometric-mean speedup and 1.90x median speedup.
- Fleet can collect private correctness and performance evidence, with consent, to reveal device-specific failures, compare kernel variants, and improve optimization and selection rules.

**Tags:** [JavaScript](https://yomu.fyi/topic/javascript), [WebGPU](https://yomu.fyi/topic/webgpu), [WGSL](https://yomu.fyi/topic/wgsl)

- Source: [Hugging Face](https://huggingface.co/blog/webgpu-kernels)
- Source URL: https://huggingface.co/blog/webgpu-kernels
- Ingested by Yomu: 2026-09-03T11:17:33.313Z

[Read original post](https://huggingface.co/blog/webgpu-kernels)
