Home / Companies / HuggingFace / Blog / Post Details
Content Deep Dive

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

Blog post from HuggingFace

Post Details
Company
Date Published
Author
Thomas Steiner
Word Count
2,915
Company Posts That Month
90
Language
-
Hacker News Points
-
Summary

Transformers.js, a tool for integrating transformer models into web applications, faces challenges with cache redundancy when deploying AI models across different origins. This issue arises because browsers isolate caches by origin to enhance privacy and security, resulting in duplicate downloads and storage for identical models and WebAssembly (Wasm) runtime resources. The proposed Cross-Origin Storage (COS) API aims to address this by allowing apps to share resources across origins using cryptographic hashes rather than URLs, thus preventing redundant downloads. COS enables developers to specify which origins can access stored resources, maintaining privacy controls while optimizing resource sharing. Although not yet natively implemented in browsers, developers can experiment with the COS API through a browser extension. This approach has been piloted in Transformers.js, showing significant reductions in duplicate data transfers, and the Chrome team is considering native implementation of the API.

Trends Found in this Post

No tracked trend matches for this post yet.