npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@localmode/chrome-ai

v2.0.0

Published

Chrome AI provider for @localmode - zero-download inference via Chrome's built-in Gemini Nano

Downloads

59

Readme

@localmode/chrome-ai

npm license

Docs Demo

Zero-download, instant AI inference via Chrome's built-in Gemini Nano model. Part of the LocalMode ecosystem.

Features

  • Zero model downloads — Gemini Nano ships with Chrome
  • Zero bundle size impact — browser-native APIs
  • Instant inference — no model loading delay
  • Implements SummarizationModel and TranslationModel from @localmode/core
  • Automatic fallback support — pair with @localmode/transformers for non-Chrome browsers

Requirements

  • Chrome 138+ on desktop (Windows 10+, macOS 13+, Linux, or ChromeOS on Chromebook Plus)
  • 22 GB free disk space on the volume containing your Chrome profile (for the Gemini Nano model)
  • Hardware: GPU with >4 GB VRAM, or CPU with 16 GB+ RAM and 4+ cores
  • Not available on mobile (Android/iOS) or in Incognito mode
  • Non-Chrome browsers need a fallback provider (e.g., @localmode/transformers)

Enabling Chrome AI

  1. Navigate to chrome://flags/#optimization-guide-on-device-model → set to Enabled
  2. Navigate to chrome://flags/#prompt-api-for-gemini-nano → set to Enabled
  3. Restart Chrome
  4. The Gemini Nano model downloads automatically in the background (~1.5 GB)
  5. Verify in DevTools Console: await Summarizer.availability() should return "readily"

For the Summarizer API specifically, also enable chrome://flags/#summarization-api-for-gemini-nanoEnabled with Adaptation for higher-quality summaries via LoRA.

Installation

pnpm add @localmode/chrome-ai @localmode/core

Quick Start

import { summarize, translate } from '@localmode/core';
import { chromeAI } from '@localmode/chrome-ai';

// Summarize text (instant, no download)
const { summary } = await summarize({
  model: chromeAI.summarizer(),
  text: 'Long article text...',
});

// Translate text
const { translation } = await translate({
  model: chromeAI.translator({ targetLanguage: 'de' }),
  text: 'Hello, world!',
});

Fallback Pattern

import { summarize } from '@localmode/core';
import { chromeAI, isSummarizerAPISupported } from '@localmode/chrome-ai';
import { transformers } from '@localmode/transformers';

const model = isSummarizerAPISupported()
  ? chromeAI.summarizer()
  : transformers.summarizer('Xenova/distilbart-cnn-6-6');

const { summary } = await summarize({ model, text: 'Long article...' });

API

chromeAI.summarizer(settings?)

Creates a SummarizationModel using Chrome's Summarizer API.

| Setting | Type | Default | Description | |---------|------|---------|-------------| | type | 'key-points' \| 'tl;dr' \| 'teaser' \| 'headline' | 'tl;dr' | Summary type | | format | 'markdown' \| 'plain-text' | 'plain-text' | Output format | | length | 'short' \| 'medium' \| 'long' | 'medium' | Summary length | | sharedContext | string | — | Context shared across calls |

chromeAI.translator(settings?)

Creates a TranslationModel using Chrome's Translator API.

| Setting | Type | Default | Description | |---------|------|---------|-------------| | sourceLanguage | string | 'en' | Source language (BCP 47) | | targetLanguage | string | 'es' | Target language (BCP 47) |

Feature Detection

import { isChromeAISupported, isSummarizerAPISupported, isTranslatorAPISupported } from '@localmode/chrome-ai';

if (isChromeAISupported()) { /* Chrome AI available */ }
if (isSummarizerAPISupported()) { /* Summarizer API available */ }
if (isTranslatorAPISupported()) { /* Translator API available */ }

Acknowledgments

This package is built on Chrome Built-in AI by Google — on-device AI APIs powered by Gemini Nano, enabling zero-download inference directly in Chrome.

License

MIT