WebGPU
WebGPU is a browser API that gives web pages direct access to the GPU for both graphics and general-purpose computation. It is what makes it practical to run a language model inside an ordinary browser tab, without a plugin, a driver or a native install.
What it replaces
WebGPU is the successor to WebGL, and the difference is not mainly speed. WebGL was a graphics API that people abused to do maths: to multiply two matrices you encoded them as textures, drew a triangle and read the pixels back. WebGPU exposes the GPU the way native APIs like Vulkan, Metal and Direct3D 12 do, with explicit compute shaders, buffers and command queues, so numerical work is a first-class operation rather than a trick.
Shaders are written in WGSL, a language defined by the spec rather than borrowed from OpenGL. In practice most people never see it: they use a library that ships its own kernels.
Where you actually meet it
The feature detection is one line, and everything else depends on it:
if (!navigator.gpu) {
// No WebGPU. There is no software fallback worth having.
return;
}
The visible application is on-device machine learning. Runtimes such as web-llm, ONNX Runtime Web and transformers.js compile models to WebGPU kernels so inference happens on the visitor's own hardware. NorthernGo uses this for its local generation mode: a quantized model is downloaded into the browser once and then runs on your graphics card, with nothing sent off the device.
What to watch out for
- It is not a compatibility layer for CUDA. The mature Python GPU ecosystem does not come along. You get what your runtime has ported.
- Browser support is uneven, not universal. Desktop Chromium has had it longest; other engines and platforms have arrived at different times and behind different flags. Always feature-detect, and give a real fallback rather than a broken page.
- Available video memory is the real ceiling. A model that needs more VRAM than the machine has does not run slowly, it fails — often with an error that says nothing useful.
- It is slower than native. Expect a fraction of what the same GPU does through a native runtime. That is usually an acceptable price for requiring no install at all.
Mobile support exists on paper. Downloading several gigabytes of weights over a phone connection, then holding them in memory, is a different question from whether the API is present.
Frequently asked questions
Do I need a dedicated graphics card for WebGPU?
No. WebGPU works on integrated graphics, and simple compute or rendering work runs fine there. Language models are the exception: they need several gigabytes of graphics memory, and integrated chips that share system RAM will either be very slow or run out of memory entirely.
Is WebGPU the same thing as running AI offline?
No. WebGPU only decides where the computation happens. The model weights still have to be downloaded over the network the first time, and any other part of the page can still make server calls. On-device execution and offline capability are separate properties that often, but not always, come together.
Build it yourself
NorthernGo turns a plain-text description into a working web app with a database, login and a live URL. Local AI generation runs on your own GPU, is unlimited, and is free on every plan.