Wo soll die KI rechnen?

KI-Modus für die ganze App

Ein Moduswechsel beendet laufende KI-Aufgaben und beginnt neue Chats. Die Auswahl bleibt auf diesem Gerät gespeichert.

1. App und Artikel speichern

Seiten, Schriften, Skripte und KI-Laufzeitdateien ; Modelldateien kommen separat dazu.

Bereits als PWA installiert? Öffne die App mit Internetverbindung und lade sie neu. Speichere danach hier das aktuelle Offline-Paket. Die KI-Modelle lädst du separat unter 2 und 3 herunter, bevor du offline gehst.

Noch nicht geprüft

2. Embeddings

Xenova/multilingual-e5-small

Mehrsprachige Vektoren auf der CPU, auch ohne WebGPU; Download über hundert MB.

Noch nicht geprüft

3. Chat und Textaufgaben

Qwen3-0.6B-q4f16_1-MLC

Experimentelles kleines Sprachmodell; mehrere hundert MB Download und zusätzlicher GPU-Speicher nötig.

Noch nicht geprüft

Wie gut funktioniert es?

Stelle dieselbe Frage in beiden Modi oder vergleiche dieselben Texte in der Embeddings-Kachel. Prüfe Fundstellen, sachliche Richtigkeit und Antwortzeit. Die kleinen lokalen Modelle können deutlich schwächer sein als Gemini; die lokale Textsuche liefert den Chat-Kontext.

Nach der Vorbereitung: App schließen, Verbindung trennen und neu öffnen. Prüfe neue Eingaben. Browser-Caches können gelöscht werden; „Nur gespeicherte Dateien prüfen“ lädt keine fehlenden Dateien nach.

Letzte echte Berechnungen · nur diese Sitzung
Aufgabe / ModellModusGesamtzeitErste Ausgabe
Noch keine Berechnung gemessen.

Inklusive Laden bei kaltem Modell. Netzwerk- und Modellzeiten sind geräteabhängig; die erste Ausgabe ist bei Gemini der erste empfangene Stream-Block. Keine Qualitätsbewertung aus der Geschwindigkeit ableiten.

KI & Agents
WebLLMPWAWebGPUTransformers.jsPrompt API

Browser LLMs in PWAs – Field Test, Storage Silos and the 400 MB Hurdle

A field test of local LLMs in web apps: Why 400 MB downloads, isolated browser storage and weak answers often make small models impractical.

LKLukas Kopischke
Last updated on

You are engineering a Progressive Web App and want to deliver on the promise of offline on-device AI: zero cloud latency, zero server bills, and absolute privacy on client devices. But the initial field test delivers a harsh reality check: a 480-megabyte download for even the smallest coherent model, thermal throttling, and answers that crumble on basic reasoning tasks. Why is there such a massive gulf between WebGPU demo hype and real-world production viability?

Local language models in PWAs fail in practice due to three architectural and physical barriers: the web’s Same-Origin isolation that duplicates model weights per origin, the 400-megabyte minimum threshold for multilingual utility, and the total lack of standardized native browser APIs on mobile devices. While vector embeddings at 25 megabytes work reliably offline, generative in-browser chat models remain an expensive storage and user-experience antipattern for mobile PWAs.

Merksatz

Browser sandboxing isolates model weights per origin: Without a shared platform API, every installed PWA downloads identical gigabyte-sized files. For mobile web apps, in-browser LLM inference is currently a storage and retention trap.

Why Does the Vision Collide with the Web's Storage Architecture?

The foundational security model of the modern web is the . Every web application runs inside an isolated sandbox. While essential for credential security, this sandbox turns into an architectural disaster when handling multi-hundred-megabyte weight files:

When a user installs three separate , each offering an on-device chatbot or offline assistant, no app can read or share the model cache of its neighbor.

Origin Isolation: The Multi-App Storage Trap

On native operating systems, applications share common shared libraries or query a single operating-system neural engine (such as Apple Intelligence or Windows Copilot Runtime). The web platform lacks this shared tier entirely:

  1. Origin A (notes-app.dev) downloads a quantized Qwen model (483 MB) into its private .
  2. Origin B (lukiluki.me) downloads the exact same 483 MB binary weights into its own isolated origin cache.
  3. Origin C (task-tracker.app) downloads the weights a third time.

