Get started with built-in AI

Published: December 12, 2024

With built-in AI, your web application can perform AI-powered tasks without needing to deploy or manage its own AI models. The Chrome AI team is developing task-specific web platform APIs and browser features that integrate AI models in your browser. We aim for these APIs to work when implemented in the browser, on a user's device.

Requirements

At this time, you can only use these APIs in Chrome, but we aim to standardize them across browsers.

Models

The Prompt API, Summarizer API, Writer API, and Rewriter API download Gemini Nano, which is designed to run locally on desktop and laptop computers. These APIs don't work on mobile devices.

As of now, these APIs only support text-to-text modality.

Hardware

The Language Detection and Translation APIs work on desktop and Android devices, in Chrome.

The Prompt API, Summarizer API, Writer API, and Rewriter API work in Chrome when the following conditions are met:

  • Operating system: Windows 10 or 11; macOS 13+ (Ventura and onwards); or Linux. Chrome for Android, iOS, and ChromeOS are not yet supported by our APIs backed by Gemini Nano.
  • Storage: At least 22 GB on the volume that contains your Chrome profile.
  • GPU: More than 4 GB of RAM.
  • Network: Unlimited data or an unmetered connection.

These requirements exist for you in your development process and your users who work with the features you build.

Start building

There are several built-in AI APIs available at different stages of development. Some are available to all developers in origin trials, while others are only available to early preview program participants.

Each API has its own set of instructions to get started and download the model, both for local prototyping and in production environments with the origin trials.

While the Prompt API is only available locally and in Chrome Extensions, the other APIs work for websites and Chrome Extensions.

Use APIs on localhost

All of the APIs are available on localhost in Chrome. Follow these steps to

  1. Open Chrome on one of these platforms: Windows, Mac, or Linux.
  2. Go to chrome://flags/#optimization-guide-on-device-model.
  3. Select Enabled BypassPerfRequirement. This bypasses performance checks and VRAM requirements, which may prevent Gemini Nano from downloading on your device.
  4. Go to chrome://flags/#prompt-api-for-gemini-nano.
  5. Select Enabled.
  6. Click Relaunch or restart Chrome.

To confirm Gemini Nano has downloaded and works as intended, open DevTools and type (await ai.assistant.capabilities()).available; into the console. This should return readily.

Troubleshoot localhost

If Gemini Nano doesn't work as expect, follow these steps:

  1. Restart Chrome.
  2. Go to chrome://components.
  3. Confirm that Optimization Guide On Device Model is present. This means Gemini Nano is either available or downloading.
    • If there's no version number listed, click Check for update to force the download.
  4. Open DevTools and type (await ai.assistant.capabilities()).available; into the console. This should return readily.

If necessary, wait for some time and repeat these steps.

Standards process

We're working to standardize these APIs, so that they work across all browsers. This means we have proposed the APIs to the web platforms community, and moved them to the W3C Web Incubator Community Group for further discussion.

We are requesting feedback from the W3C, Mozilla, and WebKit for each API.

You can learn more about this process for each API in the corresponding documentation.

Engage and share feedback

If you try built-in AI and have feedback, we'd love to hear it.