https://github.com/vectorleap-pulse/grammar-ai
Grammar AI is a lightweight FREE desktop application built with Python for grammar correction and text polishing. It provides a simple local UI for entering text, sending it to an AI service, and reviewing polished output.
https://github.com/vectorleap-pulse/grammar-ai
ai ai-writing-assistant ai-writing-assistant-free english fix grammar grammar-checker grammar-checker-and-plagiarism-check grammarly-alternative grammerly language llm python spelling tkinter typo ui
Last synced: about 15 hours ago
JSON representation
Grammar AI is a lightweight FREE desktop application built with Python for grammar correction and text polishing. It provides a simple local UI for entering text, sending it to an AI service, and reviewing polished output.
- Host: GitHub
- URL: https://github.com/vectorleap-pulse/grammar-ai
- Owner: vectorleap-pulse
- Created: 2026-05-03T04:54:54.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-25T13:50:11.000Z (11 days ago)
- Last Synced: 2026-06-25T15:33:03.855Z (11 days ago)
- Topics: ai, ai-writing-assistant, ai-writing-assistant-free, english, fix, grammar, grammar-checker, grammar-checker-and-plagiarism-check, grammarly-alternative, grammerly, language, llm, python, spelling, tkinter, typo, ui
- Language: Python
- Homepage: https://github.com/vectorleap-pulse/grammar-ai/releases/latest
- Size: 9.13 MB
- Stars: 8
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Grammar AI
**A lightweight, FREE-forever desktop grammar corrector and text polisher.**
[](https://github.com/vectorleap-pulse/grammar-ai/releases/latest)
[](https://github.com/vectorleap-pulse/grammar-ai/releases/latest)
[](https://www.python.org/)
---
## Overview
**Grammar AI** is a lightweight desktop application built with Python for grammar correction and text polishing. Tired of premium grammar tools like Grammarly and LanguageTool? Enjoy **FREE FOREVER** grammar correction with the free tier of the [Groq](https://groq.com/) API key.
It has two core modes, each with its own tab and global hotkey: **Polish**, for rewriting text in a chosen tone and goal, and **Translate**, for quick, direct translation.

_Select text anywhere, press the hotkey, pick a polished version - done._
> 🎬 Prefer video? See [`media/how-to-use.mp4`](media/how-to-use.mp4) for the full walkthrough.
---
## ✍️ Polish
Rewrite text into one or more **tones**, each generated for several writing **goals** (inform, persuade, clarify, and more) at once.
1. In Settings, choose which **goals** to generate and optionally set a **context** to tailor output to your domain (see [Configuration](#configuration)).
2. Enter or paste text on the **Polish** tab, or select text anywhere and double-tap **Shift** to send it there directly. You can also use the **Trigger** button in the app.
3. Select a **tone** and review the generated polished versions.
4. Click **Use** next to the version you want, to paste it back where you copied it from.
Every polished result is saved to **History** for later reference.

_The Polish tab, with several goals generated at once for the chosen tone._
### Cross-lingual polishing
Choose a **Polish language** in Settings and Grammar AI translates any source language into it before polishing.

_Pick from a curated list of languages - or type any language the model understands._
- The model translates any source language into the selected Polish language before polishing.
- If you choose **English**, the app polishes text using American English conventions.
- If you choose another language, the app writes polished text naturally in that language.
---
## 🌐 Translate
Need a straight translation without a tone/goal rewrite? The **Translate** tab is a dedicated mode for that, separate from Polish.
1. Enter or paste text on the **Translate** tab, or select text anywhere and double-tap **Ctrl** to send it there directly.
2. Pick a **target language** from the dropdown - your choice is remembered independently of the Polish tab's language.
3. Click **Translate** (or use the hotkey) to get the translated text, then **Copy** it to your clipboard.
Translations are not written to the History log; only Polish results are saved there.

_The Translate tab, for quick, direct translation._
The **Translate language** can also be set in advance from Settings:

_Choose a default target language for the Translate tab._
---
## Localized Interface
The whole interface is localized, so you can use Grammar AI in your own language.

_Switch the interface language independently of the Polish and Translate languages._

Español

Français
---
## Configuration
Grammar AI supports any LLM provider that is OpenAI-compatible, including OpenAI, Anthropic, Google, and more.
### Example Configuration ([Groq](https://groq.com/) Free Tier)
- **Base URL**: `https://api.groq.com/openai/v1/`
- **Model**: `openai/gpt-oss-120b`
- **API Key**: `YOUR_GROQ_API_KEY`
### Example Configuration (OpenAI)
- **Base URL**: `https://api.openai.com/v1`
- **Model**: `gpt-5.4-mini`
- **API Key**: `YOUR_OPENAI_API_KEY`
To configure:
1. Launch the application.
2. Open Settings and enter your API configuration.
---
## Installation
### Prebuilt Release (Windows)
**[⬇️ Download latest release →](https://github.com/vectorleap-pulse/grammar-ai/releases/latest)**
All releases: [github.com/vectorleap-pulse/grammar-ai/releases](https://github.com/vectorleap-pulse/grammar-ai/releases)
### From Source
1. Clone the repository.
2. Install dependencies: `uv sync`
3. Build the UI (needs [Node.js](https://nodejs.org/) + `pnpm`): `cd frontend && pnpm install && pnpm build`
4. Run: `uv run python main.py`
### Building from Source
To build a standalone executable:
1. Install dependencies including build tools: `uv sync --extra dev`
2. Run the build script (it builds the UI via `pnpm` first, then packages with PyInstaller):
- Release build: `python build.py` or `build.bat`
- Debug build (with console): `python build.py --debug` or `build.bat debug`
3. The executable will be created in the `build/grammar-ai/` folder.
---
## Tech Stack
- Python 3.12
- `pywebview` (embedded WebView2) hosting a React + TypeScript UI, built with Vite, Tailwind v4,
and shadcn components
- `openai`-compatible AI integration
- `uiautomation` for reading/writing text in the focused window (Polish; no clipboard, no simulated keystrokes)
- `pystray` and `Pillow` for system tray
- `loguru` for logging
- `pydantic` for schema validation
- `ruff` and `mypy` for linting
---
## How capture works
**Polish** reads the focused control's text directly via Windows UI Automation and, on "Use",
writes the result back the same way - it never reads, writes, or clears your system clipboard.
This means Polish capture works in most modern apps and browsers, but not everywhere: an app has
to expose its text field to Windows' accessibility APIs for this to work. Custom-rendered editors
(for example, VS Code's code-editing pane) may not be supported.
**Translate** captures via your system clipboard and simulated Ctrl+C (selecting all text first
if nothing is selected), restoring your previous clipboard contents afterward. This trades a
brief, restored clipboard touch for broader compatibility across apps that don't expose text via
accessibility APIs. Clipboard is otherwise only touched when you explicitly click a "Copy" button.
---
## Storage
- Local SQLite database and log files are stored in `~/.grammar-ai/`.
- History entries include original text, polished text, tone, and timestamp.
- API keys are stored locally in the app database.
---
## Project Files
- `main.py` - application entry point
- `app/` - core application modules (`app/ui/webview/web/` is the built UI - generated by
`frontend/`, not committed)
- `frontend/` - React + TypeScript UI source (Vite/Tailwind/shadcn)
- `pyproject.toml` - project metadata, dependencies, and linting configuration
- `build.py` - builds the UI, then packages with PyInstaller
---
## Support
If you found this helpful, please ⭐ **star this repository** and 👤 **follow me**!