Team Sunplaza • Developer Documentation & Architecture Reference

Emebala Documentation

Authentic technical reference for the Emebala sovereign language AI ecosystem: Emebala Chat C++20 / llama.cpp GGUF in-place keystroke replacement, Emebala Reader Rust 30+ format engine, PP-OCRv6, Kokoro ONNX audio, Hy-MT2 33 world languages specification, portable configuration, and AES-256-GCM vault cryptography.

Overview & Philosophy

In ancient Sumer around 2000 BCE, translators bridging diverse dialects, cuneiform clay tablets, and trade languages were revered as Eme-bala (literally: "those who turn language to bridge worlds"). Modern digital tools, however, have increasingly compromised individual liberty by routing confidential communications and literary manuscripts through remote corporate cloud servers.

Team Sunplaza engineered the Emebala ecosystem to restore absolute sovereignty to the reader and writer. Our codebase is crafted in modern, high-performance systems languages: C++20 for the ultra-low-latency Windows desktop flagship (Emebala Chat) and Rust for the modular literary sanctuary (Emebala Reader).

Core Engineering Axiom: Zero bytes of your text, keystrokes, clipboard buffers, or reading annotations ever leave your physical computer. There are no tracking telemetry servers, no mandatory cloud subscriptions, and no remote dependencies for offline operation.
The Two Dedicated Implementations
  • Emebala Chat (C++20 Desktop Flagship): Native Win32 / Direct2D client powered by an embedded llama.cpp runtime executing quantized GGUF weights (Hy-MT2-1.8B-Q8_0.gguf). Intercepts input buffers in any application to replace what you typed in-place, accompanied by double-Ctrl+C drag-to-translate and zero-latency Windows Speech Platform audio.
  • Emebala Reader (Rust Modular Architecture): Literary engine featuring 30+ format parsers (emebala-fs), synchronized bilingual dual-page spreads, Kokoro-82M ONNX speech synthesis, PP-OCRv6 text recognition, and AES-256-GCM encrypted local vault storage.

🚀 Quickstart Installation

Both Emebala Chat and Emebala Reader are distributed as self-contained standalone Windows applications. Emebala Chat is completely portable: its configuration file (config.json) and neural weights reside directly in its executable folder, requiring no registry writes or hidden AppData directories.

Step 1: Download & Extract

Obtain the latest portable release package or setup binary from the GitHub release distribution:

Download Emebala Chat (.exe) ↗ Download Emebala Reader (GitHub) ↗
Step 2: Windows SmartScreen Verification
ℹ️
Because Emebala is an independent patron-funded open-source release without an annual commercial enterprise certificate, Windows Defender SmartScreen may display: "Windows protected your PC". Click "More info" and select "Run anyway". You can verify the SHA256 checksum in PowerShell before execution.
PowerShell (Cryptographic Integrity Verification)
Get-FileHash -Path ".\EmebalaChat.exe" -Algorithm SHA256

⚙️ System Requirements

Hardware Subsystem Minimum Requirements Recommended (Optimal Latency)
Operating System Windows 10 64-bit (Build 19041+) Windows 11 64-bit (22H2+)
CPU Instruction Sets x86_64 with AVX2 & FMA3 Modern 8+ Core (AVX2 / AVX-512 supported)
System RAM 8 GB RAM 16 GB+ Dual-Channel (Fast DDR4/DDR5)
GPU Acceleration Integrated Intel UHD / AMD Vega NVIDIA GeForce RTX (CUDA sm_75+ Turing or newer)
Storage I/O SATA SSD (1.5 GB for Q8_0 weights) NVMe SSD (enables sub-second mmap paging)
Audio Subsystem DirectSound compatible audio Windows Speech Platform with installed language packs

In-Place Send-and-Replace Mechanics

In Emebalachat/src/hook.hpp, Emebala Chat implements a revolutionary keystroke replacement workflow: you simply type naturally in your native tongue inside Slack, Discord, WeChat, Teams, WhatsApp, or any browser input, and press the key you normally press to send messages.

