From code comments:
// TODO(service-worker): add a Service Worker that (1) serves model
// weights and JS library bundles from an app-owned Cache Storage
// bucket for bulletproof offline reuse and to stop transformers.js
// cache eviction from triggering multi-GB re-downloads, and (2)
// acts as a network firewall - allow-list the HuggingFace CDN,
// jsDelivr, and (only when the user has enabled Ollama) the local
// Ollama endpoint; block everything else. The block rule is the
// PHI-safety story: even a supply-chain-compromised third-party
// script can't exfiltrate transcript / CSV values because the SW
// will refuse the outbound fetch. Requires the app to be served
// over http(s) - Service Workers do not register on file://
// URLs, so the deployment story would need to move off "open the
// HTML directly" for at least the first install.
// Confirmed working dtype split for this architecture (per-submodule, not a single string):
// fp32 embed_tokens avoids a known crash on GPUs without the shader-f16 feature (mobile/older GPUs)
From code comments:
// TODO(service-worker): add a Service Worker that (1) serves model
// weights and JS library bundles from an app-owned Cache Storage
// bucket for bulletproof offline reuse and to stop transformers.js
// cache eviction from triggering multi-GB re-downloads, and (2)
// acts as a network firewall - allow-list the HuggingFace CDN,
// jsDelivr, and (only when the user has enabled Ollama) the local
// Ollama endpoint; block everything else. The block rule is the
// PHI-safety story: even a supply-chain-compromised third-party
// script can't exfiltrate transcript / CSV values because the SW
// will refuse the outbound fetch. Requires the app to be served
// over http(s) - Service Workers do not register on file://
// URLs, so the deployment story would need to move off "open the
// HTML directly" for at least the first install.
// Confirmed working dtype split for this architecture (per-submodule, not a single string):
// fp32 embed_tokens avoids a known crash on GPUs without the shader-f16 feature (mobile/older GPUs)