explaingit

thatbeautifuldream/ondevice-ai

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5Setup · moderate

TLDR

A private, fully on-device chat app powered by Chrome's built-in Gemini Nano model, with playgrounds for structured output, translation, and writing tools.

Mindmap

mindmap
  root((On-device AI Chat))
    What it does
      Private on-device chat
      Structured JSON output
      Offline translation
    Tech stack
      Astro
      React
      Tailwind CSS
      Gemini Nano
    Use cases
      Chat with no server
      Constrain model output
      Translate offline
    Audience
      Developers
      Privacy focused users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Chat privately with an AI model that runs entirely on-device, with nothing sent to a server.

USE CASE 2

Force a Chrome built-in AI model to return valid JSON using a custom schema.

USE CASE 3

Translate text offline in the browser using Chrome's built-in Translator API.

What is it built with?

AstroReactTypeScriptTailwind CSSGemini Nano

How does it compare?

thatbeautifuldream/ondevice-ai0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Chrome 137+ with built-in AI flags enabled and Gemini Nano downloaded via chrome://components.

In plain English

This project is a private chat application that runs entirely on your own computer through Chrome's built in Gemini Nano model, rather than sending your messages to a server. Because the AI model itself ships inside the browser, every question and answer stays on your device, with no API key to set up and no external service involved. Beyond the basic chat page, the project includes a few extra playgrounds that show off different parts of Chrome's built in AI features. One page demonstrates structured output, where you can give the model a JSON schema and it is forced to reply with valid, parseable data instead of free form text, and it lets you compare that constrained answer side by side with a normal unconstrained one. Another page is a translation tool that automatically detects what language you are typing in and then streams a translation, downloading each language pair only when needed so it can keep working offline afterward. A third page brings together three writing assistance tools built into Chrome: one that drafts new text from a prompt with tone and length options, one that rewrites existing text to be more formal, more casual, shorter, or longer, and one that proofreads for grammar and spelling and shows each correction inline. The chat page itself keeps track of conversation history in the browser's local storage, streams responses formatted as Markdown, and automatically summarizes older parts of a long conversation on device when the context window starts filling up. To use this project you need a fairly recent version of Chrome with a few experimental flags turned on so the Gemini Nano model can download and run locally, and the app walks you through enabling them if it detects the model is missing. It is built with Astro, React, and Tailwind CSS. This is a small demo project aimed at developers curious about on device AI in the browser, currently with no stars.

Copy-paste prompts

Prompt 1
Explain how the on-device context compaction works in this chat app's agent.ts file.
Prompt 2
Help me add a new writing tool page to this project using Chrome's built-in AI APIs.
Prompt 3
Walk me through enabling the Chrome flags needed to run Gemini Nano locally for this app.
Prompt 4
Show me how the structured output playground validates JSON against a schema.

Frequently asked questions

What is ondevice-ai?

A private, fully on-device chat app powered by Chrome's built-in Gemini Nano model, with playgrounds for structured output, translation, and writing tools.

What language is ondevice-ai written in?

Mainly TypeScript. The stack also includes Astro, React, TypeScript.

How hard is ondevice-ai to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is ondevice-ai for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.