Key Combination Hook Predicate & Code Rule Exact Resulting Behavior
Enter EnterSendReplaceAllowed() In-Place Send-and-Replace: Intercepts typed buffer, translates it into the active target language, replaces text in-place, and sends.
Shift + Enter Shift modifier check (!shift) Pass-Through Newline: Bypasses translation entirely; passes straight to target application to insert a multiline carriage return.
F9 hotkey_toggle handler Global Toggle: Instantly toggles translation engine between Active (Green) and Paused (Grey) states.
Ctrl + F9 hotkey_lang handler Cycle Target Language: Rotates target language through the active language list with sound confirmation.
Ctrl + Shift + Enter hotkey_mode handler Toggle Auto-Send: Switches between replacing text only vs replacing-and-submitting automatically.
💡
IME Composition Awareness (REQ-R17): When typing with an East Asian Input Method Editor (Hangul, Japanese Romaji/Kana, Chinese Pinyin), keys in active composition arrive as VK_PROCESSKEY (0xE5). The hook's internal ImeMirrorNext state machine guarantees that unfinished compositions are never accidentally truncated or corrupted.

🖱️ Floating Rosetta Badge & Drag Gestures

Emebala Chat renders a lightweight hardware-accelerated Direct2D badge widget directly on the screen (Emebalachat/src/ui/badge.cpp):

  • Single Left-Click: Toggles engine between Active and Paused translation state.
  • Double-Click: Instantly swaps source and target translation direction (e.g. English ↔ Korean).
  • Click & Drag: Freely repositions the floating status pill anywhere across single or multi-monitor desktop setups. Coordinates persist in badge_x and badge_y.
  • Double Ctrl + C Trigger ("double_ctrl_c"): Highlighting any text on screen and pressing Ctrl+C twice quickly summons the Floating Translation Tooltip right at your cursor.

🔊 Windows Speech Platform (Chat TTS)

In Emebala Chat (src/sound.cpp), speech synthesis is powered directly by the native Windows Speech Platform (Windows 내장 언어팩) through the ISpVoice COM interface and WinRT Windows.Media.SpeechSynthesis.

🛡️
Zero External Audio Models & Zero Cloud Voice Transmission: Chat uses the voice packs already installed in your Windows operating system (e.g. Microsoft Heami, David, Zira, Haruka, Hedda). Pronunciation audio is synthesized with 0ms network latency and absolute privacy.

🔒 Low-Level Keyboard Hook Safety Model

Emebala Chat's keyboard hook architecture (src/hook.cpp) was engineered under stringent safety constraints:

  • LowLevelHooksTimeout Prevention (REQ-R06): The hook callback performs zero blocking I/O, zero network calls, and zero model inference on the hook thread. Heavy workloads are dispatched asynchronously to a dedicated pipeline worker thread (src/worker.cpp).
  • Zero Cloud Clipboard Leakage: When capturing and restoring text selections, the Windows flag CanIncludeInClipboardHistory = 0 is applied, preventing transient translation strings from polluting Windows 10/11 cloud clipboard synchronization history.
  • Zero Telemetry Logging: Keystrokes that are not the intercepted action keys are never logged, buffered, or stored to disk.

📖 Emebala Reader: Synchronized Dual-Page Engine

Engineered in Rust with a Flutter frontend bridge, Emebala Reader delivers a desktop sanctuary for long-form literature and scholarship:

  • Sentence-Level Paragraph Alignment: The original text and translated text are dynamically mapped sentence-by-sentence into twin parallel columns or facing spreads.
  • Reflowable Dual-Spread Layout: Typography adapts to window width, zoom scales, and cultural reading themes while strictly preserving line and footnote alignment.
  • Continuous Bilingual Scrolling: Progressing through chapters scrolls both languages in perfect unison.

📚 30+ Supported Book & Document Formats

Emebala Reader's file system crate (native/emebala-fs/src) houses 39 Rust parser modules, delivering universal compatibility across world literature, digital comics, and academic documents:

Category Supported File Extensions Rust Parser Modules (emebala-fs) Rendering Capabilities
Hangul Word Processor (HWP / HWPX) .hwp, .hwpx hwp.rs Full Hangul HWP and HWPX compound document parsing
Microsoft Word & Office (DOCX / ODT / RTF) .docx, .odt, .rtf docx.rs, odt.rs, rtf.rs DOCX, ODT, and RTF XML DOM extraction, tables, styles, and character formatting
Digital Fiction & E-Books (EPUB / MOBI / KFX / FB2 / FBZ) .epub, .mobi, .kfx, .fb2, .fbz epub.rs, mobi.rs, kfx.rs, fb2.rs EPUB, MOBI, KFX, and FB2 reflowable chapters, metadata, table of contents
Fixed-Layout Documents (PDF / DjVu / CHM / XPS) .pdf, .djvu, .chm, .xps pdf.rs, djvu.rs, chm.rs, xps.rs PDF, DjVu, CHM, and XPS multi-column bounding box extraction, DjVu JB2 compression
Comic Books & Manga (CBZ / CBR / CB7 / CBT) .cbz, .cbr, .cb7, .cbt cbz.rs, cbr.rs, cb7.rs, cbt.rs Archive extraction (CBZ, CBR, CB7, CBT) with image caching
Plain Text & Web (TXT / Markdown / HTML) .txt, .md, .html, .mhtml txt.rs, md.rs, html.rs, mhtml.rs TXT and Markdown UTF-8/UTF-16 auto-detection, CommonMark markdown parsing

