Quick Start

Get OpenGrammar up and running in 5 minutes!

5-Minute Setup

Follow these steps to get OpenGrammar running quickly. You'll need an API key for the best experience.

Step 1: Get Your API Key (Optional but Recommended)

For the best grammar checking experience, you'll need an API key. We recommend Groq for its free tier:

  1. Visit Groq Console
  2. Sign up / Log in
  3. Go to API Keys → Create API Key
  4. Copy your key (starts with gsk_)
Free Tier: 100 requests/day - enough for most users!

Step 2: Build the Extension

bash
# Clone the repository
git clone https://github.com/swadhinbiswas/opengrammar.git
cd opengrammar/opengrammar/extension

# Install dependencies
bun install

# Build the extension
bun run build

This creates a dist/ folder with the built extension.

Step 3: Load in Your Browser

Chrome / Brave / Edge

  1. Open chrome://extensions/ (or brave://extensions/ / edge://extensions/)
  2. Enable Developer mode (toggle in top-right)
  3. Click Load unpacked
  4. Select the opengrammar/extension/dist folder
  5. Extension loaded! You'll see the OpenGrammar icon

Brave Browser

  1. Open brave://extensions/
  2. Enable Developer mode (top-right)
  3. Click Load unpacked
  4. Select opengrammar/extension/dist folder
  5. Extension loaded!

Microsoft Edge

  1. Open edge://extensions/
  2. Enable Developer mode (left sidebar)
  3. Click Load unpacked
  4. Select opengrammar/extension/dist folder
  5. Extension loaded!

Mozilla Firefox

️
Note: Firefox support is temporary. The extension must be reloaded each time you restart Firefox.
  1. Open about:debugging#/runtime/this-firefox
  2. Click Load Temporary Add-on
  3. Navigate to opengrammar/extension/dist
  4. Select manifest.json
  5. Extension loaded!

Step 4: Configure

  1. Click the OpenGrammar icon in your toolbar
  2. Click Settings (gear icon)
  3. Enter your API key (from Step 1)
  4. Select Provider: Groq
  5. Select Model: llama-3.1-70b-versatile
  6. Backend URL: http://localhost:8787 (for local testing)

Step 5: Start Writing!

  1. Open any text box (Gmail, Google Docs, Notion, etc.)
  2. Type something with a grammar error: me and him went to store
  3. You'll see a red underline under the error
  4. Click it to see the suggestion: he and I went to store
  5. Click Apply to fix it!
⌨️

Quick Commands

# Start local backend
cd opengrammar/opengrammar/backend
bun run dev

# Test backend
curl http://localhost:8787/health

Browser Extension Setup

Install and configure OpenGrammar on Chrome, Brave, Edge, and Firefox.

Supported Browsers

Browser Version Status
Google Chrome 88+ Fully Supported
Brave 1.20+ Fully Supported
Microsoft Edge 88+ Fully Supported
Mozilla Firefox 90+ Supported (Temporary)
Opera 74+ Supported
Vivaldi 3.6+ Supported

Installation - Chrome

Step 1: Build the Extension

bash
# Navigate to extension folder
cd opengrammar/opengrammar/extension

# Install dependencies
bun install

# Build for production
bun run build

Step 2: Load in Chrome

  1. Open Chrome
  2. Navigate to chrome://extensions/
  3. Enable Developer mode (toggle in top-right corner)
  4. Click Load unpacked
  5. Select the opengrammar/extension/dist folder
  6. Click Select
Extension loaded! You'll see the OpenGrammar icon in your toolbar.

Initial Configuration

Step 1: Open Settings

  1. Click the OpenGrammar icon in your toolbar
  2. Click the Settings (gear) icon

Step 2: Configure Backend URL

Enter your backend URL based on your deployment:

  • Local: http://localhost:8787
  • Cloudflare: https://opengrammar.yourname.workers.dev
  • Vercel: https://opengrammar-backend.vercel.app
  • Railway: https://your-app.railway.app
  • Render: https://opengrammar-backend.onrender.com
  • Docker: http://localhost:8787

Step 3: Configure AI Provider

Groq (Free)

100 requests/day free

llama-3.1-70b-versatile

OpenAI

Best quality

