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.
Continue reading
The rest of this article is for AI News Blitz readers. Choose an option below to keep reading.