# engabdullah3334-bot/omnitranslate_agent architecture

> Architecture diagram of the GitHub repository engabdullah3334-bot/omnitranslate_agent, 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/engabdullah3334-bot/omnitranslate_agent
- Repository: https://github.com/engabdullah3334-bot/omnitranslate_agent

## Overview

OmniTranslate is a document translation application whose principal workflow accepts a PDF, text file, or inline text, extracts page-sized text, analyzes language and context with LLaMA through Ollama, hands extracted pages across a memory boundary, translates them page by page with NLLB, then saves and logs results. The orchestrator owns extraction, model coordination, handover, translation, and logging; the CLI owns interaction and final exports. README capabilities include byte-based extraction for uploads. Source excerpts establish the main CLI and model calls; some documented extraction and logging details were not fully sampled.

Main entry points: [`orchestrator.py`](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py) (Model orchestrator), [`main.py`](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/main.py) (CLI workflow), [`translator_engine.py`](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/translator_engine.py) (NLLB engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and extraction"]
  node_cli["CLI workflow<br/>[main.py]"]
  node_extract["Text extraction<br/>[orchestrator.py]"]
end

subgraph group_coordination["Pipeline coordination"]
  node_handover["Page handover<br/>[orchestrator.py]"]
  node_orchestrator["Model orchestrator<br/>[orchestrator.py]"]
end

subgraph group_translation["Translation models"]
  node_ollama{{"Ollama LLaMA"}}
  node_nllb["NLLB engine"]
  node_huggingface{{"Hugging Face models"}}
end

subgraph group_results["Results and records"]
  node_output["Translated text"]
  node_pdf["Translated PDF"]
  node_log["Translation log"]
end

node_user(("Document user"))

node_user -->|"provides input"| node_cli
node_cli -->|"extracts pages"| node_extract
node_extract -->|"provides pages"| node_orchestrator
node_cli -->|"requests analysis"| node_orchestrator
node_orchestrator -->|"analyzes request"| node_ollama
node_orchestrator -->|"evicts model"| node_ollama
node_cli -->|"saves and reloads"| node_handover
node_orchestrator -->|"reads and writes"| node_handover
node_cli -->|"requests translation"| node_orchestrator
node_orchestrator -->|"loads and translates"| node_nllb
node_nllb -->|"loads weights"| node_huggingface
node_cli -->|"writes translation"| node_output
node_cli -->|"exports PDF"| node_pdf
node_cli -->|"records session"| node_orchestrator
node_orchestrator -->|"appends session"| node_log

click node_cli "https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/main.py"
click node_extract "https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py"
click node_handover "https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py"
click node_orchestrator "https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py"
click node_nllb "https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/translator_engine.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_extract,node_user toneBlue
class node_handover,node_orchestrator toneAmber
class node_ollama,node_nllb,node_huggingface toneMint
class node_output,node_pdf,node_log toneRose
```

## Components

### Input and extraction

- [CLI workflow](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/main.py): `main.py`
- [Text extraction](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py): `orchestrator.py`

### Pipeline coordination

- [Page handover](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py): `orchestrator.py`
- [Model orchestrator](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/orchestrator.py): `orchestrator.py`

### Translation models

- **Ollama LLaMA**
- [NLLB engine](https://github.com/engabdullah3334-bot/omnitranslate_agent/blob/main/translator_engine.py): `translator_engine.py`
- **Hugging Face models**

### Results and records

- **Translated text**
- **Translated PDF**
- **Translation log**

### Other components

- **Document user**

## Connections

- Document user → CLI workflow: provides input (evidence: `main.py`)
- CLI workflow → Text extraction: extracts pages (evidence: `main.py`)
- Text extraction → Model orchestrator: provides pages (evidence: `README.md`)
- CLI workflow → Model orchestrator: requests analysis (evidence: `main.py`)
- Model orchestrator → Ollama LLaMA: analyzes request (evidence: `README.md`)
- Model orchestrator → Ollama LLaMA: evicts model (evidence: `orchestrator.py`)
- CLI workflow → Page handover: saves and reloads (evidence: `main.py`)
- Model orchestrator → Page handover: reads and writes (evidence: `README.md`)
- CLI workflow → Model orchestrator: requests translation (evidence: `main.py`)
- Model orchestrator → NLLB engine: loads and translates (evidence: `orchestrator.py`)
- NLLB engine → Hugging Face models: loads weights (evidence: `translator_engine.py`)
- CLI workflow → Translated text: writes translation (evidence: `main.py`)
- CLI workflow → Translated PDF: exports PDF (evidence: `main.py`)
- CLI workflow → Model orchestrator: records session (evidence: `main.py`)
- Model orchestrator → Translation log: appends session (evidence: `README.md`)