gpt-4o-mini

Ollama

Local & offline

qwen2.5:1.5b

User Interface

Color-Coded Underlines

Red Grammar/Spelling errors
Amber Clarity issues
Blue Style suggestions

What is OpenGrammar?

Your privacy-first, open-source writing assistant

Why OpenGrammar?

Most popular grammar assistants require you to send every keystroke to their servers and charge a hefty monthly fee for advanced features. OpenGrammar changes that.

Key Features

Zero Cost Option

The core engine runs locally in your browser, checking for passive voice, repetition, and readability without needing a server or an internet connection.

Bring Your Own AI

Just paste in your own API key (like OpenAI, Groq, or OpenRouter). You pay only fractions of a cent for what you actually use, directly to the AI provider.

Absolute Privacy

We don't have a database. We don't have user accounts. Your API key never leaves your browser. If you use the AI features, your text is sent securely to a stateless edge function, processed, and immediately forgotten.

Open Source & Self-Hosted

You can deploy the backend to Cloudflare Workers or Vercel Edge for free in one command. You own the infrastructure.

Features

  • Works Everywhere: Seamlessly integrates into text inputs, textareas, and rich text editors (like Gmail, Google Docs, Notion, and Reddit).
  • Blazing Fast: Built with modern web technologies (React, Vite, Manifest V3) for minimal performance impact.
  • Dual-Engine Architecture:
    • Rule-Based (Free & Offline): Catches passive voice, repeated words, and overly long sentences.
    • AI-Powered (Requires API Key): Advanced grammar, spelling, clarity, and stylistic suggestions.
  • Tone & Style Rewriting: Right-click context menus or shortcuts to quickly rewrite text in 8 different tones.
  • Writing Statistics: Built-in dashboard for readability scores, reading time, and vocabulary diversity.
  • Intuitive UI: Familiar red, yellow, and blue underlines with click-to-apply suggestions.

Backend Deployment

Deploy OpenGrammar backend to production with any of these platforms.

Deployment Options Comparison

Choose the platform that best fits your needs.

Platform Free Tier Setup Time Best For
Cloudflare Workers 100K req/day 5 min Production, global CDN
Vercel 100GB-hours/mo 5 min Easy deployment
Railway $5 credit 10 min Always-on, no sleep
Render 750 hours/mo 10 min Simple web service
Docker Free 15 min Self-hosting, full control

Cloudflare Workers (Recommended)

Prerequisites

  • Cloudflare account (free)
  • Node.js 18+

Step 1: Install Wrangler CLI

bash
npm install -g wrangler

Step 2: Login to Cloudflare

wrangler login

Step 3: Configure Environment

cd opengrammar/opengrammar/backend

# Create .dev.vars for local development
cat > .dev.vars << EOF
DEBUG=true
GROQ_API_KEY=your_groq_key
OPENAI_API_KEY=your_openai_key
EOF

Step 4: Deploy

# Deploy to production
wrangler deploy --env production

Step 5: Get Your URL

After deployment, you'll see:

Deployed https://opengrammar.yourname.workers.dev

Vercel

Step 1: Install Vercel CLI

npm install -g vercel

Step 2: Deploy

cd opengrammar/opengrammar/backend
vercel --prod

Docker Self-Hosting

Option 1: Docker Compose

cd opengrammar/opengrammar

# Start backend only
docker-compose up -d opengrammar-backend

# Start with Ollama (local LLM)
docker-compose --profile local-llm up -d

Docker Self-Hosting

Run OpenGrammar locally with Docker and optional local LLM support (Ollama).

Why Self-Host with Docker?
  • Complete Privacy: All data stays on your machine
  • Free: No API costs (with local LLM)
  • Offline: Works without internet
  • Full Control: Customize everything
  • No Rate Limits: Use as much as you want

Quick Start

Option 1: Backend Only (Use Cloud APIs)

cd opengrammar/opengrammar

# Create environment file
cat > .env << EOF
PORT=8787
NODE_ENV=production
GROQ_API_KEY=your_groq_key
OPENAI_API_KEY=your_openai_key
EOF

# Start backend
docker-compose up -d opengrammar-backend

# Check status
docker-compose ps

# View logs
docker-compose logs -f opengrammar-backend

