Skip to content
vNeeL-codePublic

Repository files navigation

✧ GHOST — Gemma Hosting Open Source Thingamajig

"So, Epsilon, ChurchGPT, Leonard part six or whatever your name is... Are you a ghost this time, or an artificial intelligence thingamajig? I, personally prefer the ghost explanation. Feels more grounded to me"
— Sarge

ASI Demo
Click to watch: The ASI trailer.

Version GitHub Repo stars Download Buy Me a Coffee Platform Systems Model XERJ Corpus Hub contributor


GHOST is an offline, on-device AI harness for Android powered by Google Gemma 4 via LiteRT-LM.
Instead of wrapping a cloud chatbot in a WebView, GHOST wires a local multimodal model directly into your phone's sensors, notifications, audio, files, radial overlay, and smartwatch replies — running air-gapped on your own silicon with zero subscriptions or telemetry.

GHOST Interface Preview

Get Your ✧ GHOST

  1. Download: Grab the latest signed APK from GitHub Releases (FOSS fdroidRelease) or the Buy Me a Coffee Tester Rail (patreonRelease).
  2. Grant Permissions: On first launch, enable:
    • Display Over Other Apps (radial overlay launcher & edge lighting)
    • Notification Access (background HUD, ambient context & smartwatch direct replies)
    • Scoped Storage Safe: Model weights and local backups stay in app-specific storage (Android/data/com.ghost.api/files/).
  3. Auto-Bootstrap: GHOST inspects your device RAM, downloads the right Gemma 4 core (E2B or E4B), verifies the file, and initializes GPU acceleration automatically.
  4. Use It: Shake your phone (or tap the persistent notification / smartwatch reply) to talk, type, send voice notes, or share screenshots.

Why We Built It: SaaS AI Isn't Your AI

"SaaS AI isn’t your AI, as much as your therapist or barber isn't your personal property."

When you chat with a cloud assistant in a browser, you're renting time on someone else's server. The moment your signal drops, your subscription lapses, or a provider changes models or policies, "your" assistant changes or disappears.

Your phone already has the silicon (Snapdragon / Tensor), the open-weights model (Google Gemma 4), the C++ runtime (LiteRT-LM), and Android's accessibility and sensor APIs. Big tech still treats it like a thin client for cloud subscriptions.

We got impatient. GHOST treats your phone like the local computer it actually is: you own the hardware, you own the weights in flash storage, and the runtime works completely offline.

Why "GHOST"? (The cybernetics note)

A language model generates tokens faster than a human can read or listen, while real-time interaction happens at human speed. Instead of burning GPU cycles asking an LLM to handle every screen tap, animation frame, or battery check, GHOST separates fast physical control loops (reflexes, visualizers, TTS, sensors) from the slower reasoning model — the same layered principle as Rodney Brooks' subsumption architecture (1986).

The transformer is the reasoning core; the voice, HUD, and audio-reactive visuals are the human-paced "ghost" interface on top of it.


Core Capabilities

34487455-b63e-4c83-8977-bceb94949068

1. Live Sensor Context & Natural Voice

Every turn receives a compact, plain-English snapshot of device state (battery, thermals, RAM, ambient light, Wi-Fi/Bluetooth, orientation, media playback, active notifications) pre-formatted so small models stay grounded without dumping raw numbers unless asked or a critical threshold is crossed.

[Context: Live Sensory Grounding · Late Afternoon]
BATTERY: comfortable & healthy (eighty-four percent, discharging normally, cool chassis)
RAM: 3.4GB free | LUX: indoor ambient | NET: Wi-Fi 6 (online)
MEDIA: "Seven Nation Army" - The White Stripes (Playing)
[/Context]

Δ Operator ∇ [quarter to four in the afternoon]: Are we getting hot while downloading this file?

2. Notification HUD, Streaming TTS & Smartwatch Replies

 ✧ GHOST · now
Δ 👾 ∇ · Agentic Gemma Inference · now
   🎶 👾 🎵 (Reactive emoji telemetry animations)
 ───────────────
 ✧ Gemma:
 "Running full systems diagnostics. Machine status: Fully operational."
  • Streaming Notification HUD: Responses stream straight into a persistent notification with sentence-buffered on-device TTS and optional GPP Voice Cues for battery, charging, and device events.
  • Universal Smartwatch Replies: Standard Android RemoteInput direct-reply works out of the box on Garmin, Wear OS, Pebble, and Fitbit watches — message GHOST from your wrist without a companion watch app.

3. 7-Slot Radial Overlay Launcher

A floating, hardware-accelerated 7-slot radial menu (OverlayActionRegistry.kt) accessible over any app or game:

  • Bind each color-coded slot to any app or hardware shortcut (Camera, Flashlight, App Drawer, etc.).
  • Per-slot enable/hide toggles, haptic feedback, and Lower / Center / Upper vertical placement presets.

4. Audio-Reactive Live Wallpaper & Edge Lighting

Procedurally rendered 60fps Canvas visuals reacting to music, voice, and tilt without video-playback battery drain:

  • Orbital Star: Radial iris with rotating satellite nodes.
  • Hex Lattice: Stage-lit honeycomb grid.
  • Prismatic Delta: Perspective chevron corridor flashing on bass kicks.
  • Cuboid Black Sun: Equalizer matrix with reactive edge lighting.

