Skip to content
Model

Run Whittle 9B in your browser

Chat with Whittle 9B in a Chrome tab: the model runs in a browser worker on WebGPU, so your messages, its reasoning and its tool calls stay on your device. This quickstart serves the app and the model from your own machine.

  • Google Chrome, with graphics acceleration on (it is by default). The app is tested on Apple-silicon Macs.
  • Git and Python 3. On a Mac, git --version in Terminal offers to install the command-line tools if they are missing.
  • whittle-9b-WTG2_0.whittlebin (see Get the model), and several GB of free disk space: Chrome keeps its own copy of the model.

Clone the app and work from its folder:

git clone https://github.com/literal-labs/whittle-web.git
cd whittle-web

Whittle 9B is gated: open its page on Hugging Face while signed in, accept the Literal Labs Non-Production Licence (access is granted straight away), then log in once in Terminal with hf auth login. The hf tool comes with pip install -U huggingface_hub. Then download the model and its checksums, and check them. The check should print whittle-9b-WTG2_0.whittlebin: OK.

hf download literal-labs/whittle-9b whittle-9b-WTG2_0.whittlebin SHA256SUMS --local-dir ~/models/whittle
(cd ~/models/whittle && shasum -a 256 -c --ignore-missing SHA256SUMS)

Serve the app and the model on your own machine, and leave this Terminal window open:

python3 tools/serve.py --port 8765 --model ~/models/whittle/whittle-9b-WTG2_0.whittlebin

It prints Whittle is available at http://localhost:8765/. It only listens on your own machine (127.0.0.1). If port 8765 is taken, use another, such as --port 8767.

Open localhost:8765 in Chrome, then:

  1. Choose Check my device, and look for a WebGPU adapter. If there is none, turn on graphics acceleration in Chrome’s settings and relaunch it.
  2. Choose Download model. The app copies the model from your local server into the browser’s storage and checks its SHA-256. Next time, Open saved model skips the copy. Choose local file loads the model straight from disk instead.
  3. Open More examples, then Try the calculator. The answer to 48,213 × 7,919 is 381,798,747; open the calculator entry in the reply to see the arithmetic that ran.
  4. Open Model details, below the chat, to see which runtime and GPU it chose.

To see that nothing leaves your device, load the model, disconnect from the network and ask a new question. Verify privacy, above the chat, shows how to watch the browser’s network panel during a reply.

Press Control-C in Terminal to stop the server.

The app’s repository has guides to attachments and citations, offline Wikipedia, how inference runs on the GPU, and how to reproduce its benchmarks.