Option 2: Backend + Ollama (Local LLM)

cd opengrammar/opengrammar

# Start everything (requires NVIDIA GPU)
docker-compose --profile local-llm up -d

Local LLM Setup with Ollama

Step 1: Start Ollama Container

docker-compose --profile local-llm up -d ollama

Step 2: Pull Grammar-Focused Models

# Enter Ollama container
docker exec -it opengrammar-ollama bash

# Pull models (inside container)
ollama pull qwen2.5:0.5b      # Ultra fast, 400MB
ollama pull qwen2.5:1.5b      # Balanced, 1GB
ollama pull phi4-mini:3.8b    # Great quality, 2.5GB
ollama pull llama3.2:3b       # Good all-rounder, 2GB

# Exit container
exit

Model Recommendations

Model Size RAM Speed Quality Best For
qwen2.5:0.5b 400MB 1GB ⭐⭐⭐ Fast basic checks
qwen2.5:1.5b 1GB 2GB ⭐⭐⭐⭐ Balanced
phi4-mini:3.8b 2.5GB 4GB ⭐⭐⭐⭐⭐ Best quality
llama3.2:3b 2GB 3GB ⭐⭐⭐⭐ Good balance

AI Provider Setup

Configure AI providers for advanced grammar checking and tone rewriting.

Overview

OpenGrammar supports 6 AI providers, giving you flexibility in cost, quality, and privacy.

Groq

Speed:
Quality: ⭐⭐⭐⭐
Cost: Free tier

Fast & free - 100 requests/day

OpenAI

Speed:
Quality: ⭐⭐⭐⭐⭐
Cost: $$

Best quality - GPT-4o-mini

Ollama

Speed:
Quality: ⭐⭐⭐
Cost: Free

Privacy, offline - Local LLM

Groq (Recommended - Free)

Step 1: Create Account

  1. Visit Groq Console
  2. Click Sign Up
  3. Complete registration

Step 2: Get API Key

  1. Go to API Keys in left sidebar
  2. Click Create API Key
  3. Give it a name (e.g., "OpenGrammar")
  4. Copy the key (starts with gsk_)

Step 3: Configure in Extension

  1. Click OpenGrammar icon → Settings
  2. Provider: Groq
  3. API Key: gsk_xxx (paste your key)
  4. Model: llama-3.1-70b-versatile
  5. Click Save

Using OpenGrammar

Complete user guide to all features and functionality.

Grammar Checking

Color-Coded Underlines

Red Spelling/Grammar errors
Amber Clarity issues
Blue Style suggestions

Using Grammar Checking

  1. Start Typing - Open any text input (Gmail, Google Docs, Notion, etc.)
  2. Watch for Underlines - As you type, OpenGrammar automatically checks
  3. Review Suggestions - Click any underlined text to see suggestions
  4. Apply Changes - Click Apply, Ignore, or Add to Dictionary

Tone Rewriting

Available Tones

Formal

Business, academic

Casual

Friends, chat

Professional

Work emails

Friendly

Social media

Concise

Quick messages

Detailed

Explanations

Persuasive

Sales, pitches

Neutral

General use

Tone Rewriting

Master the art of rewriting text in different tones.

Available Tones

Formal

Use for: Academic writing, business proposals, official communications

Input: hey whats up
Output: Greetings, how are you?

Casual

Use for: Social media, text messages, informal emails

Input: Greetings, how are you?
Output: Hey, what's up?

Professional

Use for: Work emails, business communication, reports

Input: hey can we meet tmrw
Output: Hello, could we schedule a meeting for tomorrow?

How to Use

Method 1: Right-Click Menu

  1. Select text you want to rewrite
  2. Right-click
  3. Choose "Rewrite with OpenGrammar"
  4. Choose tone and see preview
  5. Apply or Copy result

Method 2: Keyboard Shortcut

  1. Select text
  2. Press Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
  3. Choose tone
  4. Apply changes

Writing Statistics

Analyze and improve your writing with detailed statistics.

Available Metrics

Readability Scores

Flesch Reading Ease Score

