Skip to content

Repository files navigation

TextEnhanceAI - Editor with Local LLM Integration

TextEnhanceAI is a local desktop editor that uses Ollama to proofread, rewrite, translate, and improve text without sending it to a cloud service. Version 0.13 adds a structured review workflow so every suggestion can be accepted or rejected before it changes the document.

TextEnhanceAI v0.13 review screen

Key features

  • Sentence-by-sentence review: changed sentences are shown separately instead of combining red and green words in the editor.
  • Individual change groups: expand a sentence to accept or reject specific word or punctuation changes.
  • Clear visual differences: removed text is labeled and struck through; added text is labeled and underlined, so color is not the only indicator.
  • Visible decisions: accepted and rejected states are bold green and red; pending and partially accepted states are bold blue and orange.
  • Safe application: the source remains unchanged while suggestions are reviewed. Apply is enabled only after every change has a decision.
  • Undo: restore the exact text from before the most recently applied review.
  • Cancellable local generation: Ollama runs in the background, the editor stays responsive, and partial cancelled responses are discarded.
  • Editing modes: Grammar, Proofread, Natural, Streamline, Awkward, Rewrite, Concise, Polish, Improve, Translate, and Custom.
  • Model status: see whether Ollama is connected, unavailable, or missing a local model.
  • Markdown history: each successful proposal, individual decision, and final result is logged to a local scratchpad.

Requirements

  • Python 3.8 or newer
  • Ollama installed and running
  • At least one local Ollama model

Install the Python dependency:

pip install -r requirements.txt

Pull a model suited to your hardware:

  • GPU with approximately 6–8 GB of VRAM: ollama pull llama3.1:8b
  • CPU-only or lower-resource computer: ollama pull qwen3:1.7b

The app defaults to llama3.1:8b. Select another installed model from the Model dropdown or change the default with the TEAI_MODEL environment variable.

Run the app

python TextEnhanceAI.py

Using uv is also supported:

uv venv
uv pip install -r requirements.txt
uv run python TextEnhanceAI.py

Review workflow

  1. Paste or type text in the editor.
  2. Choose an editing mode and model.
  3. Select Review changes or press Ctrl+Enter.
  4. Review each changed sentence. Accept or reject the whole sentence, or expand Review individual changes for finer control.
  5. Use Previous and Next to navigate.
  6. Apply the reviewed text after no pending decisions remain.

Keyboard shortcuts:

  • Ctrl+Enter: generate suggestions or apply a completed review
  • Alt+A: accept the current sentence
  • Alt+R: reject the current sentence
  • Alt+Left / Alt+Right: previous or next suggestion

Generated TextEnhanceAI-scratchpad_*.md files are stored next to the application and ignored by Git.

Development and tests

The launcher remains TextEnhanceAI.py. Pure editing logic and Ollama access live in core/, while Tkinter screens live in ui/.

Install test dependencies and run the suite:

uv pip install -r requirements-dev.txt
uv run pytest -q

The automated suite uses fake Ollama responses and does not require a running model. Version 0.13 is verified with Ollama Python client 0.6.1; a live Ollama smoke test is still recommended for release verification.

Contact

Email: wenrolland@designecologique.ca

Updates

  • Version 0.13: Adds structured sentence and word-group review, safe mixed decisions, cancellation, connection status, enhanced scratchpads, undo, and automated tests.
  • Version 0.12: Adds local model selection and background generation.
  • Version 0.11: Preserves line breaks after editing.

About

A user-friendly, Python-based Markdown editor that leverages a locally hosted LLM (via Ollama right now) for simple text enhancements, proofreading, and rewriting.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages