Examples
Every example below runs in the live demo, which loads a model once and lets you switch between them. Each page has the complete tools file — the same code the demo runs — plus the questions to try and an honest note on how small models handle it.
| Example | What it shows |
|---|---|
| Basics | Three tools whose answers a model cannot guess — so a correct answer proves a real call happened. |
| JavaScript eval | A code interpreter in the tab: the model writes JavaScript, a Web Worker runs it. |
| This tab | Tools no server-side agent can have: they read and change the page you are looking at. |
| Crypto & encoding | SHA-256, base64 and UUIDs from Web Crypto — answers no model can guess, only compute. |
| Notes | Memory that survives a reload: three tools over localStorage. |
| Dates & units | Day counts, weekdays and unit conversions — the arithmetic small models get subtly wrong. |
| Live web | Live data from GitHub, Hacker News and Wikipedia — the model is local, only each tool’s request leaves the tab. |
| Just chat | No tools: an ordinary chat with the model running in the tab. |
| Decisions, Jev-style | Probabilities over your options from one forward pass — and a game of Snake run by a decision model. |
| Embeddings & RAG | Answer from your own documents, retrieved in the tab. |
Every tools file follows one shape:
tool('name', 'What it does — the model reads this to decide when to call it.', { arg: 'string' }, // shorthand JSON schema async ({ arg }) => ({ result })); // any JSON back; the model answers from itKeep each example to a handful of tools: a 0.5B model picks reliably from three names, not from thirty.