browseML / README.md
Gregory-L's picture
browseML 0.8.8: client-aware answers, presets per persona
f5711f2 verified
|
Raw History Blame Contribute Delete
5.23 kB
---
title: browseML
emoji: 🌐
colorFrom: green
colorTo: yellow
sdk: static
app_file: app.html
pinned: false
license: mit
short_description: bankML in your browser, verified, a receipt on every answer
custom_headers:
cross-origin-embedder-policy: credentialless
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: cross-origin
tags:
- webassembly
- browser-inference
- 1-bit
- gguf
- verified-inference
- rust
models:
- prism-ml/Bonsai-1.7B-gguf
---
# browseML β€” bankML in your browser
This page runs [bankML](https://github.com/cryptoAGI/bankml)'s own engine, compiled to WebAssembly, on your CPU.
Nothing to install, no account, and no server answers for you: the Space only serves files.
**browseML 0.8.8** ([release](https://github.com/browseML/browseML/releases/tag/v0.8.8)): the app opens at `app.html`
(the field, the control panel, diagnostics, personas, receipts banked); the landing page is `index.html`.
- **The model, verified before it speaks.** Bonsai-1.7B Q1_0 (248 MB) is downloaded once from
`prism-ml/Bonsai-1.7B-gguf` at a pinned revision and kept in your browser's Cache Storage. The engine checks it as
`bankml serve` does: the GGUF guard, then the sha256 of the whole file against its pin
(`browseML/Bonsai-1.7B-Q1_0.gguf.FORK.json`). It does not answer from a file that fails either check.
- **A receipt on every answer, checked in the page.** The engine returns `serve`'s own `bankml_receipt`. The page
recomputes the sha256 of the text it received and shows the verdict under the answer: βœ“ when it matches, βœ— when
it does not or when no receipt came.
- **Three things kept apart.** The answer is only the model's text. A note the page adds is labelled as the page's.
The delivery line gives the engine's own token counts, the time to the first token, tokens per second, where it
ran and the receipt's verdict. If the engine counts no completion tokens, the page says *No delivery from the
model* rather than showing text. Only a delivered answer joins the conversation.
## Three builds, one engine
| file | target | used when |
|---|---|---|
| `browseml-mt-relaxed.wasm` | `wasm32-wasip1-threads`, SIMD + relaxed SIMD | the page is cross-origin isolated, the browser compiles relaxed SIMD (Chrome, Edge), and `relaxed_madd` is fused on this machine (checked when the engine starts) |
| `browseml-mt.wasm` | `wasm32-wasip1-threads`, SIMD | cross-origin isolated, otherwise (Firefox, or `relaxed_madd` not fused) |
| `browseml.wasm` | `wasm32-wasip1`, SIMD | not isolated, or no `SharedArrayBuffer`: one thread |
All three are exact, not approximate. The SIMD kernels match the scalar reference bit for bit. The relaxed build
is used only where its multiply-add is fused, which makes it the reference's `mul_add`; where it is not fused, the
page falls back to `browseml-mt.wasm`. The answers are the same with any build. Only the speed changes.
**The oracle.** `browseML/testing/oracle.mjs` runs the WebAssembly engine on llama-server b11192's recorded answers
(nine conversations, temperature 0.3, fixed seeds). Every text, finish reason and token count must be identical.
`browseml.wasm` gives 9 of 9, and `browseml-mt-relaxed.wasm` on 2 threads gives 9 of 9.
## Limits
- **Threads need cross-origin isolation.** This Space sends `cross-origin-opener-policy: same-origin` and
`cross-origin-embedder-policy: credentialless` (above). Without them, the engine runs on one thread.
- **Safari runs on one thread.**
- **The model's first download is 248 MB.** The page asks before it starts, then shows the download's progress.
- **Memory.** A tab holds about twice the model while it loads, then the model once.
- **An answer cannot be stopped midway.** The engine runs until the turn ends or the answer reaches its token limit.
- **Speed is your CPU's.** On a 2-core laptop the engine writes about 1 to 3 tokens a second.
## The files
This Space is the build of [github.com/browseML/browseML](https://github.com/browseML/browseML) at tag `v0.8.8`
(`app/`: `npm run build`): `app.html` and `assets/` are the app, `index.html`, `style.css` and `app.js` the landing
page, the three `.wasm` the engines exactly as the release gate built them (both oracles 9 of 9, 78 of 78 browser
checks; record `testing/results/v0.8.8.txt` in the repository). `COPIED.json` records the sha256 of every file, so a
copy that drifts from its release shows up. Here browseML answers as itself: no host file, so no host persona or
docs atlas (those are mindx.pythai.net's).
## More bankML
- [PYTHAI/bankml](https://huggingface.co/spaces/PYTHAI/bankml): the full Space. It offers bankML in this browser,
your own `bankml serve`, or a Hugging Face provider (labelled as not bankML), plus diagnostics, FAQ and logs.
- [PYTHAI/bankML-UIF](https://huggingface.co/spaces/PYTHAI/bankML-UIF): the experimental edition.
- [github.com/cryptoAGI/bankml](https://github.com/cryptoAGI/bankml): the source. The runtime for 1-bit and ternary
GGUF models is bit-exact against llama.cpp b11192.
Licence: bankML is `MIT OR Apache-2.0`, at your choice. This Space's files are under either licence, and the Hub
lists it as `mit`. Bonsai-1.7B is Apache-2.0 (prism-ml).