Across three installed PWAs, identical tensor matrices consume nearly 1.5 gigabytes of flash storage on the client device. On smartphones where users constantly juggle storage limits for photos, operating-system updates, and videos, this uncoordinated footprint triggers immediate frustration and uninstalls.

Cache Eviction on Mobile Engines

The storage dilemma is aggravated by aggressive eviction heuristics enforced by mobile browser engines:

  • WebKit (iOS Safari): Safari subjects client storage to strict lifetime rules. If a web app is not launched frequently or added to the home screen, Intelligent Tracking Prevention (ITP) and storage pressure algorithms evict IndexedDB and CacheStorage. When the user opens the PWA mid-flight, the model directory is gone.
  • Chromium (Android): When free disk space on a device runs low, Chromium purges non-persisted origins using a least-recently-used (LRU) algorithm. A 500 MB download offers zero durability guarantee.

While navigator.storage.persist() exists to request durable storage, browsers grant this privilege conservatively based on internal heuristics and site engagement scores.

The Model Bottleneck: Why 400 Megabytes Is the Multilingual Floor

Why not simply deploy an ultra-compact 50 MB language model? The answer lies in the fundamental relationship between parameter scale, token density, and reasoning depth. For generative chat in the browser, developers are effectively restricted to three model families:

The Three In-Browser Model Families

Model & BuildDownload Size (Quantized)VRAM / RAM FootprintMultilingual QualityViability for Mobile PWAs
SmolLM2-360M (q4f16_1)204 MB376 MBPoor (English-only bias, rapid syntactic collapse)Toy demo only; unusable in production
Qwen2.5-0.5B (q4f16_1)483 MB711 MB – 1.1 GBCritical (rudimentary grammar, heavy context drift)Bare minimum compromise, but 480 MB download
Llama-3.2-1B (q4f16_1)695 MB879 MB – 1.4 GBUsable (coherent dialogues, reliable syntax)Exceeds mobile cellular data budgets
Phi-4-mini / Qwen-2B1.1 – 2.3 GB2.2 – 4.5 GBGood (robust reasoning, structured output)Completely unviable for mainstream web distribution

The Quality Cliff Below One Billion Parameters

Models under 500 million parameters (such as SmolLM2-135M or 360M) simply lack the dimensionality to represent nuanced world models, multilingual grammar, and strict instruction adherence:

  1. Language Distortion: The vast majority of sub-billion pre-training corpora is English. On non-English prompts, token density drops, resulting in hallucinated tokens, mid-sentence language switching, or broken agreement.
  2. System Prompt Collapse: When passing a , sub-500M models regularly ignore system instructions to quote strictly from source material and invent plausible falsehoods instead.
  3. WebGPU Buffer Allocations: WebGPU enforces strict limits via maxBufferSize and maxStorageBufferBindingSize. On integrated mobile GPUs, allocating intermediate attention tensors frequently fails with requested maxBufferSize exceeds limit.

To give users coherent multilingual output, developers are forced to use the 1-billion-parameter tier – requiring a 700 MB initial payload.

Where Does the Chrome Prompt API Stand and Why Is a Standard Missing?

Wouldn’t the logical architectural solution be a browser-supplied foundation model accessible via standard JavaScript? This is the vision behind Google's and Gemini Nano.

However, the reality in 2026 demonstrates why web architects cannot build mobile PWA stacks on this API:

Google's 22-Gigabyte Hardware Gate

The Prompt API (window.LanguageModel) shipped in Chrome 148 for desktop operating systems. But its hardware gates exclude the mobile PWA market completely:

  • Zero Support on Android and iOS: Neither Chrome on Android nor Chrome on iOS supports the built-in foundation-model APIs.
  • The 22 GB Storage Gate: Chrome downloads Gemini Nano only if the volume containing the user profile has at least 22 GB of free space. If free space drops below 10 GB later, the model is automatically evicted.
  • Hardware Prerequisites: Strictly more than 4 GB of VRAM for the GPU pipeline, or at least 16 GB of RAM and 4 CPU cores for CPU inference.
  • No Worker Execution: The APIs are not exposed inside Dedicated Web Workers or Service Workers.

