Skip to content

Latest commit

 

History

195 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thoth — Local Grammar Checker & AI Writing Assistant (Chrome Extension)

Open-source Grammarly alternative: grammar and spell checking, tone rewrite, paraphrasing, and AI text generation — local-first on your Mac or Windows PC. Works in Gmail, Google Docs, LinkedIn, Slack, and most text fields on the web.

Privacy-first writing assistant — drafts stay on your machine by default (Ollama + LanguageTool). Optional Groq/OpenAI for faster rewrite and generate.

Chrome extension (public): Install Thoth from the Chrome Web Store

Chrome Extension Python Local First Ollama Grammarly Alternative

Find this repo: search GitHub for grammar checker chrome extension, local grammarly alternative, ollama writing assistant, text humanizer open source, or offline AI writing tool.


Download & install

Follow the guide for your computer. Each guide is written as simple numbered steps.

Platform Full step-by-step guide Download
Chrome extension Chrome Web Store Add to Chrome
Windows Install on Windows Start Thoth.bat tray app or Releases
macOS Install on Mac Thoth.app

Mac users: download Thoth-macOS.zip from the latest release, drag Thoth.app into Applications, and open it once. No Terminal required.


Windows (step by step)

Step 1: Download these apps

Step 2: Download Thoth

  1. Open https://github.com/Eshan-khan1/Thoth
  2. Click Code, then Download ZIP
  3. Unzip the folder (example: C:\Users\YourName\Thoth)

Step 3: Paste this into Command Prompt

Open Command Prompt, go into the Thoth folder, then paste:

scripts\install.bat

If needed (Ollama is open):

scripts\setup_models.bat

Step 4: Start the server

Double-click Start Thoth.bat, or paste:

start_server.bat

Keep that window open.

Step 5: Install the Chrome extension

Recommended: Install from the Chrome Web Store (click Add to Chrome).

Or double-click Start Thoth.bat for the tray app (like Mac Thoth.app), then install the extension from the link above.

Or load unpacked (developers):

  1. Go to chrome://extensions
  2. Turn on Developer mode
  3. Click Load unpacked
  4. Select the extension folder

More detail: docs/INSTALL_WINDOWS.md


Mac (step by step)

Step 1: Download these apps

Step 2: Download Thoth.app

Open the latest GitHub release and download the Mac app:

Download Thoth for Mac

  1. Download Thoth-macOS.zip from Assets
  2. Unzip the file

Step 3: Install the app (no Terminal)

  1. Drag Thoth.app into Applications
  2. Open it once (if macOS blocks it: right-click → Open → Open)
  3. Look for the Thoth diamond icon in the menu bar (top-right) — there is no Dock icon
  4. It quietly starts the server and sets itself to reopen after login or restart

Step 4: Install the Chrome extension

Install Thoth from the Chrome Web Store (click Add to Chrome). Keep Thoth.app running so the local server stays online.

Developers only — load unpacked:

  1. In Thoth, use Connect Chrome Extension… (or follow the one-time setup sheet)
  2. Open Chrome → chrome://extensions
  3. Turn on Developer mode
  4. Click Load unpacked
  5. Select the folder the app opened/copied (usually
    ~/Library/Application Support/Thoth/ChromeExtension)

More detail: docs/INSTALL_MAC.md


Check that the server is running

Open http://127.0.0.1:8000/health
You should see "ok": true.

Try it

  • Type in any text box to see underlines on mistakes
  • Select text to use Rewrite or Generate
  • Click the Thoth toolbar icon for Settings

What is Thoth?

Thoth is an open-source Grammarly alternative — a local grammar checker and AI writing assistant with a Chrome extension for real-time spell check, punctuation fixes, tone rewrite, paraphrasing, and content generation.

It runs a small API server on your computer (localhost) and pairs it with a browser extension that works on Gmail, Google Docs, search bars, and most editable fields on the web.

Feature What it does
Grammar & spelling Pink underlines on mistakes; click to accept a fix
Auto-fix Optionally correct all issues as you type
Rewrite Select text → change tone (friendly, formal, simpler, etc.)
Generate Turn short notes into emails, messages, or essays
Humanize Make AI-generated text sound more natural (local Ollama pipeline)

Everything can run fully offline with local Ollama models. Cloud AI (Groq / OpenAI) is optional for faster rewrite and generate.


