Skip to content

feat(llm): upgrade web-llm to 0.2.86 and default to Gemma 4 E2B - #30

Merged
arminpasalic merged 2 commits into
mainfrom
feat/web-llm-0.2.86-gemma4
Oct 24, 2026
Merged

arminpasalic merged 2 commits into
mainfrom
feat/web-llm-0.2.86-gemma4

Conversation

@arminpasalic

@arminpasalic arminpasalic commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Upgrades web-llm 0.2.84 → 0.2.86 and makes Gemma 4 E2B (gemma-4-E2B-it-q4f16_1-MLC) the default model for new installs.

Upgrade

  • Both CDN imports (llm-rag.js, llm-worker.js) now pin 0.2.86. A new test keeps the two in step.
  • All 22 catalog models exist in 0.2.86 with unchanged weights, VRAM and overrides. Only the WASM libraries were rebuilt (v0_2_86), so I re-measured every downloadBytes (each +0.7–1.0 MB). The formula is now documented in model-constraints.js and reproduces the previous audit byte for byte.
  • 0.2.86 also brings upstream fixes for cancelled streams, interrupted conversations and model locks.

Gemma 4 E2B as the default

  • First entry in "Recommended", recommended RAG tier, the only isDefault model.
  • 2.84 GB download, ~3.39 GB VRAM at 4K (Llama 3.2 3B: 1.82 GB, ~2.26 GB). The prebuilt library is compiled for a 4K context, which matches the app's default context_window_size.
  • The chat template supports a system prompt. f16 only (q4f32_1 skipped).
  • It's the first catalog model loaded through web-llm's new model_manifest path.

Existing users keep their model (new installs only)

  • No STORAGE_VERSION bump: saved configs on Llama 3.2 3B are not migrated.
  • Edge case: an install that downloaded models but never saved a setting has no stored model_id, so it would have switched silently. getConfig() now handles the first read without a stored config. If vectoria_models_ready or vectoria_models_cached is set, it pins Llama 3.2 3B. It always saves the result, so a new install can't later look like an old one.
  • Older chained migrations (e.g. v17 Ministral users) land on the current default, as before.

Verification

  • npm run check: 233 unit tests (new tests cover the default and the new-installs-only behaviour), 16 wasm tests, build, stamp check
  • npm audit (root and mcp-server): 0 vulnerabilities
  • Served app: the picker shows Gemma 4 E2B first under Recommended, and DEFAULT_CONFIG and the catalog agree on the default
  • Browser test (WebGPU): Gemma 4 download progress, answer quality, cache detection after reload, and a regression load of Llama 3.2 3B. Blocked so far because the test Chrome has GPU acceleration disabled.

Draft until the browser test is done.

- Pin web-llm 0.2.86 in llm-rag.js and llm-worker.js
- Re-audit downloadBytes for all 22 models against the rebuilt v0_2_86
  WASM libraries (weights and VRAM are unchanged)
- Add gemma-4-E2B-it-q4f16_1-MLC as a direct, limited-RAG-tier option
  with its 4K prebuilt context; document the size formula
- Test that the main thread and worker pin the same web-llm build
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vectoria Ready Ready Preview Oct 24, 2026 1:28pm UTC

- Gemma 4 E2B moves to the recommended group and RAG tier as the only
  isDefault model; Llama 3.2 3B stays in the recommended group
- New installs persist their config on first read. An install that
  already downloaded models but never saved a setting is pinned to the
  previous default (Llama 3.2 3B), and saved configs are not migrated,
  so no existing user gets a surprise 2.84 GB download
@arminpasalic arminpasalic changed the title feat(llm): upgrade web-llm to 0.2.86 and add Gemma 4 E2B feat(llm): upgrade web-llm to 0.2.86 and default to Gemma 4 E2B Oct 24, 2026
@arminpasalic
arminpasalic marked this pull request as ready for review October 24, 2026 13:33
@arminpasalic
arminpasalic merged commit 9ac64a6 into main Oct 24, 2026
7 checks passed
@arminpasalic
arminpasalic deleted the feat/web-llm-0.2.86-gemma4 branch October 24, 2026 14:48

This branch was successfully deployed

1 active deployment
Preview — d8516e8b Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant