tinygrad/examples/tinychat/tinychat-browser
2026-03-30 17:10:49 -04:00
..
.gitignore
compile.py DEV is ContextVar, setting Device.DEFAULT is deprecated (#15508) 2026-03-30 17:10:49 -04:00
compile_wasm.sh
index.css
index.html
index.js
make_tiktoken_js.sh
README.md
tiktoken-export.js
webpack.config.js
worker.js

How to build and run tinychat in browser (WebGPU and WASM)

  • PYTHONPATH=. python examples/tinychat/tinychat-browser/compile.py
  • ./examples/tinychat/tinychat-browser/compile_wasm.sh
    • Prerequisite: install emscripten. This script looks for ~/emsdk/emsdk_env.sh, adjust this based on your installation.
  • ./examples/tinychat/tinychat-browser/make_tiktoken_js.sh
    • Prerequisite: install npm, webpack.
  • cd examples/tinychat && python -m http.server 7776
  • In browser: open either localhost:7776/tinychat-browser (WebGPU), or localhost:7776/tinychat-browser/?backend=wasm (WASM)