0-100
90-100 Very Easy (5th grade)
80-89 Easy (6th grade)
70-79 Fairly Easy (7th grade)
60-69 Standard (8th-9th grade)
50-59 Fairly Difficult (10th-12th)
30-49 Difficult (College)
0-29 Very Difficult (Graduate+)

Flesch-Kincaid Grade Level

US Grades
1-6 Elementary School
7-9 Middle School
10-12 High School
13-16 College
17+ Graduate School

Time Estimates

  • Reading Time: Words ÷ 200 words per minute
  • Speaking Time: Words ÷ 150 words per minute

⌨️ Keyboard Shortcuts

All keyboard shortcuts for quick access to OpenGrammar features.

Default Shortcuts

Action Windows/Linux Mac
Rewrite Selected Text Ctrl + Shift + R Cmd + Shift + R
Toggle Extension Ctrl + Shift + E Cmd + Shift + E
Open Statistics Ctrl + Shift + S Cmd + Shift + S
Open Settings Ctrl + Shift + , Cmd + Shift + ,

Troubleshooting

Solve common OpenGrammar issues with this comprehensive guide.

Common Issues

No Grammar Highlights

Symptoms

  • Typing text with errors
  • No red/amber/blue underlines appear
  • Extension icon shows no error count

Solutions

  1. Check extension is enabled
  2. Verify site is not in disabled domains
  3. Test backend: curl http://localhost:8787/health
  4. Reload the page
  5. Check browser console (F12) for errors

Backend Connection Failed

Symptoms

  • Red status indicator in extension
  • "Cannot connect to backend" error
  • No AI suggestions

Solutions

  1. Verify Backend URL in settings
  2. Test backend: curl your-backend-url/health
  3. Check CORS configuration
  4. Restart backend service
  5. Check firewall settings

AI Not Working

Symptoms

  • Rule-based checks work
  • AI suggestions don't appear
  • "API key invalid" error

Solutions

  1. Verify API key is entered correctly
  2. Check for typos (no spaces)
  3. Ensure correct provider is selected
  4. Test API key with provider directly
  5. Check rate limits (Groq: 100/day free)

Frequently Asked Questions

Common questions about OpenGrammar.

Is OpenGrammar really free?

Yes! The core rule-based engine is completely free and works offline. For AI-powered features, you bring your own API key and pay only for what you use directly to the provider (often fractions of a cent).

How does OpenGrammar protect my privacy?

OpenGrammar has no databases, no user accounts, and no tracking. Your API key never leaves your browser. When using AI features, text is sent to a stateless edge function, processed, and immediately forgotten.

Which AI provider should I use?

For free usage, we recommend Groq (100 requests/day free). For best quality, use OpenAI GPT-4o-mini. For complete privacy, use Ollama to run models locally offline.

Can I use OpenGrammar without internet?

Yes! The rule-based engine works completely offline. For AI features, you can use Ollama to run models locally on your machine, giving you full offline capability.

Does OpenGrammar work on Google Docs?

Yes, OpenGrammar works on Google Docs and most rich text editors. Google Docs support is actively being improved for better compatibility.

API Reference

Backend API documentation for developers.

Endpoints

Health Check

GET
/health

Returns the health status of the backend service.

bash
curl http://localhost:8787/health

Response

{
  "status": "healthy",
  "timestamp": "2026-03-20T12:00:00.000Z",
  "environment": "production",
  "version": "2.0.0"
}

Analyze Text

POST
/analyze

Analyze text for grammar, spelling, clarity, and style issues.

bash
curl -X POST http://localhost:8787/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "text": "me and him went to store",
    "apiKey": "your-api-key",
    "provider": "groq",
    "model": "llama-3.1-70b-versatile"
  }'

Request Body

Field Type Required Description
text string Yes Text to analyze (max 50,000 chars)
apiKey string No AI provider API key
provider string No AI provider (groq, openai, ollama, etc.)
model string No Model to use for AI analysis

Rewrite Text

POST
/rewrite

Rewrite text in different tones.

curl -X POST http://localhost:8787/rewrite \
  -H "Content-Type: application/json" \
  -d '{
    "text": "hey whats up",
    "tone": "formal",
    "apiKey": "your-api-key"
  }'

Response

{
  "original": "hey whats up",
  "rewritten": "Greetings, how are you?",
  "tone": "formal"
}