Live data from Hacker News

Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

twitter.com

61–70 of 194 posts

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#61

AI brain rot continues but now it's reaching unimaginable levels and infecting browser APIs, wow!

Why is it brain rot? It still blows my mind that it’s even possible for a low-power device to talk and behave like us. For all practical purposes, LLMs pass the Turing test. This a major leap forward in human innovation and engineering. IMO, this could be as influential as the adoption of electricity/setting up of the power grid.

One small aspect: it is training developers not to learn their tools. We now have a generation of "software developers" who think they can just lean on "AI" and it'll make them more productive. Except all they're capable of is outputting poorly put together inefficient crap, at best.

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#62
post #35

See https://developer.chrome.com/docs/ai/built-in https://github.com/jeasonstudio/chrome-ai I can’t seem to find public documentation for the API with a cursory search, so https://github.com/jeasonstudio/chrome-ai/blob/ec9e334253713... might be the best documentation (other than directly inspecting the window.ai object in console) at the moment. It’s not really clear if the Gemini Nano here is Nano-1 (1.8B) or Nano-2…

https://browsernative.com/chrome-google-ai-gemini-nano/

https://medium.com/@saga_view/integrate-nearly-real-time-fre...

https://qiita.com/shinonome_taku/items/358ec398fe871e3e8472

https://blog.devgenius.io/the-importance-of-large-language-m...

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#63

This doesn't seem useful unless it's something standardized across browsers. Otherwise I'd still need to use a plugin to support safari, etc. It seems like it could be nice for something like a bookmarklet or a one-off script, but I don't think it'll really reduce friction in engaging with Gemini for serious web apps.

"WebNN: Web Neural Network API" https://news.ycombinator.com/item?id=36158663 :

> - Src: https://github.com/webmachinelearning/webnn

W3C Candidate Recommendation Draft:

> - Spec: https://www.w3.org/TR/webnn/

> WebNN API: https://www.w3.org/TR/webnn/#api :

>> 7.1. The `navigator.ml` interface

>> webnn-polyfill

E.g. Promptfoo, ChainForge, and LocalAI all have abstractions over many models; also re: Google Desktop and GNU Tracker and NVIDIA's pdfgpt: https://news.ycombinator.com/item?id=39363115

promptfoo: https://github.com/promptfoo/promptfoo

ChainForge: https://github.com/ianarawjo/ChainForge

LocalAI: https://github.com/go-skynet/LocalAI

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#64

Sigh, don't make me tap the sign*. I used to hold Google Chrome in high esteem due to its security posture. Shoehorning AI into it has deleted any respect I held for Chrome or the team that develops it. Trust arrives on foot and leaves on horseback. * The sign: https://ludic.mataroa.blog/blog/i-will-fucking-piledrive-you...

mataroa is quite... grumpy, but with good cause. I like these kinds of pragmatic, burned out posts from engineers. Sometimes VCs are too much about hype and so very, very distant from reality.

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#65
> The code below is all you need to stream text with Chrome AI and the Vercel AI SDK. ... `chromeai` implements a Provider that uses `window.ai` under the hood

Leave it to Vercel to announce `window.ai` on Google's behalf by showing off their own abstraction but not the actual Chrome API.

Here's a blog post from a few days ago that shows how the actual `window.ai` API works [0]. The code is extremely simple and really shouldn't need a wrapper:

    const model = await window.ai.createTextSession();
    const result = await model.prompt("What do you think is the meaning of life?");
[0] https://afficone.com/blog/window-ai-new-chrome-feature-api/

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#66
post #7

Earlier quoted context omitted.

Yes, here's where you disable it: https://www.mozilla.org/en-US/firefox/new/

Mozilla does it too! [0] [0]: https://blog.nightly.mozilla.org/2024/06/24/experimenting-wi...

That has nothing to do with what Google is doing here.

That is an end user summarisation feature not a proprietary web API.

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#68
post #67

Does this mean all of those companies that complained about iterm2 recently on here are going to finally stop using chrome?

This is entirely local, the iTerm2 complaints were about the built-in ability to send data to a remote server.

That doesn't make the iTerm2 complaints right, but there's a clear difference.

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#69
post #35

See https://developer.chrome.com/docs/ai/built-in https://github.com/jeasonstudio/chrome-ai I can’t seem to find public documentation for the API with a cursory search, so https://github.com/jeasonstudio/chrome-ai/blob/ec9e334253713... might be the best documentation (other than directly inspecting the window.ai object in console) at the moment. It’s not really clear if the Gemini Nano here is Nano-1 (1.8B) or Nano-2…

1.8B/3.25B is still too much for edge devices. Ideally tens or hundreds mega would be ok. Is there an option to change the builtin Gemini Nano to other smaller models?

By the way, haven't touch the lastest JS code for a while, what does this new syntax mean: "import { chromeai } "

Also not get the textStream code: for await (const textPart of textStream) { result = textPart; } does result get override for each loop step?

Re: Chrome is adding `window.ai` – a Gemini Nano AI model right inside the browser

#70
post #50

If we thought websites mining Monera in ads was bad, wait until every site sells its users’ CPU cycles on a gray market for distributed LLM processing!

but that’s not much useful if the model is nano. Webgpu would be a better point of misuse maybe
Post reply on HN