Chrome Built-in AI Doesn’t Require The Internet

I tried out the Built-in AI that apparently works on Chrome Dev or Canary v127+.
https://developer.chrome.com/docs/ai/built-in

// Detect dark theme
var iframe = document.getElementById(‘tweet-1807976909847818477-157’);
if (document.body.class…


This content originally appeared on DEV Community and was authored by 0xkoji

I tried out the Built-in AI that apparently works on Chrome Dev or Canary v127+.
https://developer.chrome.com/docs/ai/built-in

// Detect dark theme var iframe = document.getElementById('tweet-1807976909847818477-157'); if (document.body.className.includes('dark-theme')) { iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1807976909847818477&theme=dark" }

Enable the flag

chrome://flags/
Prompt API for Gemini Nano: enable
Enables optimization guide on device: enable BypassPrefRequirements
flags

Download the model

chrome://components/
After enabling the above flags and restarting the browser, you can access the components and download the model.
before download

The model download itself takes a bit of time. (It took about 1-2 minutes for me.)

after download

Try it from the console.

jsCopywindow.ai
const ts = ai.createTextSession()
const gemi = await ts
const output = gemi.prompt('can you tell me the capital of Japan?')

output

output

also, it worked as expected in Japanese
japanese


This content originally appeared on DEV Community and was authored by 0xkoji


Print Share Comment Cite Upload Translate Updates
APA

0xkoji | Sciencx (2024-07-03T04:47:58+00:00) Chrome Built-in AI Doesn’t Require The Internet. Retrieved from https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/

MLA
" » Chrome Built-in AI Doesn’t Require The Internet." 0xkoji | Sciencx - Wednesday July 3, 2024, https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/
HARVARD
0xkoji | Sciencx Wednesday July 3, 2024 » Chrome Built-in AI Doesn’t Require The Internet., viewed ,<https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/>
VANCOUVER
0xkoji | Sciencx - » Chrome Built-in AI Doesn’t Require The Internet. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/
CHICAGO
" » Chrome Built-in AI Doesn’t Require The Internet." 0xkoji | Sciencx - Accessed . https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/
IEEE
" » Chrome Built-in AI Doesn’t Require The Internet." 0xkoji | Sciencx [Online]. Available: https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/. [Accessed: ]
rf:citation
» Chrome Built-in AI Doesn’t Require The Internet | 0xkoji | Sciencx | https://www.scien.cx/2024/07/03/chrome-built-in-ai-doesnt-require-the-internet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.