🎨 Cultural Reading Themes & Typography

To eliminate digital eye strain during prolonged contemplation, Emebala Reader incorporates three bespoke cultural themes:

Theme Historical Heritage Color Values Recommended Reading Setting
Mesopotamian Clay Cuneiform clay tablets of ancient Sumer (2000 BCE) Clay Terracotta #C4956A, Deep Earth #14110F Nighttime low-blue-light reading
Joseon White Porcelain Korean Joseon Dynasty pure white porcelain (백자) Ivory Silk #F7F3EE, Cobalt Blue #2F5D9B Daylight study and academic literature
Traditional Hanji Mulberry Handmade mulberry fiber paper (한지) with natural warmth Warm Hanji #DFB78E, Antique Ink #241E1A Classical poetry, memoirs, historical texts

🔍 PP-OCRv6 On-Device Text Recognition

Scanned manuscripts, historical documents, and image-based PDF/comics are processed via the integrated OCR pipeline in native/emebala-ai/src/ocr.rs:

  • ONNX Runtime Local Inference: Uses ONNX Runtime CPU/DirectML with zero external dependencies.
  • DBNet++ Text Detection: Detects irregular, rotated, and curved text lines across dense historical pages.
  • SVTR_LCNet Text Recognition: High-accuracy multilingual character recognition supporting Latin, Hangul, CJK characters, Arabic, Cyrillic, and Devanagari.
  • Spatial Bounding Box Reconstruction: Extracted lines preserve layout geometry on the left page while feeding clean strings to the bilingual translation engine on the right page.

🎧 Kokoro ONNX & Windows SMTC Audio Controls

For long-form book listening, Emebala Reader embeds state-of-the-art neural audio synthesis (native/emebala-ai/src/tts/):

  • Kokoro-82M ONNX TTS (kokoro.rs): Ultra-natural expressive voice generation running locally on ONNX Runtime with low memory overhead.
  • Supertonic TTS (supertonic.rs): High-throughput streaming voice synthesis for rapid passage audition.
  • Windows System Media Transport Controls (SMTC): Native Windows OS integration (audio_service_win). Control book playback, volume, pause/resume, and chapter skipping using physical keyboard media keys and the Windows lock screen media overlay.

🌐 Hy-MT2 33 World Languages Specification

The core translation engine supports 33 World Languages (1,056 bidirectional translation pairs) organized across five major geographical and linguistic families:

