How to add free on-device AI (Gemini Nano) to a Chrome extension

Google Chrome has a built-in AI called Gemini Nano that runs entirely on your computer — no internet or API costs needed. A developer shared how they wired this into a Chrome extension. This is a practical way to add AI features with zero token costs.

Chrome ships with a feature called the 'Built-in AI Prompt API.' Instead of sending requests to an external AI service and paying per token, this API lets your code talk to an AI model that already lives inside the browser on the user's device.

The author built a Chrome extension and integrated this on-device AI into it, then documented the process. The result: an AI-powered browser tool that works offline, costs nothing to run, and never sends user data to a third-party server. For anyone building AI agents or automation tools, this is a meaningful cost-cutting option — especially useful for prototyping or for tools where privacy matters.

Key points

  • Gemini Nano runs inside Chrome on the user's device — no external API calls needed
  • Zero token costs: you pay nothing per AI request
  • Uses Chrome's Prompt API to send instructions to the built-in model
  • User data stays on-device, which is better for privacy
  • Good fit for browser-based AI tools or agents that need to work without a server

Quick term guide

Gemini Nano
A compact AI model from Google designed to run locally inside browsers and devices, rather than in the cloud.
Chrome extension
A small software program you add to your web browser to give it new features.
token costs
Token costs are the fees paid for the text an AI model reads and writes.
Built-in AI Prompt API
A Chrome browser feature that lets developers call an on-device AI model directly, without connecting to an external server.
Prompt API
A Chrome browser feature that lets extensions send text instructions to the built-in AI and get a response back.
on-device AI
AI processing that runs on the phone itself rather than sending data to a remote server, which is faster and more private.
automation
A way to make repeated work happen without doing every step by hand.
Prototyping
Creating a clickable model of an app to test how it works.
Read original