Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

chrome-ai-playground

A single-page playground for Chrome's built-in AI APIs — the on-device Gemini Nano model that now ships inside Chrome.

No API keys. No network round-trips. No per-token billing. The model lives in the browser.

Live demo: https://apratico.github.io/chrome-ai-playground/

What's inside

One HTML file. Zero dependencies. Try every Chrome AI surface in one place:

  • Prompt API (LanguageModel) — chat with system prompt, temperature, top-K, streaming, token usage
  • Summarizer APItldr, key-points, teaser, headline, markdown or plain
  • Translator API — fully offline, source/target language pair
  • Writer / Rewriter — drafting and tone shifts (formal, neutral, casual, more-formal)
  • Language Detector — confidence-scored locale detection
  • API Probe — quick availability check for every surface

Requirements

  • Chrome 138+ (Dev / Canary recommended for newest flags)
  • ~22 GB free disk for Gemini Nano model download
  • 4 GB+ GPU VRAM or recent integrated GPU
  • Enable the API flags below

Enable the APIs

Open each flag URL in Chrome and set it to Enabled:

chrome://flags/#prompt-api-for-gemini-nano
chrome://flags/#summarization-api-for-gemini-nano
chrome://flags/#translation-api
chrome://flags/#writer-api-for-gemini-nano
chrome://flags/#rewriter-api-for-gemini-nano
chrome://flags/#language-detection-api
chrome://flags/#optimization-guide-on-device-model

Restart Chrome. The first call to LanguageModel.create() triggers the Gemini Nano download (a few GB, one-time).

Verify the model is installed at chrome://components → "Optimization Guide On Device Model" → check version.

Run locally

git clone https://github.com/apratico/chrome-ai-playground
cd chrome-ai-playground
# open index.html in Chrome — that's it

No build step. The page works from file:// because every API runs locally.

API surface reference

Each section in index.html is a self-contained example of the relevant API. Read the source — it's the smallest working example for every endpoint.

Official docs: https://developer.chrome.com/docs/ai/built-in

License

MIT

About

Single-page playground for Chrome built-in AI APIs (Gemini Nano on-device): Prompt, Summarizer, Translator, Writer/Rewriter, Language Detector.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages