gpt2-webgl
AI
language model inference
SHOW HN2025
How HN took it
6 positive, 7 neutral or asking, 0 mixed, 2 critical, out of 15 comments about the project. Thread score +0.33.
Execution: 0 for, 2 againstIdea: 2 for, 0 againstPerformance: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Cool, impressive project
From 3 comments
As the guy who did GPT2 in Excel, very cool and kudos!! Curious why you chose WebGL over WebGPU? Just to show it can be done? (Also see my other comment about fetching weights…
ianand on HNNice, that takes some serious grinding to pull off in shaders. Makes me kinda wonder - does pushing old tools like WebGL actually force deeper understanding of how these models…
gitroom on HNWould be really cool to have it hosted on a website if it can be a static page so we could try it out
SamosaGuru on HN
Interesting link to GPU programming history
From 1 comment
> Back in the old days, people used to do general-purpose GPU programming by using shaders like GLSL. This is what inspired NVIDIA (and other companies) to eventually create CUDA…
supuun on HN
Objections
Demo page does not load or lacks visualizations
From 2 comments
Incredible. Was going to suggest tossing up a github page with it, but looks like one is currently in-progress? (https://nathan-barry.github.io/gpt2-webgl/) but doesn't seem to…
jasonjmcghee on HNThis is pretty rad. I've built and run the project on my MacBook and can't seem to get the visualizations to show as they appear in the GitHub demonstration. I'm running Firefox…
throwaway314155 on HN
Requests
Host a working demo on GitHub Pages
From 2 comments
Would be really cool to have it hosted on a website if it can be a static page so we could try it out
SamosaGuru on HNIncredible. Was going to suggest tossing up a github page with it, but looks like one is currently in-progress? (https://nathan-barry.github.io/gpt2-webgl/) but doesn't seem to…
jasonjmcghee on HN
Load weights from Hugging Face instead of bundling them
From 2 comments
You may be able to fetch the weights directly from Hugging Face. I'd try that first.
Philpax on HNI haven't looked at your implementation, but if you can read ONNX weights... https://huggingface.co/Xenova/gpt2
jasonjmcghee on HN
Write-up of how it was made
From 1 comment
Would absolutely read a 'making of' post on this project!
helloplanets on HN
Questions
Why WebGL instead of WebGPU
From 1 comment
As the guy who did GPT2 in Excel, very cool and kudos!! Curious why you chose WebGL over WebGPU? Just to show it can be done? (Also see my other comment about fetching weights…
ianand on HN
How much inference time is GPU-bound versus CPU-bound
From 1 comment
Super cool project! How much of the inference time is actually GPU-bound vs CPU-bound in the browser? Curious if WebGPU would offer a big perf boost over WebGL2 here.
badmonster on HN
Alternatives named
transformers.js (ONNX runtime)
From 2 comments
> Curious why you chose WebGL over WebGPU? Just to show it can be done? For a WebGPU implementation, one can use transformers.js directly (or many other libraries actually),…
littlestymaar on HNTransformers.js wraps the ONNX runtime which is rather versatile (WASM, WebGL, WebGPU, and WebNN). It's not the backend that makes it novel.
85392_school on HN
gpt2-tfjs
From 1 comment
Checkout https://github.com/jseeio/gpt2-tfjs fetches the weights for GPT2 from huggingface on the fly.
ianand on HN
GPT-2 in Excel
From 1 comment
As the guy who did GPT2 in Excel, very cool and kudos!! Curious why you chose WebGL over WebGPU? Just to show it can be done? (Also see my other comment about fetching weights…
ianand on HN
Qwen2-0.5B shader world in VRChat
From 1 comment
I'm reminded of this VRChat world, which runs Qwen2-0.5B in a shader: https://vrchat.com/home/launch?worldId=wrld_e919c1f4-8399-43cc-8305-d890dc8e2e98
Philpax on HN