Why Thoth? (open-source Grammarly alternative)

Thoth Typical cloud writing tools
Where text is processed Your machine (127.0.0.1) Vendor cloud servers
Offline grammar check Yes (LanguageTool + Java) Usually requires internet
Local LLM rewrite Ollama (thoth-writing) Subscription cloud models
Chrome extension Gmail, Docs, LinkedIn, Slack, etc. Similar coverage
Account required No Often yes
Open source Yes — inspect and fork Closed source

Good fit if you search for: grammar checker chrome extension, spell checker browser extension, local AI writing assistant, Ollama grammar tool, privacy-first Grammarly alternative, text humanizer offline, or open-source paraphrasing tool.


How it works

Thoth is two parts that talk over localhost:

┌─────────────────────────────────────────────────────────────────┐
│  Chrome (any website)                                             │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │  extension/content.js                                      │  │
│  │  • Mirrors text fields, draws grammar underlines           │  │
│  │  • Rewrite / Generate UI on text selection               │  │
│  └───────────────────────────┬───────────────────────────────┘  │
│                              │ chrome.runtime.sendMessage        │
│  ┌───────────────────────────▼───────────────────────────────┐  │
│  │  extension/background.js  →  fetch(127.0.0.1:8000)        │  │
│  └───────────────────────────────────────────────────────────┘  │
└──────────────────────────────┬──────────────────────────────────┘
                               │ HTTP (localhost only)
┌──────────────────────────────▼──────────────────────────────────┐
│  server.py  (FastAPI + uvicorn, port 8000)                        │
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ LanguageTool│  │ Ollama       │  │ writing_agent.py        │ │
│  │ (Java)      │  │ :11434       │  │ prompts + hard filters  │ │
│  │ grammar     │  │ local LLMs   │  │ rewrite / generate      │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
│  Optional: cloud_ai.py → Groq / OpenAI (keys from extension only) │
└───────────────────────────────────────────────────────────────────┘

Grammar flow

  1. You type in a text field (Gmail compose, Docs, etc.).
  2. content.js debounces input and sends text to POST /grammar.
  3. The server runs LanguageTool (and optionally a local grammar model).
  4. Matches return as offsets; the extension draws underlines on mistakes.
  5. Click an underline → suggestion card → accept replaces the text in-place.

Rewrite flow

  1. Select text → floating ↗ button → pick Rewrite.
  2. Enter a tone (e.g. “more formal”) → POST /rewrite.
  3. writing_agent.py builds a prompt, calls Ollama or cloud AI, applies hard filters (no extra greetings, same length, etc.).
  4. Selection is replaced with the rewritten text.

Generate flow

  1. Select seed text → Generate icon
  2. Chooses format (email / essay), optional one-time note
  3. Settings from popup: length, tone, complexity, profile (auto-applied every time)
  4. POST /generate expands the note using saved defaults from the extension popup

Full Generate rules: docs/GENERATE_RULES.md


Project structure

Thoth/
├── extension/                 # Chrome extension (Manifest V3)
├── macos/                     # Thoth.app launcher + menu-bar helpers
├── server.py                  # FastAPI app — all HTTP endpoints
├── writing_agent.py           # Rewrite/Generate prompts & filters
├── thoth.py                   # Standalone humanization library
├── ui.json                    # Active Uber-dark UI tokens
├── Start Thoth.command/.bat   # Double-click launchers
├── scripts/
│   ├── build_macos_app.sh     # Build dist/Thoth.app
│   ├── setup_models.sh/.bat   # Register thoth-grammar / thoth-writing
│   └── create_release.sh      # Publish Mac app to GitHub Releases
└── docs/
    ├── INSTALL_MAC.md
    ├── INSTALL_WINDOWS.md
    └── PROJECT.md

API reference (local server)

Base URL: http://127.0.0.1:8000

Method Path Purpose
GET /health Server + dependency check
POST /grammar Full grammar check
POST /grammar/quick Fast path for typing
POST /humanize Legacy humanize endpoint
POST /rewrite Tone/style rewrite
POST /generate Expand notes to email/essay/etc.

Optional header when auth is enabled:

Authorization: Bearer <THOTH_API_TOKEN>

Rewrite/Generate bodies may include optional cloud AI:

