On-device Gemini Nano chatbot. Offline, private, no servers. Runs entirely in Chrome Canary / Dev using the built-in Prompt API (
window.ai).
Nano is a tiny, fast web app that proves you can have a useful AI assistant without sending data to the cloud. Everything runs locally:
- Private by design — prompts never leave your browser
- Offline first — works after the model downloads once
- Lightweight — ~5 files, no build step, no npm dependencies at runtime
- Streaming responses from Gemini Nano (on-device)
- Abort/stop generation mid-stream
- Automatic session recovery if Chrome evicts the model
- Context window management (~1,200 tokens sliding window)
- Clean chat UI with markdown (
**bold**,*italic*,code, links) - Edit & resend — double-click any user message to modify
- Typing indicator and live token speed (⚡ tok/s)
- Dark mode (follows system, manual toggle 🌓)
- Mobile-friendly auto-growing textarea
- ARIA roles for screen readers
- Temperature slider (0 – 1.5)
- Top-K slider (1 – 100)
- Custom system prompt
- Output language: English, Spanish, French, German, Japanese
- Auto-save to localStorage
- Multi-session management (create, switch, delete, rename)
- Export chat as JSON or Markdown
- Import previous conversations
- Smart quota handling — prunes oldest session automatically when storage is full
- Factory reset
-
Chrome Canary or Chrome Dev ≥ 128
-
Enable the Prompt API:
- Go to
chrome://flags/#prompt-api-for-gemini-nano - Set to Enabled
- Also enable
chrome://flags/#optimization-guide-on-device-model - Relaunch
- Go to
-
Download the model:
chrome://components→ "Optimization Guide On Device Model" → Check for update
python -m http.server 5500
# then open http://localhost:5500