Why Apple and Mozilla Oppose the Specification

The Prompt API is not a W3C Recommendation track standard; it is a Draft Community Group Report produced by the Web Machine Learning Community Group. Both major competing engine vendors have officially rejected the proposal:

  • Mozilla (Firefox): Holds an official stance of "Negative Standards Position". The reasoning: shipping browser-specific models destroys web interoperability. Prompts tuned for Gemini Nano produce erratic, divergent behavior when executed against a different model like Phi-4-mini in another browser.
  • Apple (WebKit/Safari): Holds an official stance of "Oppose Position", citing critical privacy concerns, lack of portability, and vendor lock-in that would force websites into browser-sniffing branches.

Without consensus between Google, Apple, and Mozilla, there is no shared platform layer for web AI. Any site attempting on-device chat today must bundle and ship hundreds of megabytes of raw weights itself.

Field Test in Looki Looki Me: Benchmarks and Code

During the Progressive Web App migration of lukiluki.me, we ran an empirical test: What happens when an app built for speed and lean resource consumption integrates a real in-browser chat model?

Empirical Metrics: Application Code vs. Model Weights

The production build figures highlight the architectural imbalance:

  • Complete lukiluki.me offline manifest: 74.6 MB (49 pre-rendered routes, 232 static assets, typography, and the full compiled ONNX WebAssembly SIMD runtime).
  • Adding the smallest multilingual chat model (Qwen3-0.6B-q4f16_1): +483 MB additional download.
  • Ratio: The AI model accounts for 86.6% of the entire PWA’s installed footprint.
  • Cold start to first token: On a flagship smartphone, decompressing tensor weights and compiling WebGPU pipelines requires 9 to 16 seconds. During pipeline compilation, UI frame rates in adjacent tabs drop noticeably.

Resilient Download and Quota Pre-Flight in TypeScript

If your project requires on-device models for specialized enterprise offline workflows, you must never precache weights during the Service Worker install phase. Instead, execute an explicit pre-flight quota check and stream weights in cancelable chunks:

TYPESCRIPT
1/**
2 * Production-ready quota verification and chunked weight streaming.
3 * Prevents out-of-quota aborts and supports clean cancellation via AbortSignal.
4 */
5interface ModelDownloadOptions {
6 modelUrl: string;
7 expectedBytes: number;
8 signal: AbortSignal;
9 onProgress: (ratio: number) => void;
10}
11
12export async function prepareLocalModelStorage({
13 modelUrl,
14 expectedBytes,
15 signal,
16 onProgress,
17}: ModelDownloadOptions): Promise<ArrayBuffer> {
18 // 1. Pre-flight storage quota before saturating the network
19 if (navigator.storage && navigator.storage.estimate) {
20 const { quota, usage } = await navigator.storage.estimate();
21 const availableBytes = (quota ?? 0) - (usage ?? 0);
22
23 // Maintain a 200 MB safety buffer for background browser operation
24 if (availableBytes < expectedBytes + 200 * 1024 * 1024) {
25 throw new DOMException(
26 `Insufficient storage: ${Math.round(availableBytes / (1024 * 1024))} MB free, ` +
27 `required: ${Math.round(expectedBytes / (1024 * 1024))} MB.`,
28 "QuotaExceededError"
29 );
30 }
31 }
32
33 // 2. Fetch with explicit stream reading and cancellation support
34 const response = await fetch(modelUrl, {
35 signal,
36 headers: { Accept: "application/octet-stream" },
37 });
38
39 if (!response.ok || !response.body) {
40 throw new Error(`Model weight transfer failed with status ${response.status}`);
41 }
42
43 const contentLength = Number(response.headers.get("Content-Length")) || expectedBytes;
44 const reader = response.body.getReader();
45 const chunks: Uint8Array[] = [];
46 let receivedBytes = 0;
47
48 while (true) {
49 const { done, value } = await reader.read();
50 if (done) break;
51
52 chunks.push(value);
53 receivedBytes += value.length;
54 onProgress(Math.min(1, receivedBytes / contentLength));
55 }
56
57 // 3. Assemble binary tensor buffer in memory
58 const result = new Uint8Array(receivedBytes);
59 let offset = 0;
60 for (const chunk of chunks) {
61 result.set(chunk, offset);
62 offset += chunk.length;
63 }
64
65 return result.buffer;
66}

