Skip to content

Add Firefox AI integration plan: wllama as recommended provider#44

Open
nitzanpap wants to merge 3 commits into
masterfrom
claude/firefox-ai-research-P8NEx
Open

Add Firefox AI integration plan: wllama as recommended provider#44
nitzanpap wants to merge 3 commits into
masterfrom
claude/firefox-ai-research-P8NEx

Conversation

@nitzanpap

Copy link
Copy Markdown
Owner

Research and plan for bringing AI features to Firefox, which currently
has them disabled due to WebLLM's 4.5MB tokenizer exceeding Firefox's
5MB per-file add-on store limit.

Evaluated browser.trial.ml (Firefox's built-in trial API) and wllama
(WebAssembly llama.cpp bindings). Recommends wllama because it provides
chat completions API matching our existing architecture, works on
Firefox stable (not just Nightly), and Mozilla has explicitly enabled
it for extensions (Bug 1976704).

https://claude.ai/code/session_01QwsQd35r81rW7X2PyjBYK6

Research and plan for bringing AI features to Firefox, which currently
has them disabled due to WebLLM's 4.5MB tokenizer exceeding Firefox's
5MB per-file add-on store limit.

Evaluated browser.trial.ml (Firefox's built-in trial API) and wllama
(WebAssembly llama.cpp bindings). Recommends wllama because it provides
chat completions API matching our existing architecture, works on
Firefox stable (not just Nightly), and Mozilla has explicitly enabled
it for extensions (Bug 1976704).

https://claude.ai/code/session_01QwsQd35r81rW7X2PyjBYK6
@vercel

vercel Bot commented Feb 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
auto-tab-groups-privacy-policy Ready Ready Preview, Comment Apr 9, 2026 8:40pm

Implement on-device AI features for Firefox using wllama (WebAssembly
llama.cpp bindings), replacing the previously disabled WebLLM which
exceeded Firefox's 5MB per-file add-on store limit.

Changes:
- Add WllamaProvider implementing AiProviderInterface with chat
  completions via GGUF models (Qwen2.5-3B, SmolLM2-1.7B, Phi-3.5)
- Add @wllama/wllama dependency with bundled WASM files
- Update AiService to route to correct provider based on browser
  (WebLLM/WebGPU for Chrome, wllama/WASM for Firefox)
- Add wasm-unsafe-eval CSP directive to Firefox manifest
- Add Vite plugins: stub wllama for Chrome, stub WebLLM for Firefox,
  copy WASM assets for Firefox builds
- Remove Firefox AI block from popup and sidebar UI
- Make vramRequiredMb optional in AiModelConfig (CPU-only provider)
- Auto-detect browser and set correct AI provider on startup
- Add comprehensive WllamaProvider tests (27 tests)
- Add wllama provider routing tests to AiService (5 tests)

All 663 tests pass, both browser builds succeed.

https://claude.ai/code/session_01QwsQd35r81rW7X2PyjBYK6
@Blacksuan19

Copy link
Copy Markdown

any update about this?

@nitzanpap

Copy link
Copy Markdown
Owner Author

any update about this?

Hey,

Not yet, I've been a bit busy.

Hopefully I'll find the time to work on this :)

Resolve merge conflict in tests/AiService.test.ts by keeping
master's vi.spyOn approach and adapting wllama provider routing
tests to use spies on the actual wllamaProvider singleton.

https://claude.ai/code/session_01QwsQd35r81rW7X2PyjBYK6
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.

3 participants