What it is
This project runs DeepSeek-R1, a reasoning model, directly in your web browser. It uses the small 1.5-billion-parameter version and your computer’s GPU through WebGPU, a browser feature that lets web pages use the graphics card. Under the hood it uses Transformers.js and ONNX Runtime Web.
In my tests it generated about 60 tokens per second.
Why run a model in the browser
- Privacy: your prompts never leave your computer. There’s no server and no API key.
- Works offline: once the model has downloaded, you can disconnect from the internet.
- No cloud costs: your own GPU does the work.
The catch is that only small models fit in a browser, so answers won’t match large hosted models. For experiments, teaching, and privacy-sensitive use, it works well.
Setup
git clone https://github.com/iamgmujtaba/deepseek-r1.git
cd deepseek-r1
bash run.sh
The app opens at http://localhost:8000. The first load downloads the model, which takes a few minutes; after that it loads from the browser cache.
Demo
Requirements
- A browser with WebGPU support (recent Chrome or Edge)
- Tested on macOS and Linux (Ubuntu)
- At least 4 GB of RAM
Acknowledgments
This project builds on the Hugging Face Transformers.js examples.