browser-llm-nexus
An LLM running in this tab, with tool calling. Any ONNX model works — from the Hub,
from a host you control, from a zip URL, or from a file on disk. Same four lines either way,
and WebGPU or CPU is decided for you. Nothing you type leaves the page.
1 · Where the model comes from — you say, it never guesses
Hugging Face Hub
Your own host
Archive URL
Archive file
Files are read from <base><id>/onnx/… — your CDN, your cache headers.
Backend
auto — WebGPU, else CPU
force webgpu
force wasm (CPU)
Quantization
auto — probe what's served
q4
q8
fp16
fp32
Load model
device —
dtype —
model —
tool calling —
2 · Your tools — one JS file, edit it live
Every tool the model can call is defined here, in one file. Change it, hit
Apply tools , and the model picks it up on the next question — no reload,
no rebuild. Each tool(name, description, params, handler) is one callable.
Apply tools
Reset to sample
3 · Ask it something that needs a tool
Load a model, then press Ask. The question is prefilled and the tools above are already live — the model has to call one to answer correctly.
weather
time
math
The answers are deliberately unguessable — the model can only get them right by calling a tool.
Watch the tool log on the right.
What actually happened
Every round: the prompt the model received, its raw output before parsing, and how many tool
calls came out. If a small model answers instead of calling, this is where you see it.
Ask something to see the rounds.
4 · Your documents — retrieval, offline
Ask questions about text you paste — no server, nothing uploaded
The library's other half. A small embedding model (~23 MB) indexes what you paste, and
the chat model above answers from what was retrieved . Retrieval is markedly more
reliable than tool calling at these sizes — measured
10/10
against deliberately near-miss documents.
Documents — separate with a blank line
Index documents
Export .zip
Load a model first.
Index, then ask. The answers are unguessable codes, so a correct reply proves the right passage was retrieved rather than recalled.
5 · Use it in your app — copy this
This is the exact code for what you have selected above. It updates as you change the source,
the backend, or your tools.
Copy
Copy tools file only