AI Grammar Checker: LanguageTool + Local LLM for Private Writing
Cloud grammar checkers store what you paste. A two-layer local setup works better: LanguageTool for deterministic rule errors, a local LLM for tone and restructuring, with every draft staying on your disk.
📜 Table of Contents
AI Grammar Checker: LanguageTool Plus a Local LLM
Online checkers must read your text to work, and their terms usually allow processing it. The alternative is not a more ethical cloud service but splitting the job in two locally.
Why two layers
| Error type | Best handled by |
|---|---|
| Agreement, collocation, punctuation, duplicates | Rule engine |
| Verbosity, tone, logical jumps | Language model |
| Terminology consistency | Rule engine with custom word lists |
| Restructuring passive or long sentences | Language model |
Rule engines never invent rules but cannot read intent; models read intent but invent justifications. Used together, false positives and misses both drop.
Layer one: LanguageTool offline
Run the desktop app, or the local server for integration:
java -jar languagetool-server.jar --port 8081
curl -s --data-urlencode "text=..." --data "language=zh-CN" \
http://127.0.0.1:8081/v2/check
Responses carry offset, length, message and replacements per match. Chinese needs the separate rule package and is weaker than English on sentence structure — expect it to catch typos and punctuation well, style poorly.
Layer two: a local model for style
ollama pull qwen2.5:7b-instruct
The prompt must constrain scope: point out sentences over 40 characters, note stiff or over-polite phrasing, flag inconsistent terminology, and explicitly forbid rewriting the whole text. Without that last line the model rewrites your voice away.
Judging whether to switch
- Is any of your text sensitive? Contracts, unpublished drafts, internal strategy — one category is enough.
- English or Chinese? English is well served by rules; Chinese leans on the model layer.
- How much noise can you take? Rules under-report, models over-report; either way a human pass remains.
FAQ
- 7B–14B open Chinese models are good at pointing out issues, weaker at whole-text rewriting — which is why the design suggests rather than rewrites.
- Add custom LanguageTool rules for industry terms instead of waiting for upstream updates.
- A quantized 7B runs on a consumer GPU or 16GB of RAM; CPU works but slowly.
Ports, flags and Chinese rule coverage change; check the official docs.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.