← all repositories
vercel-labs/vgpu

TypeScript-native WebGPU for browser, Node, and CI

A WebGPU library that treats shader files like typed TypeScript modules and runs identically in the browser, headless Node, or a deterministic mock for tests.

2k stars TypeScript ML FrameworksInference · Serving
vgpu
Velocity · 7d
+60
★ / day
star history

What it does

vgpu wraps WebGPU in a minimal TypeScript API where .wgsl shaders are first-class modules and every draw, effect, or compute call flows through an explicit Gpu handle. It targets three runtimes — browser, headless Node via Dawn, and a deterministic software adapter — from a single surface.

The interesting bit

Shader imports resolve at build time through WGSL reflection, so binding names and buffer layouts stay synchronized between your GPU code and JavaScript without hand-written declarations. The project also publishes llms.txt, offline CLI docs, and an MCP endpoint, making it unusually friendly to coding agents.

Key highlights

  • .wgsl files import and export like ES modules; typed reflection keeps buffer layouts and binding names correct without manual sync.
  • One public API surface across browser, Node (vgpu/node), and a deterministic test mock (vgpu/mock).
  • Every entry point takes an explicit Gpu handle; there is no hidden global state or implicit scene graph.
  • A complete fullscreen effect ships in 25 KB gzipped, and the repo enforces bundle budgets in CI.
  • Docs, examples, shader validation, and an MCP endpoint are all reachable from the CLI and run fully offline.

Verdict

Reach for this if you want type-safe WebGPU shaders that can render in the browser and snapshot in CI without hardware. Skip it if you need a high-level game engine or scene graph — vgpu deliberately keeps frames explicit and state flat.

Frequently asked

What is vercel-labs/vgpu?
A WebGPU library that treats shader files like typed TypeScript modules and runs identically in the browser, headless Node, or a deterministic mock for tests.
Is vgpu open source?
Yes — vercel-labs/vgpu is open source, released under the MIT license.
What language is vgpu written in?
vercel-labs/vgpu is primarily written in TypeScript.
How popular is vgpu?
vercel-labs/vgpu has 2k stars on GitHub.
Where can I find vgpu?
vercel-labs/vgpu is on GitHub at https://github.com/vercel-labs/vgpu.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.