Open Bug 2071521 Opened 15 days ago Updated 17 hours ago

Support Cross-Origin Storage for reuse of WebLLM model artifacts across sites

Categories

(Core :: Storage: Quota Manager, enhancement)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: akaashrp, Unassigned)

References

Details

I am filing on behalf of the WebLLM team (https://github.com/mlc-ai/web-llm) to request evaluation and native implementation of the proposed Cross-Origin Storage API (https://wicg.github.io/cross-origin-storage/) to enable reuse of public model artifacts across sites.

WebLLM runs language models locally in the browser using WebGPU. Users need to download large LLM weights and WebAssembly modules, including artifacts such as compiled WebGPU kernels, for each model they use. With current origin-scoped browser storage, independently hosted applications using identical model artifacts generally need to download and cache their own copies. A user who has already loaded a model in one application can therefore face another large download when opening a different application that uses the same files.

We would like applications to be able to retrieve eligible, identical public model artifacts from a browser-managed shared cache by content hash. With careful consideration for privacy and security, COS could reduce redundant downloads and caches, saving users bandwidth, storage space, and time. We support pursuing this capability with protections that preserve user privacy and security under normal browser settings. Our intended shared content is public model artifacts.

WebLLM already exposes an experimental cacheBackend: "cross-origin" option through the COS browser extension, and we have previously expressed support for COS as a progressive enhancement. Native support would make this capability available without asking users to install an extension. When shared reuse is unavailable, applications should continue to work through normal downloads and local caching.

Please use this enhancement request to track consideration and implementation of COS for this use case.

References:

I strongly support this issue. I have worked as a software consultant for the Library of Congress, House of Representatives, Government Publishing Office and other agencies that publish official legislative and regulatory data. This data includes United States bills and amendments (published on Congress.gov), federal statutes (published on govinfo.gov), the United States Code (published on uscode.house.gov), federal regulations (regulations.gov). Official government documents, particularly laws and regulations, are published online by dozens of different agencies and organizations. Often the publication is on a site that is slow and not particularly user-friendly, with the expectation that private-sector entities will republish these documents in a more user-friendly form. There are many examples of this, including the longstanding govtrack.us website for bills and https://www.law.cornell.edu/, which for years was the most popular site to refer to for the United States Code.

The problem with this publishing model is obvious, in that official information is being published by unofficial sources, and this raises a question of provenance. There is also an issue off performance: try uscode.house.gov on any given day and loading of the page is slow and may crash.

The Cross-origin storage protocol would resolve many of these problems throughout the government data ecosystem. Official sites could continue to publish the data in an official, sanctioned form and location. This can then be re-used by third-party sites with the assurance that the data itself is valid and official.

I have built a number of sites myself that depends on government data. Recently I built uscode.linkedlegislation.org and statutes.linkedlegislation.org. As a simple example, 11 U.S.C. § 523(a)(2)(C)(ii)(I), a provision of the Bankruptcy Code, loads from my site almost instantly, in context and with many valuable features that do not exist on the official site (https://uscode.linkedlegislation.org/app/us/usc/t11/s523/a/2/C/ii/I). The official site's version, (https://uscode.house.gov/view.xhtml?req=(title:11%20section:523%20edition:prelim)%20OR%20(granuleid:USC-prelim-title11-section523)&f=treesort&edition=prelim&num=0&jumpTo=true) is unwieldy and takes aeons to load. And yet -- it is the only official version and the only entirely trustworthy source. With cross-origin storage, the official document could be served from a more performant site and made available to many third-party sites with enhanced functionality.

If this comment resonates, I can collect information from various government entities about how they might use the new standard to increase access to government information.

Duplicate of this bug: 2075818
You need to log in before you can comment on or make changes to this bug.