3 min read
Asking the Browser's Own Model About This Site
This site has a rule that no AI model runs on my servers for visitors. Some browsers now ship a model of their own, though. Chrome's Prompt API runs it on the visitor's device, so nothing leaves the machine and nothing costs me anything. That made a small experiment possible: ask the portfolio a question in plain words and let the browser's model point at the right pages.
The model chooses, the site speaks
The most important decision was what the model is allowed to produce. It never writes an answer. It gets the site's list of projects and posts, about 1,100 tokens, and may only reply with page ids from that list. The reply is constrained by a JSON schema in which the ids are an enum, so it cannot name a page that does not exist. The search palette then shows the chosen pages using their own copy, with a note that a model picked them and might be wrong.
How well it worked
I measured it with the real model on 15 questions made from the site's own data, in desktop Chrome, one run each:
- For 13 questions with a right page, that page came first 12 times.
- It declined both questions the site cannot answer.
- Across three runs, it never named a page that is not on the site.
- The first answer took about 9 seconds while the model loaded; later ones took under 2.
That is a small sample on one machine, and it measures whether the right page was found, not how many wrong ones came with it. It is good enough to keep as an experiment, not to make the default.
Teaching it to say no
The first version picked a page for every question, including "What is the capital of Australia?". Two changes fixed it: the answer now has to start by saying whether anything fits, and the prompt shows the model one example where nothing does. After that it declined both questions it should, at the cost of one answer it had been getting right.
My first test of declining was a question about the weather, and the model picked a page. That was fair: the site has a weather app. A test of "no" has to ask about something the site is genuinely not about.
Why automation couldn't test it
I expected to run the measurements from a test script. In Playwright's browser the model reported itself unavailable, because the launch flags switch it off. A plain Chrome with a fresh profile sat at "downloading" for ten minutes without fetching anything. The model only installed and ran in my own Chrome, started from a real click. So the evaluation became a page I open myself, which runs the questions and reports the results.
Try it
The experiment is off by default and listed on the lab page. Turn it on there, or open the site with ?lab=ask, then press Ctrl or Cmd K, type a question and choose "Ask". It needs desktop Chrome with the Prompt API, plenty of disk space and a capable GPU, so most visitors won't see the option. That is fine for an experiment.