Quick Thoughts

Making Firefox's AI Chatbot local-only with Lemonade

Published on in development , AI , GenAI

Firefox has a built-in AI chatbot sidebar which lets you query LLMs in a simple, efficent UI while browsing the web. The cool thing is that it supports local inference providers — meaning you can wire it up to a locally running model server and keep everything on-device. Here’s how I got it working with Lemonade SDK.

tl;dr: Start Lemonade or any local LLM service on port 8080, flip one about:config flag, and Firefox’s AI sidebar works with your local model.

The Setup

Start Lemonade on Port 8080

Firefox’s local inference integration expects the server to be on port 8080. Lemonade defaults to port 8000. So when starting the Lemonade server, make sure to bind it to that port:

lemonade-server --port 8080

If Lemonade or any other local LLM is running on any other port, Firefox won’t be able to connect to it. I wasn’t able to find a setting/config point that would enable custom URLs/ports but that’d be a nice to have.

Enable the Localhost Inference Provider in Firefox

By default, Firefox hides the localhost option in the inference provider dropdown. To make it appear, you need to flip a flag in about:config:

  1. Navigate to about:config
  2. Accept the warning if prompted
  3. Search for browser.ml.chat.hideLocalhost
  4. Set it to false

Once that’s done, go to the AI Chatbot sidebar settings and you should now see localhost as an available option in the inference provider menu. Select it, and Firefox will point its requests at your local Lemonade server on port 8080.

Hide the Model Select, Marketplace, and Logs UI

Lemonade’s web UI isn’t purpose built for a reduced width side panel so you’ll likely want to hide the model selector, marketplace, and a logs pane.

Why Bother?

Running inference locally has a few obvious advantages:

  • Privacy — your prompts never leave your machine.
  • Speed — no round-trip latency to a remote API.
  • Cost — no per-token charges once you’ve got the hardware.

Firefox’s built-in sidebar is a convenient front-end for this; you don’t need a separate browser extension or web app. Once the plumbing is in place, it just works alongside whatever you’re browsing.