Experimenting with the proposed Cross-Origin Storage API in Transformers.js

AI-generated summary of reporting by Huggingface Blog. Read the original for the full story.

Why it matters

Browser-cached AI model files are re-downloaded per origin today; an experimental cross-origin shared cache in Transformers.js 4.2.0 could eliminate hundreds of megabytes of duplicate downloads.

Read this as

A Google Chrome engineer writing on Hugging Face's blog explains an early browser proposal called Cross-Origin Storage. Today, when two different websites use the same AI model, like the Whisper speech-recognition model, each site makes your browser download the same large files again, wasting storage and time. The proposal lets browsers share these files across websites, identifying them by a cryptographic fingerprint instead of by site. No browser supports it natively yet; developers can try it via an extension or an experimental flag in Transformers.js.

Web apps running AI models in the browser currently re-download identical files per site, the article's example wastes 177 MB of duplicate Whisper weights, because caches are isolated by origin for security. Google Chrome's Thomas Steiner proposes Cross-Origin Storage, keyed by SHA-256 hash, with Transformers.js 4.2.0 already piloting it behind an opt-in flag. The API is not standardized or natively implemented, and privacy mitigations for rare files are still undecided. Cost savings for bandwidth and storage are real but deferred until browsers ship it.

The proposal adds navigator.crossOriginStorage, modeled on OPFS's getFileHandle(), keyed by SHA-256 rather than URL. Writes verify the hash, giving automatic integrity checks; origins controls visibility ('*' global, list-restricted, or same-site) and can be upgraded but never downgraded to prevent narrowing attacks. Timing-attack-driven cache partitioning (Network Isolation Key) is the problem; mitigations like availability gating for rare hashes are unresolved. Transformers.js PR #1549 enables it via env.experimental_useCrossOriginStorage, resolving hashes from Xet pointer files.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Transformers.js Cross-Origin Storage API Chrome ONNX Runtime Hugging Face Hub jsDelivr CDN OPFS

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

datasette-charts 0.5a0

Datasette Charts 0.5a0 adds calendar heatmaps, box plots and active-over-time charts, enabling richer data visualisation directly in the browser without extra libraries.