📊
Direct Bidirectional Translation: All 33 languages translate directly into any other supported language without routing through an intermediate English pivot, maintaining nuanced cultural and grammatical fidelity.
# Language Family Language Name ISO 639-1 Native Script Local Execution Status
1East AsianKorean (한국어)koHangulActive Production
2East AsianJapanese (日本語)jaKanji / KanaActive Production
3East AsianChinese Simplified (简体中文)zh-CNSimplified HanziActive Production
4East AsianChinese Traditional (繁體中文)zh-TWTraditional HanziActive Production
5EuropeanEnglishenLatinActive Production
6EuropeanGerman (Deutsch)deLatinActive Production
7EuropeanFrench (Français)frLatinActive Production
8EuropeanSpanish (Español)esLatinActive Production
9EuropeanPortuguese (Português)ptLatinActive Production
10EuropeanItalian (Italiano)itLatinActive Production
11EuropeanDutch (Nederlands)nlLatinActive Production
12EuropeanRussian (Русский)ruCyrillicActive Production
13EuropeanUkrainian (Українська)ukCyrillicActive Production
14EuropeanPolish (Polski)plLatinActive Production
15EuropeanCzech (Čeština)csLatinActive Production
16Middle EasternArabic (العربية)arArabic (RTL)Active Production
17Middle EasternHebrew (עברית)heHebrew (RTL)Active Production
18Middle EasternPersian / Farsi (فارسی)faPerso-Arabic (RTL)Active Production
19Middle EasternTurkish (Türkçe)trLatinActive Production
20South Asian / IndicHindi (हिन्दी)hiDevanagariActive Production
21South Asian / IndicBengali (বাংলা)bnBengaliActive Production
22South Asian / IndicUrdu (اردو)urNastaliq (RTL)Active Production
23South Asian / IndicTelugu (తెలుగు)teTeluguActive Production
24South Asian / IndicTamil (தமிழ்)taTamilActive Production
25South Asian / IndicMarathi (मराठी)mrDevanagariActive Production
26South Asian / IndicGujarati (ગુજરાતી)guGujaratiActive Production
27Southeast AsianVietnamese (Tiếng Việt)viLatin (Quốc ngữ)Active Production
28Southeast AsianThai (ไทย)thThaiActive Production
29Southeast AsianIndonesian (Bahasa Indonesia)idLatinActive Production
30Southeast AsianMalay (Bahasa Melayu)msLatinActive Production
31Southeast AsianTagalog / FilipinotlLatinActive Production
32Southeast AsianKhmer (ភាសាខ្មែរ)kmKhmerActive Production
33Southeast AsianBurmese (မြန်မာစာ)myMyanmarActive Production

🏔️ 5 Regional Dialects & Indigenous Heritages

Beyond the 33 major world languages, Emebala safeguards 5 regional dialects and indigenous tongues often neglected by commercial translation cloud providers:

Dialect / Indigenous Heritage ISO 639 Cultural Geography Engine Specialization
Cantonese (粵語 / 廣東話) yue Hong Kong, Macau, Guangdong, Diaspora Preserves colloquial Cantonese characters, particles & Jyutping syntax
Tibetan (བོད་སྐད།) bo Tibetan Plateau, Himalayan Regions Syllabic tsheg delimiter parsing, Buddhist canon terminology
Uyghur (ئۇيغۇرچە) ug Central Asia, Xinjiang Basin Perso-Arabic RTL, vowel harmony adaptation, classical Chagatai roots
Mongolian (Монгол хэл / ᠮᠣᠩᠭᠣᠯ) mn Mongolia, Inner Mongolia Dual mapping for Traditional Vertical Script and Modern Cyrillic
Kazakh (Қазақ тілі / Qazaqşa) kk Kazakhstan, Central Asian Steppe Support across Cyrillic, Latin reforms, and Arabic (Tote Jazu) scripts

Dual Inference Architecture (llama.cpp & CTranslate2)

Emebala tailors its neural execution layer to the operational demands of each application:

Emebala Chat: Embedded llama.cpp (C++20)

Emebala Chat embeds llama.cpp directly via CMake FetchContent. It executes quantized GGUF weights (models/Hy-MT2-1.8B-Q8_0.gguf) with hardware acceleration:

  • Zero Dynamic Allocations during Translation: The context and KV cache are pinned in memory for instantaneous keystroke response (~40ms).
  • WinHTTP Cloud Fallback Client (src/google_translate.cpp): When cloud_fallback_enabled: true is explicitly configured by the user, Chat includes a native WinHTTP client for fallback translation. When false (default), zero external traffic is ever permitted.
Emebala Reader: emebala-ai Dual Backends (Rust)

In native/emebala-ai/src/translation/, Emebala Reader implements two modular backends:

  • HyMt2Backend (hymt2.rs): Powered by llama-cpp-2 for Hy-MT2 1.8B and 7B GGUF models.
  • Ct2Backend (ct2.rs): Powered by CTranslate2 for rapid concurrent batch translation across multi-paragraph book chapters.

🛡️ AES-256-GCM Vault & Memory Security

In native/emebala-crypto/src/, Emebala implements enterprise-grade cryptographic sovereignty:

  • AES-256-GCM Authenticated Encryption: Reading logs, bookmarks, and confidential notes are encrypted with 256-bit Galois/Counter Mode to guarantee confidentiality and data integrity.
  • Argon2id Key Derivation: Master passphrases are stretched using memory-hard Argon2id parameters to resist GPU/ASIC brute-force attacks.
  • Memory Scrubbing on Drop (zeroize): Sensitive encryption keys and decrypted text chunks are wrapped in zeroize::ZeroizeOnDrop containers, guaranteeing memory pages are scrubbed immediately upon release.
  • Windows DPAPI & Credential Manager: Encryption seeds on Windows are guarded by DPAPI, binding keys to the user's hardware TPM.

