1. What is Embedded Gemini Nano?
Google’s Gemini Nano is a LLM model for on-device tasks. It is a lightweight AI model which can process images, voice and text. Currently it is being used in some Google products such as Gboard, Talkback and Pixel Recorder.
Chrome recently published a beta version of Chrome which you can experience by installing Chrome Canary version. In this version they added an embedded version of Gemini Nano. It supports on-device AI processing of the webpage content.
I am testing the potential use cases and contribution to the user/customer experience. If you are also interested, you can try by following these steps.
2. Prerequisites
- Install Google Chrome Canary from this URL: https://www.google.com/chrome/canary/
- Open Google Canary and type chrome://flags to the address bar
- Type Prompt API for Gemini Nano to the search bar and set the option as enabled
- Type optimization-guide-on-device-model to the search bar and set the option as Enabled BypassPerfRequirements.
(Note: This option is could be set as Enabled if your computer has a Neural Processing Unit (NPU) but I’m not sure.)
- Restart your Chrome Canary application.
- Type chrome://components to the address bar. Find Optimization Guide On Device Model component and click Check for update button. Then wait a few moments for downloading and installation. (Note: if you don’t see Optimization Guide On Device Model option, set your primary Chrome Canary language as “English” from the browser settings)
- Now you can try the embedded Gemini Nano on your developer console or creating a HTML page and write the corresponding JS code!
I tried this feature to summarize my first blog post content http://www.firatyaman.com/posts/my-first-post/
3. Example JS code
const model=await http://window.ai.createTextSession();
await model.prompt('Who are you?')