StealthHumanizer is a full-stack web application built with Next.js that transforms AI-generated text into natural, human-sounding prose. It supports 15 AI model providers, features a multi-pass humanization pipeline, and includes a built-in AI detection engine.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client (Browser) β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β βHumanizer β β Detector β β Settings β β History β β
β βComponent β βComponent β βComponent β βComponent β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β β
β ββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββ β
β β React State β β
β β (Next.js App Router / RSC) β β
β ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββ
β HTTP POST (JSON)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js API Routes β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ β
β β POST /api/humanize β β POST /api/alternative β β
β ββββββββββββ¬ββββββββββββ ββββββββββββ¬ββββββββββββ β
βββββββββββββββΌβββββββββββββββββββββββββββΌβββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Core Library (lib/) β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β humanizer β β detector β β providers β β
β β Multi-pass β β AI Detectionβ β 15 Provider β β
β β Pipeline β β Engine β β Abstraction β β
β ββββββββ¬ββββββββ ββββββββββββββββ ββββββββ¬ββββββββ β
β β β β
β ββββββββ΄βββββββ ββββββββββββββββ βββββββββ΄βββββββ β
β β prompts β β readability β β types β β
β β Style Eng. β β Metrics β β TypeScript β β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β
β ββββββββββββββββ β
β β storage β localStorage (client-side persistence) β
β ββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β External AI Providers β
β β
β ββββββββββ ββββββββββ ββββββββββ ββββββββββ ββββββββββ β
β β Gemini β β OpenAI β β Claude β β Groq β β Mistralβ ... β
β ββββββββββ ββββββββββ ββββββββββ ββββββββββ ββββββββββ β
β β
β ββββββββββ ββββββββββ ββββββββββ ββββββββββ ββββββββββ β
β β Cohere β βTogetherβ βOpenRoutrβ βCerebrasβ βDeepInfrβ ... β
β ββββββββββ ββββββββββ ββββββββββ ββββββββββ ββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The heart of our multi-provider support. Implements a unified interface across 15 AI providers with vastly different APIs:
- OpenAI-compatible adapters β Groq, Together, OpenRouter, DeepInfra, Cerebras, Mistral all share the chat completions format
- Native adapters β Gemini (Google's generateContent API), Claude (Anthropic's Messages API), Cohere (chat API), HuggingFace (inference API)
- Cloudflare Workers AI β Edge inference with account-scoped URLs
Each provider normalizes to a single generateWithProvider() function that accepts (provider, apiKey, systemPrompt, userPrompt, options) and returns plain text.
Orchestrates the full humanization pipeline:
- Chunking β Long texts are split at sentence boundaries (max 2,500 words/chunk)
- Pass 1 β Full text rewrite using style-aware system prompts
- Detection β Built-in detector scores each sentence
- Pass 2β3 (aggressive/ninja only) β Flagged sentences are re-humanized in batch
- Result assembly β Sentence-level mapping with detection scores
Generates context-aware system prompts by composing:
- Persona injection β Different writing personas per rewrite level
- Tone configuration β 13 tone presets with personality traits, vocabulary, and writing patterns
- Style guides β 5 style presets (academic, casual, professional, creative, technical)
- Level instructions β 4 rewrite levels from light surgical edits to full ninja rewrites
- Anti-pattern rules β Explicit instructions to avoid AI-detectable patterns
A heuristic-based detection system that analyzes text across 12 metrics:
| Metric | Weight | What It Measures |
|---|---|---|
| Sentence Average | 25% | Combined per-sentence AI signals |
| Perplexity | 12% | Word/bigram predictability |
| Burstiness | 12% | Sentence length variation |
| Vocabulary Diversity | 8% | Unique word ratio |
| Sentence Length Variation | 8% | Range of sentence lengths |
| Transition Frequency | 8% | Overuse of transition words |
| Passive Voice Ratio | 5% | Passive construction frequency |
| AI Phrase Density | 7% | Known AI phrase matches |
| Sentence Start Diversity | 5% | Variety of sentence openers |
| Pronoun Usage | 5% | First/second person usage |
| Hedging Frequency | 3% | Hedging language density |
| Quantifier Overuse | 2% | Overuse of vague quantifiers |
Calculates standard readability scores: Flesch Reading Ease, Flesch-Kincaid Grade Level, Coleman-Liau Index, plus word/sentence/syllable counts and estimated reading time.
Manages localStorage for API keys, humanization history (max 50 entries), and theme preference. Includes text chunking, download utilities (TXT/DOCX), and word counting.
Comprehensive type definitions for providers, humanization options, detection results, readability scores, history entries, and UI state.
Input Text
β
βΌ
βββββββββββββββ
β Text Input ββββΊ Validate (max 10,000 words)
β Component β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β POST /api/ ββββΊ Parse: text, level, style, tone, model, apiKey
β humanize β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Prompt ββββΊ Compose system prompt from:
β Generation β persona + tone + style + level instructions
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ ββββββββββββββββ
β Chunk Text ββββββΊβ Split at β
β (β€2500 words)β β sentence β
ββββββββ¬βββββββ β boundaries β
β ββββββββββββββββ
βΌ
βββββββββββββββ ββββββββββββββββ
β Pass 1: ββββββΊβ AI Provider β
β Full Rewrite β β (via fetch) β
ββββββββ¬βββββββ ββββββββββββββββ
β
βΌ
βββββββββββββββ
β Run AI β
β Detector ββββΊ Score: 0β100 (human likelihood)
ββββββββ¬βββββββ
β
ββββ Score β₯ target? βββΊ Done
β
βΌ (aggressive / ninja only)
βββββββββββββββ
β Pass 2+: ββββΊ Re-humanize flagged sentences
β Re-write β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Assemble ββββΊ Map sentences, attach scores,
β Results β build response
ββββββββ¬βββββββ
β
βΌ
JSON Response β Client renders results
User clicks sentence
β
βΌ
POST /api/alternative
{ original, current, level, style, tone, model, apiKey }
β
βΌ
Generate 3 alternatives at temperature 1.0
β
βΌ
JSON: { alternatives: string[] }
ββββββββββββββββ
β Input Text β
ββββββββ¬ββββββββ
β
ββββββββββββββ΄βββββββββββββ
β Chunk if needed β
β (max 2500 words each) β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β PASS 1 β
β Full text humanize β
β Style + Tone + Level β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β Run Detection Engine β
β Score each sentence β
ββββββββββββββ¬βββββββββββββ
β
ββββββββ΄βββββββ
β Score β₯ 80? β
ββββββββ¬βββββββ
Yes β No
ββββββββ΄βββββββββββ
β β
βββββββ΄ββββββ ββββββββ΄βββββββ
β Return β β Extract β
β Results β β Flagged β
βββββββββββββ β Sentences β
ββββββββ¬βββββββ
β
ββββββββββββββ΄βββββββββββββ
β PASS 2 β
β Aggressive re-write β
β of flagged sentences β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β Re-run Detection β
ββββββββββββββ¬βββββββββββββ
β
ββββββββ΄βββββββ
β Score β₯ 80? β
ββββββββ¬βββββββ
Yes β No
β ββββββββββββββββββ
βββΊβ PASS 3 (Ninja)β
β Final polish β
βββββββββ¬βββββββββ
β
βββββββββ΄ββββββββ
β Return Final β
β Results β
βββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 16 (App Router) | Full-stack React framework |
| Language | TypeScript 6 | Type safety |
| Styling | Tailwind CSS 4 | Utility-first CSS |
| Icons | Lucide React | Icon library |
| AI Providers | 15 providers | Text generation via REST APIs |
| Storage | localStorage | Client-side persistence |
| Deployment | Vercel (recommended) | Zero-config Next.js hosting |
- Next.js β Server-side API routes keep API keys off the client; App Router for modern React patterns
- TypeScript β Catches provider API mismatches at compile time; comprehensive type definitions
- Tailwind CSS β Rapid UI development; dark mode support built-in
- No external AI SDKs β Direct
fetch()calls to provider APIs keep the bundle tiny and avoid dependency conflicts - localStorage β Privacy-first; no server-side user data storage required
- API keys are stored in the browser's localStorage (encrypted provider keys sent over HTTPS)
- API routes act as a thin proxy β keys are forwarded to providers but never stored server-side
- No user accounts, no databases, no tracking β fully client-side architecture
- All provider communication happens over HTTPS/TLS