🕊️ Zero-Telemetry Verification Protocol

Verify Emebala's zero-cloud guarantee using your preferred network monitoring tool (Wireshark, Fiddler, or Windows Resource Monitor):

PowerShell (Audit Outbound Connections of Emebala)
Get-NetTCPConnection | Where-Object { (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName -like "*Emebala*" }

The output is completely empty. No outbound socket connects, no telemetry pings, and no background analytics ever leave your device.

⌨️ Global Hotkeys & Keyboard Shortcuts Matrix

The definitive shortcuts verified directly against Emebalachat/src/hook.hpp and src/config.hpp:

Target Action Trigger Key / Gesture Code Reference Behavior Details
In-Place Send & Replace Enter EnterSendReplaceAllowed Translates typed input buffer in any chatbox and replaces it in-place.
Pass-Through Newline Shift + Enter !shift predicate Inserts multiline carriage return without triggering translation.
Toggle Active / Paused F9 hotkey_toggle Toggles translation between active (green) and paused (grey) state.
Cycle Target Language Ctrl + F9 hotkey_lang Advances target language forward through the 33 supported world languages.
Toggle Auto-Send Mode Ctrl + Shift + Enter hotkey_mode Toggles whether translated text is automatically submitted on Enter.
Drag-to-Translate Tooltip Double Ctrl + C "double_ctrl_c" Pressing Ctrl+C twice quickly summons translation tooltip at cursor.
Badge Toggle State Left-Click Badge badge.cpp Single click on floating Direct2D pill toggles pause/active.
Badge Swap Languages Double-Click Badge badge.cpp Double click on floating Direct2D pill flips source and target language.
Badge Reposition Drag Badge badge.cpp Click and drag floating pill to any monitor; coordinates persist in config.
Reader Page Turn Space / emebala-reader Advances to next synchronized bilingual spread.
Reader Prev Page Shift + Space / emebala-reader Returns to previous synchronized bilingual spread.
Reader Cycle Theme Ctrl + T emebala-reader Cycles cultural themes: Mesopotamian Clay > Porcelain > Hanji.

🔧 Portable config.json Schema

In Emebala Chat (Emebalachat/src/config.cpp#L477-483), configuration is stored directly beside the executable as GetExecutableDir() / "config.json". Below is the exact 18-key flat schema from code:

config.json (Authentic Flat Schema from C++ codebase)
{
  "ui_language": "auto",
  "engine_type": "auto",
  "model_path": "models/Hy-MT2-1.8B-Q8_0.gguf",
  "source_language": "Auto Detect",
  "target_language": "English",
  "auto_send": false,
  "sound_enabled": true,
  "drag_to_translate": true,
  "cloud_fallback_enabled": false,
  "drag_hotkey": "double_ctrl_c",
  "hotkey_toggle": "F9",
  "hotkey_lang": "Ctrl+F9",
  "hotkey_mode": "Ctrl+Shift+Enter",
  "temperature": 0.7,
  "top_p": 0.6,
  "top_k": 20,
  "repetition_penalty": 1.05,
  "badge_x": -1,
  "badge_y": -1
}
💡
cloud_fallback_enabled Privacy Gate: Defaults to false. When false, your text is strictly kept on local silicon and never dispatched to any external HTTP fallback under any condition.

Troubleshooting & Frequently Asked Questions

Q1: Why does in-place replacement not trigger inside Administrator command prompts?

Windows User Interface Privilege Isolation (UIPI) restricts standard user applications from sending synthetic keyboard events to elevated processes. If you wish to translate inside elevated terminals, run Emebala Chat as Administrator.

Q2: How do I enable additional TTS voices in Emebala Chat?

Navigate to Windows Settings > Time & Language > Speech > Manage Voices > Add voices. Install your preferred language pack. Emebala Chat's COM enumerator detects new voices immediately without requiring a restart.

Q3: How do I perform a completely clean uninstallation?

Because Emebala Chat is fully portable, simply exit the application via system tray and delete its folder. There are no leftover background registry keys or background services.

GitHub Organization ↗ Sponsor on Gumroad ↗ Contact Founder Team →