Skip to content
Field note

Browser-Powered AI: How Gemini Nano & Smaller Models Can Redefine The Web

Introduction The AI landscape is evolving incredibly fast, with newer models able to perform more complex tasks with ease, but these breakthroughs often come with a hefty price tag, not to mention they aren't accessible to a large audience.

December 6, 2024·3 min read·Swarad Mokal, Technical Program Manager/ Field correspondent
Browser-Powered AI: How Gemini Nano & Smaller Models Can Redefine The Web

Introduction

The AI landscape is evolving incredibly fast, with newer models able to perform more complex tasks with ease, but these breakthroughs often come with a hefty price tag, not to mention they aren't accessible to a large audience.

This is where smaller AI models, which can run locally and are designed to operate efficiently on smaller devices, are the key to the AI future. These lightweight models are already reshaping the AI landscape by making powerful capabilities accessible directly within browsers and other edge platforms.

Google Chrome’s Built-in AI APIs, powered by Gemini Nano, bring many AI capabilities right into your browser. For many everyday use cases, such as real-time language translation, content & image generation, and summarization, this AI model is more than capable, setting a promising course for the future of AI that prioritizes accessibility, efficiency, and sustainability.

Continue reading to explore:

  1. How to enable these capabilities inside Chrome
  2. Some sample code to get started
  3. How this will change the landscape for AI soon

How to enable Chrome Built-in AI

If you want the complete experience, it is recommended that you use Chrome Canary. Some APIs are also available in Chrome stable (version 128 or later). There are some newer APIs that require version 131 or later.

Follow the given steps to enable Chrome's built-in API:

  1. Open Chrome and Enter chrome://flags in the address bar.
  2. Search for Gemini and turn on Prompt API, Summarization API, Writer API & Rewriter API.
  3. Search for chrome://flags/#language-detection-api, then enable the Language translation API.
  4. Search for chrome://flags/#translation-api, then enable the Translation API
  5. You should now have different APIs enabled for Gemini Nano.
  6. Enable the desired APIs from the dropdown and restart your browser.

Ensuring Models Are Ready

To check if you have the AI models available, open your browser console and run the following command.

If you don't see this output, the model might not be available and will be queued for download. The following steps will force the download.

  1. Open chrome://components in the address bar
  2. Find “Optimization Guide On Device Model.” This should show the status as Updated and a version number. If you don't see it, click the button “Check for update” to force the download and wait for some time to see something like the screenshot shown below.

3. Run the same test again, and now it should show the output “readily” in your console.

Sample code For Chrome APIs

The Chrome Built-in APIs are very straightforward and as simple as calling a function. Check out thisCodePen example for a quick demo.

See the Pen Chrome AI APIs - Gemini Nano Playground by swarad07 (@swarad07) on CodePen.

Checking Model Capabilities

The following snippet will help you understand your AI model capabilities.

Initializing AI Capabilities

Use the following code snippet to initialize the AI capabilities.

Using AI APIs

Now comes the important part, where we call the API to get things done, be it generating content, summarising, translating, etc.

How this will change the landscape for AI soon

As shown in the above demo, smaller AI models running directly inside browsers can revolutionize the AI landscape. By running inside browsers, these smaller models can make AI an everyday accessible tool. By eliminating subscriptions, and cloud connectivity, these models significantly reduce latency and improve user privacy. For users, this could mean control over data and compliance with stringent privacy regulations.

By integrating AI directly into the browser, tools that previously relied on cloud-based models risk becoming obsolete. This is because you no longer need to subscribe to a separate service for summarizing text or generating content. Your browser can do the same thing seamlessly as the content shows up on the screen.

AI models running directly inside the browser have the potential to revolutionize the AI landscape. It isn’t just about size, as is the case with large LLMs. Efficiency and accessibility are equally important. Having models like Gemini Nano inside the most popular browser can mark a shift in the AI landscape in the coming years.

Interested In A Demo?

Reach out to the experts at Axelerant for a demonstration of how to make your customer’s digital experiences more intelligent, responsive, and capable.

Companion brief

Bring this dispatch into a working session - one page in, scoping memo out.

Brief Foyer
Pressure-test "Field note" with a partner

If this dispatch landed, bring it into a room with us.

The argument in "Browser-Powered AI: How Gemini Nano & Smaller Models Can Redefine The Web" is ours - but every situation breaks the argument differently. Send the situation in one page and a named partner will reply inside one business day with a scoping memo: where the argument holds for you, where it bends, and what we'd actually do in the first two weeks.

One-pager · Field note

By submitting this form you acknowledge that you have read Axelerant's Privacy Policy and agree to its terms.

Replied to by a named partner within one business day.