How Does Your Current Browser Behave?

Use the following auditor to inspect your device's actual WebGPU adapter, query available storage quota, and calculate the compounding storage duplication across multiple installed PWAs.

Interaktiver PlaygroundInteraktiv
Live Auditor & Storage Calculator

PWA Storage Footprint under Same-Origin Isolation

Minimal multilingual baseline. Understands basic German, but drifts and hallucinates on complex prompts.

3 PWAs
1 PWA (Single app)4 PWAs8 PWAs (Multi-app ecosystem)
Silo Effect: No Cross-Origin Model Cache
Download per PWA

498 MB

15 MB code + 483 MB model
Total storage (3 PWAs)

1494 MB

1.46 GB on disk
Redundant duplication

+966 MB

67% redundant weights
Because the web security architecture (Same-Origin Policy) forbids cross-origin CacheStorage access, every single installed PWA redownloads identical tensor weights.
Live Browser Environment
WebGPU Acceleration

Mandatory for viable token inference

Available Browser Quota

Restricted by storage API

Prompt API (window.ai)

Unavailable (Mobile & Safari standard)

Engineering Reality: Until the Prompt API is standardized across mobile engines, every web application must ship its own weights. On mobile devices with flash constraints, unpersisted caches are evicted swiftly.

The auditor illustrates the core dilemma: even if your current browser supports WebGPU and allocates generous quota, storage consumption scales linearly with every additional web app. There is zero cross-origin deduplication.

The Pragmatic Architecture: What Actually Works Offline

Does this invalidate the concept of offline AI for the web? Not at all. It simply proves that generative chat models are the wrong architectural fit for mobile PWAs today.

The production architecture powering lukiluki.me separates semantic filtering from generative text synthesis:

Client-Side Embeddings & Hybrid RAG
  • Ultra-lightweight vector models: Models like Xenova/multilingual-e5-small require only 25 to 35 MB and run smoothly via WebAssembly SIMD on almost any mobile CPU.
  • Pre-computed build vectors: Public articles are vectorized at build time. The PWA caches only a compact vector index (under 2 MB for hundreds of articles).
  • Offline semantic discovery: Users can search offline in flight mode ("slow page load" instantly matches web performance articles).
  • Hybrid cloud generation: Only when the user explicitly requests an authored synthesis and an internet connection is active does the app query a fast server-side LLM.
Full In-Browser Chat LLMs in PWAs
  • Forcing 500 MB downloads on visitors: Displaying a multi-minute loading spinner before a user can submit their first prompt.
  • Ignoring Same-Origin duplication: Expecting users to tolerate multiple PWAs quietly consuming gigabytes of flash storage.
  • Shipping sub-500M hallucination engines: Deploying 360M models that hallucinate and fail basic reasoning tests.
  • Draining mobile batteries: Forcing heavy WebGPU matrix multiplication on mobile chipsets, causing immediate thermal throttling.

To understand how lightweight vector math operates without multi-hundred-megabyte baggage, explore our deep dive into Embeddings – Finding Similar Content.

Architecture Checklist for PWA Engineers

Before deciding to integrate an in-browser language model into your web application or PWA, verify these five criteria:

  • Storage budget audited: Does the model payload combined with application assets remain strictly within a defensible cache budget of under 50 MB for mobile users?
  • Target languages verified: Has the model been evaluated against real-world non-English prompts to ensure it does not switch languages or suffer syntactic breakdown?
  • Eviction resiliency confirmed: Does the core application continue to function gracefully when Safari or Android evicts the model cache after several days of inactivity?
  • Vector embeddings evaluated: Can the functional requirement (e.g. search, document triage, classification) be solved using a 25 MB embedding pipeline instead of a 500 MB generative model?
  • Data transparency provided: Is the exact download size, memory requirement, and battery impact disclosed to the user before initiating any transfer?

Sources and Next Steps

The following primary sources document technical storage boundaries and the active browser standardization debates:

Review the architectural runtime foundation in Offline AI in Web Apps, explore Embeddings – Finding Similar Content for resource-friendly vector search, and read WebNN – Machine Learning in the Browser for upcoming hardware-accelerated NPU standards.