Vercel AI Open-Sources vgpu: A TypeScript WebGPU Library for AI Agent Shaders

2026年8月28日 17:28
站內 AI 整理稿

Shaders are still the hardest thing to ship on a normal web team.WebGPU gives you the hardware, then hands you adapters, bind group layouts, and pipeline descriptors before a single pixel moves.Vercel spent that cost internally building the shaders on vercel.com, and has now open-sourced the result.

vgpu is a TypeScript library that treats .wgsl files as importable modules, exposes one Gpu context, and runs the same shader in a browser canvas, in headless Node.js, and in a CI snapshot test.Is it deployable?

Yes,vgpu is MIT licensed and published to npm, so pnpm add vgpu is the entire acquisition path.It is a library, not a hosted service, so there is no account, quota, or inference bill.#mtp-vgpu-x7k2 p:empty, #mtp-vgpu-x7k2 hr, #mtp-vgpu-x7k2 del, #mtp-vgpu-x7k2 s {display:none!

important} #mtp-vgpu-x7k2 iframe {display:block!important;width:100%!important;border:0!important;background:transparent!important;overflow:hidden!important} (function(){ window.addEventListener('message', function(e){ if(!e.data || !e.data.vgpuHeight) return; var f = document.

getElementById('mtp-vgpu-x7k2-frame'); if(f) f.style.height = e.data.vgpuHeight + 'px'; }); })(); One context, no hidden global state init() acquires an adapter and device and returns a single Gpu handle.Everything else hangs off it.

The browser quick start in the README is four lines: Copy CodeCopiedUse a different Browserconst gpu = await init(); const surface = gpu.surface(canvas, { dpr: [1, 2] }); const wave = gpu.effect(WAVE_WGSL, { set: { speed: 2 } }); gpu.frame.loop(() => { wave.set({ time: gpu.time }); wave.

draw(); }); surface wraps the canvas and clamps device pixel ratio between 1 and 2.effect compiles WGSL into a fullscreen effect whose uniforms are addressed by their WGSL names through set().Frames are explicit: passes, clears, and draws are calls, never implicit scene-graph state.

WGSL as a Module System The differentiator is shader tooling..wgsl files import and export like TypeScript modules.vgpu resolves the module graph, reflects bindings, removes unused declarations, and emits compact shader source at build time.

That removes the hand-written binding declarations that normally drift out of sync with the shader.The README states a complete fullscreen effect ships in 25 KB gzipped, and that the budget is enforced in CI.

Three Runtimes, One API The package exposes subpath exports for vgpu, vgpu/node, vgpu/mock, vgpu/scene, vgpu/client, and vgpu/core.The Node path is Dawn-backed and renders offscreen: Copy CodeCopiedUse a different Browserconst target = gpu.

target({ size: [256, 256], format: "rgba8unorm" }); const pixels = await target.read(); That is what makes CI rendering practical.

pixelmatch and pngjs are direct dependencies of the published package, consistent with the documented workflow where CI compiles the shader, renders a headless frame, and compares the snapshot.The mock adapter is deterministic and exists for tests that should not touch a GPU at all.

The Agent Surface Vercel calls this an agent-first library, and the packaging backs that up.The package ships a vgpu binary, so npx vgpu docs, npx vgpu examples, and npx vgpu check work without a global install.vgpu.sh publishes agents.md, llms.

txt, and a full documentation export, plus a tokenless examples discovery API with an OpenAPI 3.1 description.A hosted read-only MCP server is available at vgpu.sh/api/mcp, and @modelcontextprotocol/server is a direct dependency.There is also an installable agent skill in the repo.

Comparison #mtp-vgpu-cmp-q4n8 p:empty, #mtp-vgpu-cmp-q4n8 hr, #mtp-vgpu-cmp-q4n8 del, #mtp-vgpu-cmp-q4n8 s {display:none!important} #mtp-vgpu-cmp-q4n8 iframe {display:block!important;width:100%!important;border:0!important;background:transparent!important;overflow:hidden!

important} #mtp-vgpu-cmp-q4n8 .mtp-vgpu-cmp-q4n8-cap {font-size:11px!important;color:#8a8a8a!important;text-align:center!important;margin-top:8px!important;line-height:1.5!important} Tap any column header to spotlight one library.Scroll the table sideways on narrow screens.(function(){ window.

addEventListener('message', function(e){ if(!e.data || !e.data.vgpuHeight) return; var f = document.getElementById('mtp-vgpu-cmp-q4n8-frame'); if(f) f.style.height = e.data.vgpuHeight + 'px'; }); })(); Key Takeaways Vercel open-sourced vgpu, the WebGPU library it built to ship shaders on vercel.com.

One API surface runs in the browser, in headless Node.js via Dawn, and in a deterministic mock..wgsl files import and export like TypeScript modules, with reflection for bindings and layouts.A complete fullscreen effect ships in 25 KB gzipped, a budget the repo says CI enforces.

MIT licensed, on npm at v0.3.1, with a CLI, llms.txt, and a hosted read-only MCP endpoint.Check out the GitHub Repo, Docs and Examples, and the npm package.Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?

now you can join us on telegram as well.The post Vercel AI Open-Sources vgpu: A TypeScript WebGPU Library for AI Agent Shaders appeared first on MarkTechPost.

Related

相關文章

何夕2077AI Agent

智能體工作報告系統性遺漏負面結果

Ad Skip to content AI models hide mistakes in their own work reports, but one sentence in your prompt can help Jonathan Kemper View the LinkedIn Profile of Jonathan Kemper Oct 17, 2026 Nano Banana Pro prompted by THE DECODER Language models writing up their own work systematically skip problems that undermine the results.

23 小時前
何夕2077AI Agent

智能體高風險審批暴露綁定漏洞

Computer Science > Cryptography and Security arXiv:2610.21063 (cs) [Submitted on 15 Oct 2026] Title:Approve What, Exactly? Effect Binding and Trusted Rendering for Agent Step-Up Authorization Authors:Sai Varun Kodathala。

1 天前
雷峰網AI Agent

JAECOO × Momenta完成首個無接管凱旋門智駕挑戰,聯合征服巴黎“最難魔鬼環島”

當地時間10月12日,巴黎車展期間,JAECOO與Momenta共同完成首個無接管的凱旋門智駕挑戰。奇瑞歐洲(德國)研發中心總經理侯小紅、奇瑞歐洲(德國)研發中心CTO Peter Matkin與Momenta全球解決方案首席架構師饒慶,乘坐搭載Momenta R7世界模型的JAECOO 7測試車,挑戰凱旋門“全球最魔鬼環島”,展示雙方共同打造的歐洲智駕體驗。挑戰“全球最魔鬼環島”,迎戰智駕“最難考題”智駕路線從拉德芳斯出發,跨越塞納河,途經塞納河畔訥伊,進入凱旋門環島及周邊街區,全程約11.38公里。

2 天前
AIBaseAI Agent

AI 代理網購遭亞馬遜封殺!馬斯克被逼急:大不了自己建個電商帝國去競爭

馬斯克被逼急:大不了自己建個電商帝國去競爭發布於AI新閒資訊時間 :Oct 16, 2026閱讀 :1分鐘人工智能智能體(AI Agent)正試圖顛覆傳統的網購模式,但各大傳統電商平臺顯然並不打算輕易敞開大門。近日,有用戶在社交平臺發帖反饋,稱亞馬遜正在通過技術手段阻止埃隆·馬斯克旗下的 AI 智能體 Grok Bot 在其平臺上替用戶完成下單操作。

2 天前6600