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/
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 API —
tldr,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
- 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
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.
git clone https://github.com/apratico/chrome-ai-playground
cd chrome-ai-playground
# open index.html in Chrome — that's itNo build step. The page works from file:// because every API runs locally.
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
MIT