Compare AI-powered email rewrites side-by-side across multiple models and pick the best one. Supports OpenAI, Anthropic Claude, Google Gemini, and Meta Llama (via Groq).
- Multi-model comparison — Rewrite with up to 4 AI providers in parallel and compare results side-by-side
- Pick the best — Select your favorite rewrite with one click, auto-copied to clipboard
- Three tones — Professional, Friendly, or Concise
- Bring your own keys — Enter API keys in the browser (stored in sessionStorage, never saved on the server)
- Server keys fallback — Admins can configure shared keys via
.env - Web frontend option — Copy the prompt to use directly in ChatGPT, Claude, Gemini, or Meta AI
- Dark mode — Toggle or auto-detect from system preference
- Mobile responsive — Works on desktop, tablet, and phone
| Provider | Models | API Key Source |
|---|---|---|
| OpenAI | gpt-4o-mini, gpt-4o, gpt-4.1-mini, gpt-4.1 | platform.openai.com |
| Anthropic | claude-haiku-4-5, claude-sonnet-4, claude-opus-4 | console.anthropic.com |
| Google Gemini | gemini-2.0-flash, gemini-2.5-flash, gemini-2.5-pro | aistudio.google.com |
| Meta Llama | llama-3.3-70b-versatile, llama-3.1-8b-instant | console.groq.com |
- Node.js 18+ (Download)
- At least one API key from the providers above
git clone git@github.com:DRAZY/email-draft-assistant.git
cd email-draft-assistant
npm installServer-side keys are optional. Users can enter their own keys in the browser UI.
cp env-example.txt .env
# Edit .env and add any keys you want available server-sidenpm startOpen http://localhost:3000 in your browser.
- Paste your email draft into the text area
- Select a tone — Professional, Friendly, or Concise
- Check which models to compare (all four enabled by default)
- Click Rewrite Email — results appear side-by-side
- Pick the best one — click "Pick This" to highlight and copy it
If you don't want to use API keys:
- Click Copy Prompt in the web section at the bottom
- Open any AI chat (ChatGPT, Claude, Gemini, Meta AI)
- Paste the prompt and get your rewrite
- Paste the result back into the app to compare alongside API results
email-draft-assistant/
├── server.js # Express server, API routing, rate limiting
├── providers/
│ ├── index.js # Provider registry
│ ├── openai.js # OpenAI SDK integration
│ ├── anthropic.js # Anthropic SDK integration
│ ├── gemini.js # Google GenAI SDK integration
│ └── llama.js # Meta Llama via Groq (OpenAI-compatible)
├── public/
│ ├── index.html # App markup
│ ├── styles.css # Glassmorphism UI with dark mode
│ └── script.js # Frontend logic (safe DOM construction)
├── package.json
├── env-example.txt # Example environment variables
└── README.md
- API keys in browser are stored in
sessionStorage(cleared when the tab closes) - Keys sent via headers (
X-openai-Key, etc.), not in request bodies - Server never logs or stores user-provided API keys
- Static files isolated in
public/— server code is not accessible via the web - Rate limited — 10 requests per minute per IP
- Input validated — 10,000 character max, tone allowlist
- Express 5 — HTTP server and static file serving
- OpenAI SDK v6 — OpenAI and Groq (Llama) integration
- Anthropic SDK — Claude integration
- Google GenAI SDK — Gemini integration
- Vanilla JS — No frontend framework, safe DOM construction (no innerHTML)
- CSS custom properties — Design system with light/dark theme
"No API key configured" — Open the API Key Settings panel and enter a key, or add one to .env and restart the server.
"Too many requests" — Rate limit is 10 requests/minute per IP. Wait a moment.
"Failed to get response from this provider" — Check that your API key is valid and has credits/quota.
MIT