BYO AI Grammar is a Thunderbird add-on that provides inline grammar suggestions while composing email. You bring your own LLM, as long as it follows the OpenAI API. It leaves Thunderbird's native spelling and personal dictionary behavior in place, and sends the current paragraph while typing, or explicitly selected paragraphs when you click Check. In settings, you configure the delay, the model location, and the prompt.
It has been tested with small models. THey can get lost easily so the prompt is carefully tuned.
This is an alpha release. I have tested it with Together.ai on smaller open-weights instruction models, and the current default is google/gemma-3n-E4B-it because it benchmarks very well on the current grammar test sets while staying cheap. It would be surprising if this model cost more than a few cents per day.
I have also tested it with LM Studio and the same model ("google/gemma-3-4b").
I use Ubuntu and that's the only environment I test on.
https://addons.thunderbird.net/en-US/thunderbird/addon/byo-ai-grammar/
Inline grammar highlights in the compose editor:
Suggestion popup with replacement and quick actions:
This project is in early development. It currently targets Thunderbird 128. It has only been used on Ubuntu, on stable Thunderbird, with Together.ai as the model provider, and with only a couple of models. The notes about building on other operating systems are best guesses.
To provide free, basic English grammar checking as typo/mistake finder. I am a native English speaker so my grammatical errors are the result of poor typing and editing, not lack of English knowledge, so finding errors is more important than knowing how to fix them. The tool will report the improvement suggestions of the LLM. I have only tested it on very small LLMs, which provide good but not native-speaker-level grammar support.
This add-on aims to report grammar corrections, not general copy editing.
In particular, by my choice, it does not treat these as grammar corrections on their own:
- sentence-start capitalization only
- sentence-final punctuation only
- smart-quote substitutions only
- semantic rewrites that replace nouns or add descriptive words without a local grammar need
The extension prefers small, localised grammatical fixes such as agreement, articles, missing or repeated words, and contextual homophone, contraction, or function-word corrections.
Context-dependent word-form mistakes such as its vs it's stay in scope here because they need grammatical interpretation, not just a dictionary lookup.
- Grammar-only suggestions layered on top of Thunderbird compose windows.
- It doesn't try to replace Thunderbird spelling; it focuses on grammar plus context-dependent word-form errors such as
itsvsit's. - Current-paragraph-only checking while you type
- User-configured OpenAI-compatible server URL, model, and saved API key
- Custom prompt support with a bounded prompt budget, but the system prompt is pretty good.
- Grammar allowlist support for approved phrases and project-specific exceptions (currently limited to 50 entries)
- Corrected-text plus local diffing so inline suggestions do not depend on model-provided offsets
- Request lifecycle guards that ignore stale responses while you keep typing
- Compose-action
Checkmode for queueing selected paragraphs through the normal per-paragraph grammar suggestion flow - Optional debug logging for Browser Console and Debug Add-ons troubleshooting
- Per-message pause control
- Undo has worked the few times I've tried it so far, but I wouldn't bet on it.
- It can ignore pasted content, but you can select the text and click the icon, or make a trivial change.
Use this while actively developing:
- Open Thunderbird.
- Open the Add-ons Manager.
- Open
Debug Add-ons. - Click
Load Temporary Add-on. - Select
dist/manifest.json.
This install disappears when Thunderbird restarts.
Use this when you want a normal locally installed extension file:
- Run
npm run package. - Open Thunderbird.
- Open the Add-ons Manager.
- Open the gear menu.
- Choose
Install Add-on From File.... - Select the generated
.xpifile.
The .xpi is the correct file for a local install. Do not choose manifest.json for this path.
After installation, open the add-on settings and configure:
- OpenAI-compatible server URL
- saved API key
- model string
- debug logging toggle
- custom grammar prompt
- grammar allowlist entries
Recommended Together.ai defaults:
- Server URL:
https://api.together.xyz/v1 - Model:
google/gemma-3n-E4B-it
Use the provider's OpenAI-compatible base URL, your model string, and your API key.
For Together.ai, the tested configuration is:
- Server URL:
https://api.together.xyz/v1 - Model:
google/gemma-3n-E4B-it
BYO AI Grammar has been tested with LM Studio using its local OpenAI-compatible server.
Tested LM Studio configuration:
- Server URL:
http://127.0.0.1:1234/v1 - Model:
google/gemma-3-4b - API key: leave blank
In LM Studio Server Settings:
Require Authenticationshould beOff(this is the default)Enable CORSshould beOn(this is not the default)
If Enable CORS is off, Thunderbird will fail before the real request is sent because the browser preflight request is blocked.
The add-on stores the API key in Thunderbird extension local storage inside your Thunderbird profile.
Important limitations:
- This is convenient for local use.
- It is not protected by an OS keychain or hardware-backed secret store.
- Anyone with access to your local Thunderbird profile may be able to recover it.
If you need stronger secrets handling, this project would need a different architecture such as a local proxy or native helper.
Only the paragraph under your cursor is sent while typing, unless you manually select paragraphs and click Check.
The extension does not use analytics or telemetry.
If debug logging is enabled, inspect the Browser Console or the add-on entry in Debug Add-ons to review request ids, stale-response drops, and service errors. The default is off.
This repository includes a manual GitHub Actions workflow that builds the .xpi on demand.
To use it:
- Thunderbird 128 or newer
- Git
- Node.js 24 or newer
- npm 11 or newer
Check your versions:
node --version
npm --versionLinux and macOS:
git clone https://github.com/timrichardson/byo_ai_grammar.git
cd byo_ai_grammarWindows PowerShell:
git clone https://github.com/timrichardson/byo_ai_grammar.git
Set-Location byo_ai_grammarAll platforms:
npm installStandard build:
npm run buildType-check the code:
npm run typecheckCreate an installable .xpi package:
npm run packageThat produces a file like:
byo_ai_grammar-<version>.xpi
- Open the repository on GitHub.
- Open the
Actionstab. - Choose
Build Release XPI. - Click
Run workflow. - Optionally provide a tag name if you want the
.xpiattached to a GitHub Release.
The workflow always uploads the .xpi as a workflow artifact. If you choose release upload, it also attaches the same file to the selected GitHub Release.
npm run watchrebuilds while you editnpm run buildwrites runtime files intodist/npm run testruns focused unit tests for prompt, validation, diffing, and request helpersnpm run replay:request -- --base-url https://api.together.xyz/v1 --model google/gemma-3n-E4B-it --active-text "These updates is ready to send."replays a grammar request outside Thunderbird usingBYO_AI_GRAMMAR_API_KEY,TOGETHER_API_KEY, orOPENAI_API_KEYand logs request timingnpm run benchmark:models -- --base-url https://api.together.xyz/v1 --runs 2benchmarks a default set of smaller Together chat models for contract reliability and latency using the same grammar prompt and the same supported env varsnpm run packagecreates a Thunderbird-installable.xpinpm run release:prepare -- --version 0.4.31verifies a clean git tree, bumps the release version, commits it, builds a new.xpi, keeps only the newest three.xpifiles, and creates a source.ziparchive for add-on submissionpackage.jsonandpublic/manifest.jsonshould stay aligned on release versions
See CONTRIBUTING.md for setup, coding standards, and contribution workflow.
This project uses Semantic Versioning (MAJOR.MINOR.PATCH).
0.y.zis used during early developmentMAJORincrements for incompatible public changesMINORincrements for new backwards-compatible featuresPATCHincrements for backwards-compatible fixes
This project is licensed under the Mozilla Public License 2.0. See LICENSE.
- Thunderbird 128 or newer
- Git
- Node.js 24 or newer
- npm 11 or newer
Check your versions:
node --version
npm --versionLinux and macOS:
git clone https://github.com/timrichardson/byo_ai_grammar.git
cd byo_ai_grammarWindows PowerShell:
git clone https://github.com/timrichardson/byo_ai_grammar.git
Set-Location byo_ai_grammarAll platforms:
npm installStandard build:
npm run buildType-check the code:
npm run typecheckCreate an installable .xpi package:
npm run packageThat produces a file like:
byo_ai_grammar-<version>.xpi

