Chrome Releases Prompt API Polyfill for Unsupported Environments
Google's Chrome developer team has released an experimental polyfill that lets developers use Chrome's "Prompt API" even in environments where it isn't natively supported. By default it runs locally on Transformers.js with Gemma 3 1B, while allowing a seamless switch to cloud backends—you simply import prompt-api-polyfill.js and start prompting.
Chrome for Developers (@ChromiumDev) published a post introducing the polyfill on X on June 2, 2026. According to the official documentation (authored by Thomas Steiner) released earlier on May 14, 2026, the npm package prompt-api-polyfill can be installed via npm install and provides a spec-compliant polyfill of the browser's window.LanguageModel (the Prompt API). The default local backend uses the Gemma 3 1B model onnx-community/gemma-3-1b-it-ONNX-GQA via Transformers.js, with inference running on the high-performance webgpu or compatibility-focused wasm, and quantization options such as q4f16. By setting an API key and model name, developers can also switch to any cloud provider, and the source code is published on GitHub at GoogleChromeLabs/web-ai-demos.
The Prompt API is one of Chrome's Built-in AI features, a high-level API for interacting in natural language with the on-device LLM Gemini Nano through LanguageModel.create() and session.prompt(). While it is rolling out gradually via Origin Trials and Extensions from Chrome 138 onward, supported environments are limited to specific desktops such as Chrome/Edge on Windows, macOS, Linux and ChromeOS; Android/iOS are unsupported, and Safari/Firefox have yet to implement it. Against this backdrop of compatibility challenges, the polyfill aims to let developers use a single codebase to "leverage on-device privacy, offline use and low latency where natively supported, and continue working via the polyfill where not." Using dynamic import, it can also be designed to load the polyfill only when native support is absent.
In terms of features, it supports Structured output (except on the Transformers.js backend) and multimodal input (the OpenAI backend supports audio and images separately), and it has passed the LanguageModel suite of the Web Platform Tests. However, using the cloud forgoes the on-device advantages of privacy, offline use and model sharing, and usage costs fall to the user (Gemini API token costs can be calculated via contextUsage). Specifications such as contextWindow are backend-dependent, and local use requires downloading the model, which cannot be shared across origins. The Built-in AI overview page also mentions this polyfill as a recommended tool.
Community-built implementations already exist in this space—Transformers.js developer Nico Martin (@nicodotdev) released his own Transformers.js-based polyfill in December 2025. The new release is positioned as Google's official spec-compliant version. Reactions on X are limited so soon after launch, but @TheKryptoWiz commented that "browser AI is moving from demo land toward compatibility headaches. The web always wins by making the messy thing boring." Concrete user feedback and use cases remain scarce, and reactions from early adopters will be the focus going forward.