humanize

Public

Forked from altra/humanize

148 Downloads

2 forks

README

Humanize Plugin for LM Studio

Detects AI-generated text and rewrites it to sound authentically human — without changing the meaning. Useful for polishing AI-assisted writing before publishing, sending, or presenting.


What It Does

  • Detects AI-generated text using five local heuristic signals — no external APIs, no data sent anywhere
  • Rewrites text to vary sentence structure, remove LLM patterns, and match your tone
  • Convenience mode (analyze_and_humanize) detects first, rewrites only if the score is above a threshold

Installation

cd humanize-plugin
npm install
npm run build

Load the built plugin folder in LM Studio.


Configuration

FieldDefaultDescription
Default TonecasualTone used when none is specified in the call. Options: casual, professional, academic, custom
AI Score Threshold60Score (0–100) above which analyze_and_humanize triggers a rewrite

Tools

detect_ai_text

Kind: Compute

Analyzes text and returns a score from 0 (likely human) to 100 (likely AI) based on five heuristic signals.

Score rangeVerdict
0–30Likely human
31–60Mixed signals
61–80Likely AI
81–100Almost certainly AI

Five signals (with weights):

SignalWeightWhat it detects
Flagged phrase density30%AI-specific phrases ("it's worth noting", "delve into", "in conclusion")
Sentence burstiness25%Uniform sentence lengths — humans vary far more
Transition word density20%Overuse of "moreover", "furthermore", "in addition"
Paragraph symmetry15%All paragraphs roughly the same length
Average sentence length10%Long, complex sentences throughout

Detection is probabilistic. False positives are possible, especially for formal or academic writing.


humanize_text

Kind: Scaffold

Returns a rewrite prompt payload for the LLM to perform. Detects AI patterns first, then gives the LLM specific instructions to fix them while preserving all original meaning.

Tone options:

ToneStyle
casualConversational, contractions, short sentences, first-person
professionalClear and direct, authoritative but not stiff, no slang
academicFormal but varied, nuanced, avoids LLM academic clichés
customProvide your own style description in customToneDescription

Rewrite rules always applied:

  • Vary sentence lengths significantly — mix short and long
  • Remove or rephrase every flagged LLM phrase
  • Eliminate uniform paragraph lengths
  • Replace transition words with natural connectors or omit them
  • Preserve all original meaning, facts, and arguments exactly

analyze_and_humanize

Kind: Compute + Scaffold

Convenience tool: detects AI score, then returns a rewrite payload only if the score meets or exceeds the threshold.

  • If score < threshold: returns detection result with "appears human" verdict, no rewrite
  • If score ≥ threshold: returns both detection result and full rewrite payload

Use this for the full detect-then-rewrite flow in one call.


Example Sessions

Check if text sounds AI-generated:

"Does this paragraph sound like AI wrote it?"

detect_ai_text(textContent="...") → score: 74, verdict: "likely AI", signals breakdown

Rewrite in professional tone:

"Humanize this email draft in a professional tone"

humanize_text(textContent="...", tone="professional") → rewrite payload → LLM produces rewritten text

Auto detect and rewrite (threshold 60):

"Clean up this blog section"

analyze_and_humanize(textContent="...", tone="casual") → if score ≥ 60, rewrites; if below, leaves as-is

Custom tone for a specific brand voice:

"Rewrite this in our brand voice — dry, technical, no fluff"

humanize_text(textContent="...", tone="custom", customToneDescription="Dry and technical. No filler words. No enthusiasm markers. Direct statements only. Short sentences preferred.") → tailored rewrite