{
  "text": "...",
  "tone": "friendly",
  "ai": { "provider": "groq", "apiKey": "..." }
}

Keys are sent from the extension to your local server only; they are not stored server-side.


Configuration

Extension settings (popup)

  • Check writing while I type — grammar on/off
  • Fix all mistakes automatically — auto-apply corrections
  • Rewrite in search bars — enable rewrite on search inputs
  • AI & API keys — Local Ollama, Groq, or OpenAI
  • Generate — profile fields, length, tone, complexity, permanent note

Server environment variables

Variable Effect
THOTH_REQUIRE_AUTH=1 Require Bearer token on all requests
THOTH_API_TOKEN Token value (auto-generated if unset)
THOTH_DEBUG=1 Verbose server errors

Example:

THOTH_REQUIRE_AUTH=1 ./start_server.sh

Paste the printed token into the extension → Settings → AI & API keys → Local server token.


Development

Run in dev mode

./scripts/install.sh          # once
./start_server.sh             # terminal 1
# Chrome extension: https://chromewebstore.google.com/detail/begfbbjincimcjcimpfpkoilbhjphppn?utm_source=item-share-cb
# Developers: load unpacked from extension/
# Optional: ./scripts/dev_chrome.sh  (macOS test profile)

Publish a GitHub Release (Mac app only)

./scripts/create_release.sh

Run benchmarks

With the server running:

# benchmark_tests.json defines rewrite/generate cases
python scripts/benchmark_rewrite.py   # if present

Fine-tuning (advanced)

  • scripts/finetune_grammar_lora.py — MLX LoRA for grammar model
  • prepare_data.py — training pair preparation
  • requirements-finetune.txt — extra training deps

Models

Thoth expects these Ollama models (created by scripts/setup_models.sh):

Model Used for
thoth-grammar Optional grammar assistance
thoth-writing Rewrite & Generate (local)

If local Modelfiles exist under models/, setup uses them. Otherwise setup pulls small Qwen2.5 bases from Ollama Hub.

Model weights are not committed to git (too large). Each user downloads via Ollama.


Design system

Active UI tokens are in ui.json (Uber-inspired dark theme used by the extension and Mac settings).

  • Near-black surfaces (#000 / #141414) with white primary actions
  • Green / gold accents for status and highlights
  • Legacy Claude-style palette kept in Thoth ui theme.json for reference

Privacy

See docs/PRIVACY.md and docs/POLICY.md. In Thoth.app: Settings → Privacy & Policy.

  • Default: text is processed on your machine via localhost.
  • Grammar uses LanguageTool locally (Java).
  • Rewrite/Generate use local Ollama unless you opt into Groq/OpenAI in settings.
  • API keys and profile fields live in Chrome local storage on your device and are only sent to 127.0.0.1:8000.
  • No Thoth account, telemetry, or central server.
  • The popup asks for consent before the extension reads text in page fields.

Troubleshooting

Problem Solution
Server offline in popup Run start_server.bat (Windows) or ./start_server.sh (Mac); check /health
No underlines Enable “Check writing while I type”; ensure Java is installed
Rewrite/Generate error Start Ollama; run scripts\setup_models.bat or ./scripts/setup_models.sh
thoth-grammar missing ollama list then setup_models script for your OS
Extension not updating chrome://extensions → Reload
Port 8000 in use Starter scripts free the port; or close the other process
Windows: python not found Reinstall Python with Add to PATH, open a new terminal

Contributing

Contributions are welcome.

  1. Fork the repo
  2. Create a branch (git checkout -b feature/my-change)
  3. Commit with a clear message
  4. Open a Pull Request on GitHub

Ideas for contributors:

  • More language support
  • Additional Generate formats
  • Benchmark coverage

License

Open source — use, study, and modify on your own machine. See the repository for license details.


Links

Related topics on GitHub

grammar-checker · chrome-extension · writing-assistant · grammarly-alternative · ollama · local-ai · humanizer · spell-checker · language-tool · fastapi · open-source · privacy · ai-writing · text-rewriter · offline-ai

About

Open-source Grammarly alternative: local grammar checker, spell check, AI rewrite & text humanizer Chrome extension. Runs offline with Ollama — privacy-first writing assistant for Mac & Windows.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages