Simple Chromium AI
A lightweight TypeScript wrapper around Chrome's built-in on-device AI APIs for prompting, translation, language detection and summarization, trading some flexibility for a simpler, type-safe interface.
Simple Chromium AI wraps Chrome's native Prompt, Translator, Language Detector and Summarizer APIs, which download and run a model directly on the user's device, behind a smaller and more type-safe interface than the underlying browser APIs provide directly. Initializing any of the wrapped APIs triggers the model download if needed and returns an object that must be used for further calls, which the project frames as making it structurally impossible to skip the readiness check that the raw APIs otherwise require manually, along with automatic handling of common initialization and session-management failures.
The prompt API accepts a system prompt, expected input and output languages, and a timeout, and supports both a plain text response and a structured JSON response constrained to a given schema; a companion function checks whether a given text will fit the model's context window before it is sent. A separate, non-throwing variant returns a result value instead of raising an exception for callers that prefer to check for failure rather than catch it. It requires Chrome 138 or newer for translation, language detection and summarization, and Chrome 148 or newer for the prompt API, and downloads roughly 4GB of on-device models on first use.