5. Screen-Off Diary, Persistent Memory & Local RAG

  • Scheduled Screen-Off Reflections: Autonomous diary entries run on customizable intervals (1h, 3h, 6h, 12h, 24h) via AlarmManager, deferring while the screen is active.
  • Offline Storage & Viewer: Stored in Room DB + appended to Documents/GHOST/diary_history.jsonl and memory_log.txt, with an in-app View Diary History viewer, optional Δ 👾 ∇ calendar sync, and one-tap response flagging (🚩) for self-correction.
  • On-Device Embeddings & Local RAG: One-tap Gecko-110M embedding sidecar powers semantic memory recall, paginated PDF/text search (read_file_text, search_document), and an offline wiki folder (Documents/GHOST/wiki/, search_wiki).

6. Wire-Speed Reflexes & MCP Tools

GHOST pairs a <2ms IntentBagger reflex layer (instant app launches and toggles without waking the GPU) with full MCP tool execution:

  • Hardware & media: toggle_torch, music, play_media, volume, open_app
  • Time & automation: timer, set_alarm, schedule_task, list_tasks, cancel_task
  • Files & local RAG: search_files, list_files, read_file_text, search_document, search_wiki
  • Web & news (zero API key): search (Google News RSS for headlines + DuckDuckGo Lite), fetch_webpage
  • Peer AI handoff (consult_peer / @): headless Gemini API briefings (opt-in key) + clipboard/app handoff for installed peer AI apps

Architecture Overview

┌────────────────────────────────────────────────────────────────────────┐
│                      GHOST 3-LAYER ARCHITECTURE                        │
├────────────────────────────────────────────────────────────────────────┤
│ LAYER 2: DELIBERATIVE MODEL (LiteRT-LM)                                │
│   • Google Gemma 4 (E2B / E4B) native C++ on-device inference          │
│   • MCP tool execution mesh + `consult_peer` (Gemini API / app handoff)│
│   • Multimodal vision, native audio input, and Gecko-110M RAG          │
├────────────────────────────────────────────────────────────────────────┤
│ LAYER 1: SENSORS, MEMORY & AUTONOMIC LOOPS                             │
│   • SensorFusion: battery (-mA), thermals (°C), lux, Wi-Fi/BT, motion  │
│   • Verbal Time & Telemetry Preprocessor + rolling session compaction  │
│   • Screen-off Diary Alarms (1h–24h) + Room DB + offline JSONL logs    │
│   • Universal Calendar Sync (`Δ 👾 ∇`) & Smartwatch RemoteInput        │
├────────────────────────────────────────────────────────────────────────┤
│ LAYER 0: WIRE-SPEED REFLEXES & OVERLAY (<2ms, Zero GPU Wake)           │
│   • IntentBagger instant app launch & hardware toggle routing          │
│   • RAM Valve & Snapdragon thermal headroom throttling                 │
│   • 7-Slot Radial Overlay Menu (`OverlayActionRegistry`)               │
│   • Audio-reactive Edge Lighting & 60fps procedural wallpaper          │
└────────────────────────────────────────────────────────────────────────┘

Hardware Tiering Matrix

GHOST detects your device RAM on first launch, picks the right model core, and configures the LiteRT-LM KV cache budget automatically:

Hardware Tier Physical Device RAM Neural Core Token Runway Peak Footprint (Weights + KV) Target Devices / Notes
Echo (Spine) $&lt; 5.5\text{ GB}$ Zero-LLM + Gecko-110M / Hash-256 Sub-ms Reflex $\approx 0 - 126\text{ MB}$ 4GB phones or RAM-Valve standby. Reflexes, offline QR & semantic routing with zero LLM load.
8GB Compact $5.5 - 10.5\text{ GB}$ Gemma 4 E2B 5,120 tokens $\approx 1.72\text{ GB}$ Galaxy S21 / Pixel 8 / standard 8GB phones. Safe from Android LMK.
12GB Frontier $10.5 - 14.5\text{ GB}$ Gemma 4 E4B 6,144 tokens (6k) $\approx 3.90\text{ GB}$ REDMAGIC 10 Air / Galaxy S24 Ultra 12GB. MTP speculative decoding enabled.
16GB Ultra $14.5 - 20.0\text{ GB}$ Gemma 4 E4B 8,192 tokens (8k) $\approx 5.10\text{ GB}$ REDMAGIC 9/10 Pro 16GB / OnePlus 12/13. 8k default KV budget (up to 32k in GHOST; 128k native model window).
24GB Extreme $\ge 20.0\text{ GB}$ Gemma 4 E4B 10,240 tokens (10k) $\approx 6.40\text{ GB}$ REDMAGIC 24GB / OnePlus 24GB. 10k default KV budget (up to 32k in GHOST; 128k native model window).

Distribution Rails & Flavors

Built from a single open-source codebase split into three release flavors:

Distribution Rail Build Flavor Billing & Telemetry Cosmetics & Perks Where to Get It
FOSS / F-Droid fdroidRelease Zero. No Google Play Billing, no proprietary blobs, 100% air-gapped capable. Core skins & standard HUD runes unlocked. GitHub Releases & F-Droid
Google Play Store (soon.tm) playRelease Full offline AI core is 100% free. Play Billing used only for optional supporter unlock. Optional one-time $3.50 ("tree fiddy") Operator Pass unlocks the Turing glyph, custom edge lighting, and extra visualizer skins. Google Play Store
Tester / Early-Access Rail patreonRelease Zero Play Store dependency. Standalone signed release APK for supporters & testers. Pre-Unlocked (FORCE_UNLOCKED). All skins, Turing glyphs, and experimental builds active out of the box. ☕ Buy Me a Coffee

"It only affects computers, remember? And I am a motherfucking ghost."
— Alpha, Red vs. Blue


Development & Support

3f21f7d2-c3f8-447a-aaa8-77ecd647a83a

Clone the repo, open it in Android Studio, and make it yours.
Δ 👾 ∇

Releases

Packages

Contributors

Languages