A starting point for a client-side, LLM in the browser. This is for online and offline Javascript use. (Run it once and download this single page website)
This page demonstrates the core features of the Gemini Nano Prompt API (`LanguageModel` API) available in Chrome 138+.
Ensure you have enabled the necessary flags. Copy the link below and paste it into your Chrome address bar:
Then set #optimization-guide-on-device-model
(to Enabled BypassPrefRequirement)
Then search for and set all of them to enabled:
#prompt-api-for-gemini-nano
(set to Enabled)#prompt-api-for-gemini-nano-multimodal-input
(set to Enabled) #summarization-api-for-gemini-nano
(set to Enabled) #writer-api-for-gemini-nano
(set to Enabled) #rewriter-api-for-gemini-nano
(set to Enabled) #proofreader-api-for-gemini-nano
(set to Enabled)