git404hub

what is webgpt fr?

0hq/webgpt — explained in plain English

Analysis updated 2026-06-26

3,785JavaScriptAudience · developerComplexity · 3/5Setup · moderate

tl;dr

A proof-of-concept that runs a GPT-2 language model entirely inside your web browser using the graphics card, with no server or API key required, just HTML and JavaScript in under 1500 lines of code.

vibe map

mindmap
  root((WebGPT))
    What it does
      GPT in browser
      No server needed
      WebGPU powered
    Models
      Shakespeare small
      GPT-2 117M
    Code
      Under 1500 lines
      Plain JavaScript
      HTML only
    Requirements
      WebGPU browser
      Git LFS weights

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Run a GPT-2 language model locally in the browser without any server, API key, or cloud dependency.

VIBE 2

Learn how transformer models work by reading a minimal, self-contained WebGPU implementation under 1500 lines.

VIBE 3

Generate text in the browser from a Shakespeare or GPT-2 model without sending any data to external services.

what's the stack?

JavaScriptHTMLWebGPU

how it stacks up fr

0hq/webgptxotahal/react-native-material-uisubprotocol/verlet-js
Stars3,7853,7853,784
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderateeasyeasy
Complexity3/52/52/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires a WebGPU-enabled browser (Chrome Canary or Edge Canary) and Git LFS installed to download model weight files.

in plain english

WebGPT is a proof-of-concept project that runs a GPT-style language model directly inside a web browser, without any server sending the computations off to a cloud. It uses WebGPU, a newer browser technology that gives web pages access to the computer's graphics card for heavy number-crunching tasks. The entire implementation is written in plain JavaScript and HTML, coming in at under 1500 lines of code. The project includes two pre-packaged models you can try: a small model trained on Shakespeare's texts (described by the author as undertrained) and a larger GPT-2 model with 117 million parameters. Benchmarks on an M1 Mac show the 117M model generating text at around 30 milliseconds per token, meaning you get a new word roughly every 30 milliseconds. Running it locally is straightforward because it is just HTML and JavaScript files. The main requirement is a browser that supports WebGPU, which was still rolling out to major browsers when this was written. Chrome Canary or Edge Canary are the recommended options. The model weight files are large and stored using Git LFS, a system for tracking big files in a code repository, so you need that installed to download them after cloning. The project was built as a learning exercise. The author started with no background in how transformer models, GPU programming, or text tokenization work, and credits Andrej Karpathy's public video series for the foundational understanding. Code from the nanoGPT project and a JavaScript GPT tokenizer were also used as references. The roadmap in the README lists several remaining optimizations and open questions the author plans to address.

prompts (copy fr)

prompt 1
Walk me through how webgpt uses WebGPU shaders to run a GPT-2 forward pass in the browser, which files handle what?
prompt 2
How do I run the webgpt GPT-2 117M model locally in my browser, and which browsers currently support WebGPU?
prompt 3
Explain the tokenization approach used in webgpt and how it converts input text to token IDs before the model sees it.
prompt 4
I want to load my own model weights into webgpt, what format do the weights need to be in and how are they stored in the repo?
prompt 5
How would I extend webgpt to run a larger model like GPT-2 345M, what GPU memory limits should I watch for?

Frequently asked questions

what is webgpt fr?

A proof-of-concept that runs a GPT-2 language model entirely inside your web browser using the graphics card, with no server or API key required, just HTML and JavaScript in under 1500 lines of code.

What language is webgpt written in?

Mainly JavaScript. The stack also includes JavaScript, HTML, WebGPU.

How hard is webgpt to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is webgpt for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.