# 0hq/WebGPT

Run GPT model on the browser with WebGPU. An implementation of GPT inference in less than ~1500 lines of vanilla Javascript.

Repository: https://github.com/0hq/WebGPT
Canonical: https://ross.abutalabs.com/products/webgpt
Homepage: https://kmeans.org
Language: JavaScript
License: NOASSERTION
License Family: other
Topics: gpt, nanogpt, transformers, webgpu
Last push: 2024-01-12T20:11:43+00:00

## Health v2 (maintenance only)
Score: 30/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 87
- inputs: {"age_days": 1231, "days_push": 964, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3792, forks 223 (observed 2026-08-28T04:08:18.842127+00:00)

## What it is
WebGPT is a vanilla JavaScript and HTML implementation of GPT transformer inference running in the browser via WebGPU, in under ~1500 lines of code. It serves as both a proof-of-concept for browser-based LLM inference and an educational resource, with tested support for models up to ~500M parameters.

## Use cases
- run GPT models entirely in the browser without a server
- learn how transformer inference works from a small codebase
- experiment with WebGPU compute shaders for machine learning
- run GPT-2 locally client-side with no backend
- demo browser-based LLM inference to others
- benchmark token generation speed on GPU in the browser

## When to choose
- you want serverless, fully client-side LLM inference in a WebGPU-capable browser
- you want a small, readable codebase to learn transformer/GPU kernel implementation
- you want a proof-of-concept for WebGPU compute in ML

## When to avoid
- you need production-grade, optimized inference for large models
- you need broad browser support (WebGPU is still rolling out)
- you need a packaged library or stable API - it's a proof-of-concept
- you need fast inference for models above ~1B parameters

## Facets
- artifact type: library
- maturity: experimental
- function: llm-inference, deep-learning, machine-learning, gpu-computing
- domain: large-language-models, deep-learning, web-development, education
- platform: browser
- tags: webgpu, gpt, transformers, vanilla-javascript, client-side-inference, proof-of-concept, educational, javascript

## Member repositories
- 0hq/WebGPT (main) score 30

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:18.842127+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:27:02.876096+00:00, confidence not recorded.
  - readme: https://github.com/0hq/WebGPT (fetched 2026-08-28T04:08:18.842127+00:00, sha b55f2b698ca8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
