# samrand96/undetectable-ai architecture

> Architecture diagram of the GitHub repository samrand96/undetectable-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/samrand96/undetectable-ai
- Repository: https://github.com/samrand96/undetectable-ai

## Overview

Undetectable-AI is a command-line DOCX processor. The user supplies a document and options; the script initializes model settings, processes nonblank paragraphs through translation and AI-content scoring, humanizes text when needed, optionally corrects grammar, and saves a new DOCX. The README also describes optional ChatGPT humanization. The graph reflects the sampled main.py; it does not imply that the unused rewriter or ZeroGPT helper participates in the workflow.

Main entry points: [`main.py`](https://github.com/samrand96/undetectable-ai/blob/main/main.py) (DOCX processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_cli["CLI setup<br/>[main.py]"]
  node_model_setup["Model setup<br/>[main.py]"]
end

subgraph group_processing["Document processing"]
  node_doc_processor["DOCX processor<br/>[main.py]"]
  node_translator["Translation<br/>[main.py]"]
  node_content_score["Content scoring<br/>[main.py]"]
  node_grammar["Grammar correction<br/>[main.py]"]
  node_doc_output["Processed DOCX"]
end

subgraph group_services["Models and services"]
  node_ollama["Ollama model"]
  node_openai["OpenAI API"]
  node_google_translate["Google Translate"]
  node_writer_detector["Writer detector"]
end

node_user(("User"))

node_user -->|"runs with options"| node_cli
node_cli -->|"configures model"| node_model_setup
node_cli -->|"starts processing"| node_doc_processor
node_model_setup -->|"sets model state"| node_doc_processor
node_doc_processor -->|"checks paragraphs"| node_content_score
node_doc_processor -->|"translates text"| node_translator
node_doc_processor -->|"requests humanization"| node_ollama
node_doc_processor -->|"optionally humanizes"| node_openai
node_doc_processor -->|"optionally corrects"| node_grammar
node_doc_processor -->|"saves document"| node_doc_output
node_translator -->|"requests translation"| node_google_translate
node_content_score -->|"posts text for scoring"| node_writer_detector
node_grammar -->|"requests correction"| node_ollama

click node_cli "https://github.com/samrand96/undetectable-ai/blob/main/main.py"
click node_model_setup "https://github.com/samrand96/undetectable-ai/blob/main/main.py"
click node_doc_processor "https://github.com/samrand96/undetectable-ai/blob/main/main.py"
click node_translator "https://github.com/samrand96/undetectable-ai/blob/main/main.py"
click node_content_score "https://github.com/samrand96/undetectable-ai/blob/main/main.py"
click node_grammar "https://github.com/samrand96/undetectable-ai/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_model_setup,node_user toneBlue
class node_doc_processor,node_translator,node_content_score,node_grammar,node_doc_output toneAmber
class node_ollama,node_openai,node_google_translate,node_writer_detector toneMint
```

## Components

### Command line

- [CLI setup](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`
- [Model setup](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`

### Document processing

- [DOCX processor](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`
- [Translation](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`
- [Content scoring](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`
- [Grammar correction](https://github.com/samrand96/undetectable-ai/blob/main/main.py): `main.py`
- **Processed DOCX**

### Models and services

- **Ollama model**
- **OpenAI API**
- **Google Translate**
- **Writer detector**

### Other components

- **User**

## Connections

- User → CLI setup: runs with options (evidence: `README.md`)
- CLI setup → Model setup: configures model (evidence: `main.py`)
- CLI setup → DOCX processor: starts processing (evidence: `main.py`)
- Model setup → DOCX processor: sets model state (evidence: `main.py`)
- DOCX processor → Content scoring: checks paragraphs (evidence: `main.py`)
- DOCX processor → Translation: translates text (evidence: `main.py`)
- DOCX processor → Ollama model: requests humanization (evidence: `main.py`)
- DOCX processor → OpenAI API: optionally humanizes (evidence: `main.py`)
- DOCX processor → Grammar correction: optionally corrects (evidence: `main.py`)
- DOCX processor → Processed DOCX: saves document (evidence: `main.py`)
- Translation → Google Translate: requests translation (evidence: `main.py`)
- Content scoring → Writer detector: posts text for scoring (evidence: `main.py`)
- Grammar correction → Ollama model: requests correction (evidence: `main.py`)
