GPT-2 in Your Browser: A WebGL2 Inference Demo
2025-05-02
This impressive project brings the full forward pass of the GPT-2 small model (117M parameters) to the browser using WebGL2. Leveraging WebGL2 shaders for GPU computation and js-tiktoken for BPE tokenization (no WASM needed), it runs GPT-2 directly in the browser. A Python script downloads pretrained weights, and the front-end is built with Vite for hot module replacement. This is a fantastic example of bringing advanced AI models to the browser, showcasing the cutting-edge capabilities of web technologies.
AI