DevTools Chatbot

An AI chatbot in the Chrome DevTools JavaScript console. Uses Chrome's experimental Prompt API (a.k.a. Chrome Built-in AI), which is a small Large Language Model like ChatGPT, built directly into the browser. View source code on GitHub.

How to enable the Prompt API with the Gemini Nano model:

  1. Download and open the Google Chrome Developer Edition. (Chrome Canary worked unreliably for me, but generally should work too).
  2. Visit chrome://flags.
  3. Set "Prompt API for Gemini Nano" to "Enabled" and "Enables optimization guide on device" to "Enabled BypassPerfRequirement".
  4. Restart Chrome.
  5. Visit chrome://components.
  6. If you see "Optimization Guide On Device Model" already listed there, you can jump to step 10.
  7. Open the DevTools console by pressing Ctrl/Cmd + Shift + J.
  8. Type await ai.createTextSession() into the console. This seems to be a weird hack to "force" Chrome into enabling the Built-in AI feature and somehow worked for me.
  9. Restart Chrome again.
  10. Assuming you see "Optimization Guide On Device Model" listed in chrome://components, click the "Check for updates" button beneath it and wait until the model has finished downloading. This will take a few minutes.
  11. Restart Chrome yet again.
  12. At this point, you should be all set.