gitwtfhub

wtf is bitgpu?

stfurkan/bitgpu — explained in plain English

Analysis updated 2026-05-18

16TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TL;DR

bitgpu runs compact 1-bit AI language models directly in the browser using WebGPU, with no server, no dependencies, and streaming chat built in.

Mindmap

mindmap
  root((bitgpu))
      What it does
        Runs 1-bit LLMs
        In-browser via WebGPU
        Streaming chat
        Session persistence
      Tech stack
        TypeScript
        WebGPU
        Zero dependencies
      Use cases
        Private browser chat
        Offline AI demos
        Runtime benchmarking
      Compatibility
        Apple and NVIDIA fast path
        Workgroup fallback
        Device limit negotiation

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

Why would anyone build with this?

REASON 1

Add a private, server-free AI chat feature to a web page that runs entirely on the visitor's own GPU.

REASON 2

Build an offline capable browser demo of a small language model without hosting inference infrastructure.

REASON 3

Benchmark 1-bit model inference speed in the browser against another WebGPU runtime on the same hardware.

What's in the stack?

TypeScriptWebGPUJavaScript

How it stacks up

stfurkan/bitgpuachrefelouafi/basicproceduralbuildingacoyfellow/tuiport
Stars161616
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity3/53/54/5
Audiencedeveloperdeveloperdeveloper

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

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Needs a WebGPU capable browser and GPU, falls back automatically on unsupported hardware.

License terms are not stated in the available README.

Wtf does this do

bitgpu is a runtime that lets a web browser run certain small AI language models directly on your own graphics card, using a browser technology called WebGPU. It currently supports a family of models called Bonsai that store their internal numbers in a very compact one bit format, which keeps the download size and memory use low compared to typical models. The project ships ready made model files, so you can point your code at a hosted model and start chatting without converting anything yourself or running a server. It handles the full generation loop: picking the next word over and over, streaming each piece back to you as it is produced, and stopping cleanly when the model finishes or you cancel it. It also supports several ways of choosing which word comes next, including plain greedy selection and more varied sampling methods that reduce repetition or keep answers closer to the most likely options. Conversations can be saved and reloaded across page refreshes without having to reprocess everything from scratch. A built in benchmark compares bitgpu's speed against another popular browser based runtime on the same model and hardware, and the project reports meaningfully faster response times in that comparison, though it notes results will vary by device and browser version. The library has zero runtime dependencies once installed, and automatically falls back to a slower but more compatible code path on graphics hardware that lacks certain fast features, so it keeps working across a wider range of devices. This is aimed at developers who want to add offline capable, privacy friendly AI chat features to a web page without needing a backend server or sending user data anywhere.

Yoink these prompts

Prompt 1
Set up bitgpu in a web project to load the Bonsai 1.7B model and stream a chat response to the page.
Prompt 2
Explain how bitgpu's KV cache snapshot to IndexedDB lets a chat session survive a page reload.
Prompt 3
Show me how to configure bitgpu's sampling options like temperature and top-k for less repetitive output.
Prompt 4
Run bitgpu's built-in benchmark and compare decode speed against the fallback workgroup path.

Frequently asked questions

wtf is bitgpu?

bitgpu runs compact 1-bit AI language models directly in the browser using WebGPU, with no server, no dependencies, and streaming chat built in.

What language is bitgpu written in?

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

What license does bitgpu use?

License terms are not stated in the available README.

How hard is bitgpu to set up?

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

Who is bitgpu for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.