{"id":50342659,"url":"https://github.com/profrandom92/comptext-termux-v2","last_synced_at":"2026-05-29T18:00:42.421Z","repository":{"id":355217523,"uuid":"1227146696","full_name":"ProfRandom92/comptext-termux-v2","owner":"ProfRandom92","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-02T12:49:59.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-02T14:22:38.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProfRandom92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-02T09:17:00.000Z","updated_at":"2026-05-02T12:50:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ProfRandom92/comptext-termux-v2","commit_stats":null,"previous_names":["profrandom92/comptext-termux-v2"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ProfRandom92/comptext-termux-v2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfRandom92%2Fcomptext-termux-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfRandom92%2Fcomptext-termux-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfRandom92%2Fcomptext-termux-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfRandom92%2Fcomptext-termux-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProfRandom92","download_url":"https://codeload.github.com/ProfRandom92/comptext-termux-v2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfRandom92%2Fcomptext-termux-v2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33664259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-29T18:00:41.304Z","updated_at":"2026-05-29T18:00:42.412Z","avatar_url":"https://github.com/ProfRandom92.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comptext-termux-v2\n\n[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![Platform](https://img.shields.io/badge/Platform-Termux%20%7C%20Android%20%7C%20Windows-green?logo=android\u0026logoColor=white)](https://termux.dev)\n[![LLM](https://img.shields.io/badge/LLM-Groq%20%7C%20llama--server-orange?logo=meta\u0026logoColor=white)](https://groq.com)\n[![MCP](https://img.shields.io/badge/MCP-comptext--mcp--server-purple?logo=github\u0026logoColor=white)](https://github.com/ProfRandom92/comptext-mcp-server)\n[![License](https://img.shields.io/badge/License-MIT-lightgrey)](LICENSE)\n[![Status](https://img.shields.io/badge/Status-Active%20Development-brightgreen)](https://github.com/ProfRandom92/comptext-termux-v2/commits/master)\n\n\u003e **Das Problem:** Medizinische LLM-Workflows auf Edge-Geräten scheitern an Kontext-Limits, nicht an Modellqualität.  \n\u003e **Die Lösung:** CompText komprimiert klinischen Kontext um 60–90 % bevor er das Modell erreicht — ohne Informationsverlust.\n\nMedizinisches Triage-System + CompText Runtime für Android/Termux \u0026 Windows.  \nOffline-first · ePA-kompatibel · Touch-optimiert (Galaxy A33) · RTK-style Output-Kompression für LLM-Workflows.\n\n---\n\n## ⚡ Quick-Win — 60 Sekunden bis zum ersten Output\n\n```bash\ngit clone https://github.com/ProfRandom92/comptext-termux-v2\ncd comptext-termux-v2\npip install textual httpx aiosqlite pyyaml\n\n# MedCodex-Kompression direkt testen:\npython med_codex.py \"MAB+HS, RR↓, HF↑ → ACS?\"\n\n# Runtime-Layer (Shell-Output-Kompression):\ngit diff | python -m runtime.cli --cmd \"git diff\"\n\n# Codex-Status prüfen:\npython codex_manager_cli.py --status\n```\n\n---\n\n## 📊 Benchmark\n\n```\n$ git diff | python -m runtime.cli --cmd \"git diff\"\n✦ CompText RTX · Profil: dev · 84.9% gespart · 265 von 312 Zeilen eliminiert\n\n$ pytest | python -m runtime.cli --cmd \"pytest\"\n✦ CompText RTX · Profil: dev · 71.2% gespart · nur Fehler \u0026 Summary behalten\n\n$ cat befund.txt | python -m runtime.cli --cmd \"med\"\n✦ CompText RTX · Profil: med · 58.4% gespart · KVTC-Normalisierung aktiv\n```\n\n| Profil | Anwendungsfall         | Typische Ersparnis |\n|--------|------------------------|-------------------|\n| `dev`  | git, pytest, cargo     | 40–80 %           |\n| `med`  | Befunde, HL7, KVTC     | 30–60 %           |\n| `repo` | ls, find, JSON, sqlite | 50–70 %           |\n| `log`  | tail, grep, journald   | 60–90 %           |\n\n---\n\n## 🧬 KVTC — Klinisches Vokabular Token Compression\n\nEin eigenes CompText-Subsystem: medizinische Freitext-Eingaben werden vor der LLM-Übergabe auf standardisierte Kürzel normalisiert.\n\n```\nEingabe:   \"MAB+HS, RR↓, HF↑ → ACS?\"\nExpanded:  \"Massive arterielle Blutung mit hämorrhagischem Schock,\n            Hypotonie, Tachykardie → Akutes Koronarsyndrom?\"\n```\n\n**KVTC-Merkmale:**\n- 70+ medizinische Kürzel (erweiterbar per Codex CLI)\n- ICD-10, LOINC, OPS integriert\n- Mehrdeutigkeit explizit modelliert (`OD` → Ophthalmologie / Überdosis / Einmal täglich)\n- Synonym-Normalisierung (`ACS` = `NSTEMI/STEMI` = `Akutes Koronarsyndrom`)\n- 30–60 % Reduktion bei klinischen Texten ohne Informationsverlust\n- ePA-kompatibel: Ausgabe direkt als FHIR-Kontext nutzbar\n\nKVTC differenziert CompText von generischen Token-Compressors — das System kennt medizinische Semantik, nicht nur Zeichenersparnis.\n\n---\n\n## Architektur\n\n```mermaid\nflowchart TD\n    subgraph INPUT[\"Eingabe\"]\n        TUI[\"comptrage.py\\nTextual TUI\"]\n        CLI[\"codex_manager_cli.py\\nCodex CLI\"]\n        SHELL[\"Shell / Git Bash / Termux\\nBeliebige CLI-Kommandos\"]\n    end\n\n    subgraph RUNTIME[\"comptext-runtime (RTK-Layer)\"]\n        HOOK[\"hooks/comptext-rtx-hook.sh\"]\n        CTR[\"runtime/cli.py\\nctr \u003ccmd\u003e\"]\n        PROFILES[\"Profile:\\ndev / med / repo / log\"]\n        FILTERS[\"Filter-Pipeline:\\ndrop_lines → keep_section\\ncollapse_repeats → max_lines\\nabbreviate_medical · json_extract\"]\n        METRICS[\"metrics.py\\nGain-Banner (stderr)\"]\n    end\n\n    subgraph CORE[\"CompText Core\"]\n        KVTC[\"KVTC\\nKlinisches Vokabular\\nToken Compression\"]\n        MEDCODEX[\"med_codex.py\\n70+ Kürzel\"]\n        MEDDB[\"med_db.py\\nSQLite + Memory Palace\"]\n        ENGINE[\"codex_engine.py\\nLLM-Modul-Generator\"]\n        CODEXMGR[\"codex_manager.py\\nFachgebiet-Verwaltung\"]\n    end\n\n    subgraph LLM[\"LLM-Backend\"]\n        GROQ[\"Groq API\\nllama-3.1-8b-instant\"]\n        LOCAL[\"llama-server :8080\\nMedGemma 4B GGUF (lokal)\"]\n        MCP[\"comptext-mcp-server\\nMCP/REST :8100\"]\n    end\n\n    SHELL --\u003e HOOK --\u003e CTR --\u003e PROFILES --\u003e FILTERS --\u003e METRICS\n    TUI --\u003e KVTC --\u003e MEDCODEX\n    CLI --\u003e CODEXMGR\n    FILTERS --\u003e|komprimierter Output| LLM\n    MEDCODEX --\u003e MEDDB\n    ENGINE --\u003e LOCAL\n    ENGINE --\u003e GROQ\n    CODEXMGR --\u003e LOCAL\n    CODEXMGR --\u003e GROQ\n    CTR --\u003e|--mcp Flag| MCP\n    MCP --\u003e GROQ\n```\n\n---\n\n## Module auf einen Blick\n\n| Modul | Datei | Funktion |\n|-------|-------|----------|\n| **TUI** | `comptrage.py` | Touch-optimierte Triage-Oberfläche |\n| **Codex CLI** | `codex_manager_cli.py` | LLM-gestützter Codex-Manager |\n| **Codex TUI** | `codex_manager_tui.py` | Interaktive Codex-Verwaltung |\n| **KVTC / MedCodex** | `med_codex.py` | Klinische Token-Kompression, 70+ Kürzel |\n| **MedDB** | `med_db.py` | Async SQLite, Memory Palace, Triage-History |\n| **Med Specialties** | `med_specialties.py` | Fachgebiet-Definitionen |\n| **Codex Engine** | `codex_engine.py` | LLM-basierter Modul-Generator |\n| **Runtime** | `runtime/` | RTK-Layer: Shell-Output-Kompression |\n| **MediaPipe** | `mediapipe_server.py` | Alternatives LLM-Backend (Google MediaPipe) |\n\n---\n\n## comptext-runtime (RTK-Layer)\n\nDie `runtime/`-Schicht komprimiert Shell-Outputs **bevor sie in den LLM-Kontext** gehen — inspiriert von RTK, Snip und mcp-compressor.\n\n```mermaid\nsequenceDiagram\n    participant Shell\n    participant Hook as comptext-rtx-hook.sh\n    participant CLI as runtime/cli.py\n    participant Filter as Filter-Pipeline\n    participant LLM\n\n    Shell-\u003e\u003eHook: git diff | ctr git diff\n    Hook-\u003e\u003eCLI: stdin + --cmd \"git diff\"\n    CLI-\u003e\u003eFilter: Profil 'dev' laden\n    Filter--\u003e\u003eCLI: Komprimierter Output\n    CLI-\u003e\u003eShell: stdout (gekürzt)\n    CLI-\u003e\u003eShell: stderr: ✦ Gain-Banner [84.9% gespart]\n    CLI--\u003e\u003eLLM: optional --mcp weiterleiten\n```\n\n### Schnellstart Runtime\n\n```bash\n# Termux:\nbash scripts/install_hook_termux.sh \u0026\u0026 source ~/.bashrc\n\n# Git Bash (Windows):\nbash scripts/install_hook_gitbash.sh \u0026\u0026 source ~/.bashrc\n\n# Danach:\nctr git diff\nctr git status\nctr pytest\n\n# Manuell (stdin-Pipeline):\ngit diff | python -m runtime.cli --cmd \"git diff\"\n```\n\n---\n\n## Codex Manager CLI\n\n```bash\npython codex_manager_cli.py --status\npython codex_manager_cli.py --auto-fill neurologie --count 20\npython codex_manager_cli.py --auto-fill all --count 15\npython codex_manager_cli.py --generate-skills --output ~/.hermes/skills\npython codex_manager_cli.py --test-compression\npython codex_manager_cli.py --export-json ~/codex_backup.json\n```\n\n---\n\n## Setup\n\n### Termux (Android)\n```bash\nbash setup_termux.sh\n```\n\n**Manuell:**\n```bash\npkg install tur-repo \u0026\u0026 pkg update \u0026\u0026 pkg install llama-cpp\npip install textual httpx aiosqlite pyyaml\n\n# MedGemma laden:\nwget https://huggingface.co/unsloth/medgemma-1.5-4b-it-GGUF/resolve/main/medgemma-1.5-4b-it-Q4_K_M.gguf -P models/\n\n# Tab 1 – Server:\nllama-server -m models/*.gguf --port 8080 -c 2048 -t 4\n\n# Tab 2 – App:\npython comptrage.py\n```\n\n### Groq API (Empfohlen für PC/Windows)\n```bash\nexport GROQ_API_KEY=\"dein-key\"   # https://console.groq.com\npython codex_manager_cli.py --status\npython codex_manager_cli.py --auto-fill neurologie --count 10\n```\n\n---\n\n## Quick-Events (TUI Hotkeys)\n\n| Hotkey | Event |\n|--------|-------|\n| `B` | P1: Massivblutung |\n| `H` | P1: ACS/Herzinfarkt |\n| `A` | P1: Anaphylaxie |\n| `S` | P1: Sepsis |\n| `T` | P2: SHT/Sturz |\n| `K` | P1: REA Kind |\n\n---\n\n## Repo-Struktur\n\n```\ncomptext-termux-v2/\n├── comptrage.py              # Haupt-TUI (Textual, Touch-optimiert)\n├── codex_manager_cli.py      # Codex Manager CLI\n├── codex_manager_tui.py      # Codex Manager TUI\n├── codex_manager.py          # Codex Core-Logik\n├── codex_engine.py           # LLM-Modul-Generator\n├── med_codex.py              # KVTC + Token-Kompression (70+ Kürzel)\n├── med_db.py                 # Async SQLite + Memory Palace\n├── med_specialties.py        # Fachgebiete\n├── mediapipe_server.py       # Option B: MediaPipe Backend\n├── setup_termux.sh           # Ein-Kommando-Setup\n├── runtime/                  # CompText RTK-Layer\n│   ├── cli.py                  #   Entrypoint: stdin → Filter → stdout\n│   ├── metrics.py              #   Gain-Berechnung + Banner\n│   ├── mcp_client.py           #   Optional: weiterleiten an MCP-Server\n│   ├── profiles/               #   dev / med / repo / log YAML\n│   └── filters/                #   7 Filter-Module\n├── hooks/\n│   └── comptext-rtx-hook.sh    # RTX Bash-Hook\n├── scripts/\n│   ├── install_hook_termux.sh  # Termux-Install\n│   └── install_hook_gitbash.sh # Git Bash-Install\n├── docs/\n├── modules/                  # Generierte Module (via /gen)\n├── skills/                   # Hermes Skill-Dateien\n├── models/                   # GGUF-Modelle (nicht in Git)\n└── data/                     # SQLite-DBs (nicht in Git)\n```\n\n---\n\n## 🌐 CompText Ökosystem\n\n| Repo | Zweck | Status |\n|------|-------|--------|\n| [comptext-termux-v2](https://github.com/ProfRandom92/comptext-termux-v2) | Android/Termux · Triage-UI · RTK-Runtime · KVTC | 🟢 Active |\n| [comptext-mcp-server](https://github.com/ProfRandom92/comptext-mcp-server) | MCP/REST-Server · Docker · CI/CD | 🟢 Active |\n| [Medgemma-CompText](https://github.com/ProfRandom92/Medgemma-CompText) | Kaggle Hackathon · ePA/FHIR · Edge-AI | 🟢 Active |\n| [comptext-codex](https://github.com/ProfRandom92/comptext-codex) | Native Protocol für Claude Agent Teams | 🔵 Stable |\n| [comptext-context](https://github.com/ProfRandom92/comptext-context) | V5 × Context Mode · FTS5 · Sandbox | 🟡 Beta |\n| [comptext-kernel](https://github.com/ProfRandom92/comptext-kernel) | V6 Universal AI Context Kernel | 🟡 Beta |\n| [comptext-revolution](https://github.com/ProfRandom92/comptext-revolution) | DSL Compiler · MCP · SQLite FTS5 | 🧪 Experimental |\n| [comptext-dsl](https://github.com/ProfRandom92/comptext-dsl) | Domain-Specific Language · Compiler · Parser | 🔵 Stable |\n\n---\n\n*CompText Ecosystem — ProfRandom92 — 2026*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofrandom92%2Fcomptext-termux-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofrandom92%2Fcomptext-termux-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofrandom92%2Fcomptext-termux-v2/lists"}