lemon cha is a lightweight Chrome and Firefox extension that opens a dedicated AI chat tab for two kinds of model providers:
- Custom LLM APIs that use an OpenAI Chat Completions-compatible format.
- Local Ollama models, with
http://127.0.0.1:11434/api/chatas the default endpoint. - Requests are sent from the browser extension background context.
- Local Ollama requests include a direct-connect fallback that normalizes the local origin path.
- The interface supports streaming output, stop generation, Markdown rendering, copyable code blocks, multi-session history, folders, rename/delete actions, Markdown export, and JSON import/export.
- Open Chrome and visit
chrome://extensions/. - Enable Developer mode.
- Click "Load unpacked".
- Select
dist/lemon-chaafter runningnpm run build:chrome. - Click the extension action to open lemon cha in a dedicated browser tab.
- Run
npm run build:firefox. - Open Firefox and visit
about:debugging#/runtime/this-firefox. - Click "Load Temporary Add-on...".
- Select
dist/lemon-cha-firefox/manifest.json. - Click the extension action to open lemon cha in a dedicated browser tab.
lemon cha is a lightweight Manifest V3 extension without a frontend bundler. The repository uses npm scripts for validation and packaging:
npm run lint
npm run typecheck
npm run buildnpm run lint: validates required extension files, Chrome and Firefox Manifest V3 setup, HTML asset references, and JavaScript syntax.npm run typecheck: runs a lightweight syntax-oriented validation pass for this vanilla JavaScript project.npm run build: copies runtime files intodist/lemon-chafor Chrome anddist/lemon-cha-firefoxfor Firefox.npm run build:chrome: builds only the Chrome package.npm run build:firefox: builds only the Firefox package.
Firefox uses the same runtime code with a generated Firefox manifest. The generated manifest swaps Chrome's background.service_worker for Firefox's background.scripts and adds Gecko extension settings required for Firefox distribution.
Choose the custom API workflow and configure:
- Endpoint, for example
https://api.openai.com/v1/chat/completions - Model name, for example
gpt-4o-mini - API key, if the provider requires one
- API format: OpenAI Chat Completions or Ollama
/api/chat - Thinking mode behavior
- Interface language, answer language, and default translation target language
If the API format is OpenAI-compatible and the endpoint only contains the domain or /v1, lemon cha completes it to /v1/chat/completions. Provider-specific paths can still be entered manually.
Built-in provider presets include DeepSeek, OpenAI, Qwen DashScope, Kimi, SiliconFlow, OpenRouter, Groq, and local Ollama.
- Create new conversations.
- Switch between saved chats from the sidebar.
- Organize chats inside folders.
- Rename or delete conversations.
- Export the current chat as Markdown.
- Import or export JSON records containing conversations, settings, and custom prompt presets.
- Clear history or restore factory defaults from the data settings area.
Each assistant or user message can expose compact actions such as:
- Copy
- Regenerate
- Continue from here
- Delete
The connection checker supports:
- Ollama
/api/tagsfor model discovery and reachability checks - OpenAI-compatible lightweight test requests for endpoint, model, and API key verification
- Streaming model responses
- Stop generation while preserving partial output
- Dynamic waiting state for slower local models
- Generation timing and approximate token metrics
- Automatic first-turn conversation title generation
- Markdown rendering for paragraphs, lists, emphasis, code blocks, and tables
- Copy button inside code blocks
- Persistent bottom composer for long conversations
- Collapsible sidebar for a cleaner reading surface
The composer includes reusable prompt presets:
- Summarization
- Translation and polishing
- Code review
- Troubleshooting
- Writing revision
- Task planning
Built-in templates are localized for Simplified Chinese, Traditional Chinese, English, Japanese, Korean, French, Spanish, and German.
When a preset is applied:
- If the composer is empty, lemon cha replaces the input and selects the first
{placeholder}. - If the composer already contains text, lemon cha asks before replacing it.
- Translation presets can resolve the default translation target language selected in Settings.
Start Ollama and install a local model:
ollama serve
ollama pull llama3.1Default lemon cha settings:
- Endpoint:
http://127.0.0.1:11434/api/chat - Model:
llama3.1
Connection strategy:
localhostis normalized to127.0.0.1./api/tagsis used for model listing and connectivity tests./api/chatis used for multi-turn chat and streaming.- Local Ollama requests are handled from the extension background context.
If Ollama rejects the browser extension origin, restart Ollama with extension-origin allowance.
macOS Ollama app:
launchctl setenv OLLAMA_ORIGINS "chrome-extension://*,moz-extension://*"Quit the Ollama menu bar app completely, then open it again.
macOS/Linux command line:
OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*" ollama serveTemporary broad debug option:
OLLAMA_ORIGINS="*" ollama serveWindows PowerShell:
$env:OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*,http://localhost:*,http://127.0.0.1:*"
ollama servemanifest.json: source Chrome Manifest V3 configurationscripts/build-extension.js: Chrome and Firefox extension package builderbackground.js: background networking and provider callschat.html: dedicated chat pagestyles.css: visual system and responsive layoutpopup.js: state, settings, conversations, and UI flowschrome-store/: Chrome Web Store listing, privacy, review, and release materials