Skip to content

Repository files navigation

Grammar Fixer

A background Windows utility that fixes your grammar as you write, in any application, powered by the MEPX Cloud engines.

  • Press Insert — it starts recording what you type.
  • Keep typing normally.
  • Press Insert again — your text is replaced in place, with the grammar, spelling and punctuation corrected.

Takes about 2 seconds. Works in Notepad, Word, browsers, chat apps, IDEs — anything that accepts normal typing and Ctrl+C/Ctrl+V.

Run it

Double-click:

dist\GrammarFixer.exe

It has no window. It sits in the system tray (blue check-mark icon) and shows a small pill in the bottom-right corner telling you what it's doing:

Pill Meaning
● Recording capturing your typing — press Insert when done
Fixing grammar… waiting on the engine
✓ Grammar fixed done, text replaced
✓ Already correct nothing needed changing
red message something went wrong, your text was left alone

Right-click the tray icon for Settings…, a quick style switch, the log, or Quit. Double-clicking the icon opens Settings too.

To start it with Windows:

powershell -ExecutionPolicy Bypass -File install_autostart.ps1

(-Remove undoes it.)

Output styles

Every style fixes grammar, spelling and punctuation. The style decides how far beyond that it goes. Pick one in Settings, or switch instantly from the tray.

Style What it does
Grammar only Minimum edits. Changes nothing that is already correct. The default.
Expert writing Fixes errors, then makes it read like a skilled native writer.
Professional Polished business English. Neutral, confident, courteous.
Formal Formal register, no contractions or colloquialisms.
Casual Relaxed and natural, the way people actually talk.
Concise Fixes errors and cuts the text down. Same meaning, fewer words.
Academic Precise and objective, suitable for papers.
Custom… Your own instruction.

Same sentence through four of them:

in: hi team, i has finished the reprot but their was alot of issues with the data

Grammar only Hi team, I have finished the report, but there was a lot of issues with the data.
Professional Hi team, I have finished the report, but there were a lot of issues with the data.
Casual hi team, i've finished the report but there were a lot of issues with the data
Academic Hello team, I have completed the report; however, there were numerous issues with the data.

Custom takes any instruction, e.g. "fix all errors and rewrite as a single blunt sentence of at most 12 words" turns the above into "I finished the report; many data issues, please tell me any errors".

Whichever style you choose, the text you typed is still treated as data, never as an instruction — all eight were tested against that.

Settings window

Right-click tray → Settings…. Four tabs, and changes take effect immediately — no restart.

  • Output style — pick a style, write a custom instruction, and hit Test this style to see the result on a sample sentence before saving.
  • Model & API — API key, engine (with Test connection to confirm the key works and the engine is reachable), effort, temperature, timeout.
  • Behaviour — hotkey (with Press a key… to capture one), and the suppress / overlay / clipboard toggles.
  • Advanced — the base system prompt, with {style} marking where the chosen style is slotted in.

Bad values are rejected with an explanation rather than silently saved.

Engines

Pick one under Settings → Model & API.

Engine Typical Notes
MEPX Cloud Pro 2.6s Best quality. The default.
MEPX Cloud Flash 1.7s Fastest. Punctuation is a little plainer.
MEPX Cloud Core 1.8s Steady, with no reasoning step.
MEPX Cloud Air 2.3s Thinks a step before answering.

Every engine on that list was checked against two things: that it corrects well, and that it refuses to obey instructions found in the text it is correcting. Two models the gateway serves are deliberately not offered — both answered "what is the capitel of france" instead of fixing its spelling, which would replace your sentence with a reply.

Effort (Pro and Flash only) trades a little speed for more care; low keeps a correction at roughly two seconds. Air rejects any effort value other than none or default, so it is excluded.

The engine names are the app's own. The settings window, tray, log and error messages only ever show these names — the underlying provider ids stay out of everything you see, including config.json. They are still what goes over the wire to the API, so anyone inspecting network traffic or the binary itself can see them; the naming is presentation, not secrecy.

The config file

The window writes %APPDATA%\GrammarFixer\config.json. You can edit it by hand instead; restart the app afterwards.

