Local-first AI assistant for Chrome pages. Browserllama lets you ask questions about the current tab using:
- Ollama running on your machine
- MLX server (
mlx_lm.server) running on your machine - Chrome built-in AI (when supported by your Chrome build)
Use the public setup + fallback docs page:
This page includes setup guides, troubleshooting, and FAQ links with section anchors.
- Prompt against the current page context.
- Provider switch between Ollama, MLX, and Chrome built-in AI.
- Model selection for Ollama and MLX providers.
- Compact popup workflow with prompt/response history.
- Fallback docs link in the popup header.
Current extension code is organized by feature boundaries and naming conventions.
- Providers end with
-provider.js. - Services end with
-service.js. - Prompt steering and injection checks stay centralized in
src/lib/browserllama.js.
src/ - extension source root
├── background.js - thin service-worker entry that wires background services
├── background/ - background service modules
│ ├── storage-service.js - reads synced extension preferences
│ ├── ollama-service.js - Ollama HTTP calls and response normalization
│ ├── mlx-service.js - MLX OpenAI-compatible HTTP calls and response normalization
│ ├── icon-status-service.js - action icon/title status updates
│ ├── tab-context-service.js - active-tab tracking and text extraction
│ └── message-router-service.js - runtime message action routing
├── lib/
│ ├── browserllama.js - shared prompt building, guardrails, injection checks, response cleaning
│ └── ollama.js - deprecated compatibility alias to browserllama shared helpers
└── ui/
└── popup/ - popup UI entry and modules
├── popup.html - popup markup entry
├── popup.css - popup styles
├── main.js - popup bootstrap and event wiring
├── dom.js - required DOM node resolution
├── state.js - mutable popup state shape
├── components/
│ ├── compose-view.js - compose and control rendering helpers
│ ├── response-view.js - response/prompt rendering helpers
│ └── status-view.js - provider status rendering helpers
├── logic/
│ ├── prompt-logic.js - prompt lifecycle orchestration
│ └── provider-logic.js - provider readiness orchestration
├── providers/
│ ├── chrome-built-in-provider.js - Chrome built-in generation API integration
│ ├── mlx-provider.js - MLX generation/model API integration
│ └── ollama-provider.js - Ollama generation/model API integration
└── services/
├── page-context-service.js - active-page capture helpers
└── popup-storage-service.js - popup storage read/write helpers
tests/ - automated test suites
├── unit/
│ ├── ollama.test.mjs - Ollama/shared helper behavior unit tests
│ ├── mlx.test.mjs - MLX default endpoint unit test
│ └── background-mlx-service.test.mjs - background MLX fallback behavior unit tests
├── e2e/ - Playwright extension flow tests
│ ├── popup-basic.spec.js - popup smoke test
│ ├── provider-ollama.spec.js - Ollama provider and fallback flows
│ ├── provider-chrome-built-in.spec.js - Chrome built-in provider flows
│ └── provider-mlx.spec.js - MLX provider flows
└── shared/
├── fixtures/
│ └── lorem.html - e2e fixture page content
└── e2e/
└── extension-context.js - shared Playwright MV3 extension launch helpers
git clone https://github.com/vmandic/browserllama.git
cd browserllama
pnpm install- Open
chrome://extensions. - Enable Developer mode.
- Click Load unpacked.
- Select the
src/folder.
- Install Ollama from ollama.com.
- Start the server:
ollama serve- Pull at least one model:
ollama pull deepseek-r1:8b- Open Browserllama popup and keep provider on Ollama.
- Install MLX runtime:
brew install pipx
pipx ensurepath
pipx install mlx-lm- Start an MLX server:
mlx_lm.server --model mlx-community/Qwen2.5-7B-Instruct-4bit- Open Browserllama popup and select provider MLX (OpenAI-compatible).
- Keep endpoint as default
http://localhost:8080/v1unless you changed MLX host/port.
- Use a compatible Chrome build and account setup.
- Enable required AI-related flags in
chrome://flags. - Relaunch Chrome.
- In popup provider dropdown, select Chrome built-in AI.
If the provider is unavailable, see the docs hub troubleshooting section: https://vmandic.github.io/browserllama/#troubleshooting-chrome-ai
Browserllama defaults to:
- Ollama:
http://localhost:11434 - MLX:
http://localhost:8080/v1
If you use ollama serve and need to allow extension origins, set environment vars (example):
export OLLAMA_ALLOW_ORIGINS="chrome-extension://<your-extension-id>"
export OLLAMA_ORIGINS="chrome-extension://*"Reference discussion: ollama/ollama#6489
pnpm testInstall Chromium for Playwright (first run only):
pnpm exec playwright install chromiumPre-flight checks:
- Start Ollama locally and confirm it responds at
http://localhost:11434. - Confirm MLX (
mlx_lm.server) is running and responding at the configured endpoint. - Verify required Chrome flags for MV3/e2e are enabled for your test profile.
Run e2e (headed):
pnpm run e2eRun e2e (headless):
HEADLESS=1 pnpm run e2eFor this project, Playwright e2e tests are reliable in headed mode (pnpm run e2e), and that is the recommended way to run them.
HEADLESS=1 can be unstable with MV3 extension startup (service worker/extension load timing) and may fail even when headed runs pass.
Backlog specs live under .llm/backlog/ and feature work items under .llm/backlog/feats/.
MIT. See LICENSE.
