Google ships an official polyfill for the Prompt API
Chrome's developer team has released an experimental polyfill that lets developers use the browser Prompt API even where there is no native implementation. By default it uses Transformers.js with the lightweight local model Gemma 3 1B, while also allowing a switch to cloud backends; developers can get started simply by importing prompt-api-polyfill.js. The official documentation was published on May 14, 2026, and the Chrome for Developers account announced it on June 2.
The Prompt API is a proposed Web API for sending natural-language prompts directly to a language model built into the browser (Gemini Nano in Chrome's case), offered experimentally via Origin Trial or flags. Touting privacy and low latency from on-device AI, it sits alongside built-in AI features such as the Writer and Summarizer APIs. This polyfill aims to let developers write API-compatible code even on browsers and platforms without native support, smoothing the eventual migration to a native implementation. Its hybrid design, backing both local (Transformers.js) and cloud paths, is a key trait; community-made polyfills also exist, but Google's official version differs in claiming to be spec-compliant.
On specifics, the default local model is onnx-community/gemma-3-1b-it-ONNX-GQA (Gemma 3 1B), with compatible models selectable from the Hugging Face catalog. The device setting can be webgpu for performance or wasm for compatibility, with q4f16 shown as a quantization example. A config file (.env.json) can specify the API key (a real key for cloud, a dummy for local), model name, device and quantization format; when unspecified, each backend's default model is used. Adoption involves installing via npm, importing the polyfill, and using an if (!('LanguageModel' in window)) branch. No specific pricing or benchmark figures appear on the official page. The documentation was written by Thomas Steiner.
Reaction on X was limited shortly after the post, with 18 likes, about 1,537 views and one reply. The sole reply praised it as a practical polyfill that bridges the gap while spec support catches up, welcoming the Gemma 3 1B fallback for keeping client-side inference light while the cloud swap offers flexibility for heavier workloads. Separately, past discussion around the Prompt API has raised concerns about model neutrality and terms of use on venues such as Hacker News, though direct mentions of the polyfill itself remain few.