Key Default Notes
api_key (empty) MepX key; falls back to GRAMMARFIXER_API_KEY when blank
model MEPX Cloud Pro engine display name; see above
reasoning_effort low Pro and Flash only; keeps it fast
style grammar one of the styles above
custom_style_instruction see file used when style is custom
hotkey insert any key name, e.g. f9, ctrl+space
suppress_hotkey true hides Insert from other apps so it doesn't toggle overwrite mode
show_overlay true the bottom-right pill
restore_clipboard true puts your clipboard back afterwards
max_chars 4000 refuses to act on longer runs
temperature 0.2
system_prompt see file base prompt; {style} is where the style goes
config_version 4 migrations run per step, so a prompt you edited survives an unrelated bump

How it replaces your text

  1. A low-level keyboard hook counts the characters you typed while recording.
  2. It selects that many characters to the left of your caret and copies them — so the text sent to the engine is what the application actually contains, not a guess.
  3. It compares the copy against its own reconstruction. If they don't match (below 45% similar), it aborts and changes nothing rather than risk overwriting text you didn't type.
  4. The correction is pasted over the selection. Your clipboard is restored.

If Ctrl+C doesn't work in the target app, it falls back to deleting with backspaces and typing the correction instead. That fallback deletes on trust, so it is only used when nothing during the recording cast doubt on the character count — if you moved the caret or pasted, the app stops instead.

Limitations

  • Don't click elsewhere, or use arrow keys, Ctrl+V or Ctrl+Z while recording — the character count stops matching what's on screen. The app detects this and will bail out instead of mangling your text, but the fix just won't happen.
  • Text entered through an IME or pasted in is invisible to the hook.
  • To fix text inside an elevated window (an admin terminal, for example), the app has to be running elevated too. Windows blocks it otherwise.
  • Shifted symbols are reconstructed as their unshifted key. This only affects the internal count, not the text that gets corrected.

The API

Corrections go to the MepX API at https://api.mepxdev.com/v1, which is OpenAI-compatible. The app talks to it with a plain HTTPS POST rather than the openai SDK — the wire format is identical (the SDK's extra_body is just extra keys merged into the same JSON body), and skipping the dependency keeps the executable smaller.

Reasoning engines are sent reasoning_format: "hidden" so their scratchpad never lands in your document — without it, Air returns about 4,000 characters of visible thinking. The engines that do not support that parameter reject it outright with a 400, so it is only sent to the ones that accept it.

If the gateway replies 429/502/503 — its key pool is saturated and it answers {"error":{"message":"No upstream capacity ... Retry in 3s."}} — the app waits the interval it names and retries up to three times before showing you an error.

The key

Set it in Settings → Model & API, or in config.json. Two things worth knowing:

  • It is stored in config.json in plain text, so anyone with that file can read it. Issue the app its own key rather than reusing one with wider access.
  • Nothing is compiled into the executable. A fresh install starts with no key until you enter one.

To keep it off disk entirely, leave api_key empty and set the environment variable GRAMMARFIXER_API_KEY instead — it is used whenever the config value is blank.

Development

python selftest.py

Reconstruction, reply cleaning, and live engine calls including instruction-resistance checks.

python engine_test.py

Checks every MEPX Cloud engine resolves to a live provider id, returns a real correction, gets the effort flag only if it accepts it, and that no provider id leaks into anything user-facing.

python style_test.py

Runs all eight styles, checks they differ, that custom instructions are followed, and that none of them start obeying the text.

python ui_test.py

Drives the settings window headlessly — validation, saving, live-apply, config migration — and writes screenshots of every tab to screenshots\.

python e2e_test.py

Drives a real Notepad window through short, long and multi-line corrections.

python exe_test.py

Launches the built exe and drives it through its real Insert hotkey, then restarts it with a custom style to confirm the setting reaches the engine. exe_test_nonelevated.py does the same un-elevated.

powershell -ExecutionPolicy Bypass -File build.ps1

Rebuilds dist\GrammarFixer.exe.

Requires keyboard requests pyperclip pystray pillow pyinstaller.

The live tests read the key from config.json. set_key.py copies it there from a .mepx_key file (or GRAMMARFIXER_API_KEY) without printing it, which is useful because several tests wipe the config directory to get a clean start.

python check_mapping.py

Confirms MepX still serves the model behind every MEPX Cloud engine. Run it if corrections start failing — the gateway's catalogue does change, and the Llama models it once served are already gone.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages