TLDRocket
Sign in

How to Use Transformers.js in a Chrome Extension

Hugging Face Blog

Transformers.js was integrated into a Chrome extension using Manifest V3 by centralizing model inference and agent orchestration in a background service worker while keeping UI and page logic in separate side panel and content script runtimes. The extension loads two models—Gemma-4-E2B for text generation and MiniLM-L6-v2 for embeddings—entirely in the background, with all inference cached under the extension origin rather than per-website. The architecture separates conversation state (background memory), user settings (chrome.storage.local), and retrieval data (IndexedDB), enabling responsive UI, reusable models across tabs, and clear messaging contracts between runtimes.

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads 60+ sources, removes duplicate coverage, and summarises the day in two minutes. Free, no spam, unsubscribe anytime.