Skip to content

wimi321/Beacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Beacon

Beacon

Your phone becomes a survival AI — powered by Gemma 4 running entirely on-device, no internet needed.

Beacon turns any Android phone into an offline emergency tool.
Real AI inference. 14,406 expert knowledge entries. Zero cloud dependency.
Built for earthquakes, wildfires, wilderness, and every moment when the network is gone.

Release Downloads CI Stars License

Offline First Gemma 4 LiteRT Android iOS Languages

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Français · Deutsch · Português · العربية

Beacon — offline emergency AI demo


Download

Tip

Get started in 2 minutes: Install APK → open Settings & Models → download Gemma 4 E2B (~2.6 GB) → fully offline.

Download APK

Choose your model:

Model Size Best for
Gemma 4 E2B ~2.6 GB Fast setup, recommended for most devices
Gemma 4 E4B ~3.7 GB Higher accuracy, needs more RAM

Model downloads are resumable and use an ordered mirror list. Beacon tries the China-friendly ModelScope CDN first, then falls back to hf-mirror.com and the official Hugging Face URL if an earlier source is unavailable.


What Makes Beacon Different

🧠 Real On-Device AI — Gemma 4 (2B / 4B parameters) runs entirely on your phone via Google's LiteRT runtime. No cloud, no API keys, no data leaves your device. Ever.

📡 Works When Networks Don't — Designed for earthquakes, hurricanes, wildfires, and conflict zones. Beacon works in airplane mode, in basements, and off the grid.

📚 14,406 Expert Knowledge Entries — Bundled offline from the US Army Survival Manual, WHO, CDC, Red Cross, NPS, Ready.gov, and more. Retrieved locally before every AI response.

📸 Visual Emergency Analysis — Point your camera at an injury, a plant, or a hazard. The on-device model analyzes what it sees and provides guidance.

🌍 20 Languages, Including RTL — From English to Arabic, switch instantly in-app. No extra download required.

🔋 Crisis-Optimized UX — Large panic buttons, high-contrast OLED palette, minimal cognitive load. Designed for shaking hands and racing hearts.


When You Need Beacon

After an earthquake — Cell towers are down. You have a deep cut and no first-aid training. Beacon walks you through wound care step by step, grounded in Red Cross and WHO protocols, running entirely on your phone.

Lost in the wilderness — No signal, no map app. Beacon's offline knowledge base covers shelter building, water purification, navigation, and plant identification from the US Army Survival Manual.

During a chemical spill — Conflicting information, overwhelmed emergency lines. Beacon retrieves CDC and Ready.gov hazmat guidance instantly — no internet required.


Screenshots

Beacon home — English    Beacon home — Chinese    Beacon home — Arabic RTL

English · 简体中文 · العربية (RTL)

More localized demos: 日本語 · 한국어 · Español · Français · Deutsch · Português · 繁體中文


Architecture

All inference runs locally on the device. No data is sent to any server.

flowchart TD
    A["User input or photo"] --> B["React + Capacitor mobile UI"]
    B --> C["Local retrieval engine"]
    C --> D["Prompt composer + session memory"]
    D --> E["Native Beacon bridge"]
    E --> F["LiteRT / Gemma 4 on-device runtime"]
    F --> E
    E --> B
    B --> G["Camera / photo picker"]
    B --> H["Battery / device / geolocation"]
    B --> I["SOS packaging and future mesh relay"]
Loading

Stack: React + TypeScript frontend → Capacitor native bridge → Kotlin (Android) / Obj-C++ (iOS) → LiteRT-LM → Gemma 4


Gemma 4 Good Hackathon

Beacon is being prepared as a public-good submission for The Gemma 4 Good Hackathon, with the strongest fit in Global Resilience, Safety & Trust, Digital Equity, and the LiteRT technology track.

The judge-verifiable submission pack lives in docs/competition:

  • competition strategy and track fit
  • Kaggle writeup draft
  • 3-minute video script
  • architecture proof
  • real-device validation plan
  • data license review

Run the local readiness audit:

npm run competition:audit

Knowledge Base

Note

Beacon's knowledge base contains 6,332 source records and 14,406 entries compiled from authoritative emergency sources. All data is bundled in the app — no download or internet needed after install.

Sources include:

  • US Army — FM 21-76 / FM 3-05.70 Survival Manual
  • WHO — Emergency health and snakebite protocols
  • CDC — Outdoor hazards, radiation, poisoning, heat/cold guidance
  • American Red Cross — First aid and disaster response
  • Ready.gov — FEMA disaster, radiation, shelter-in-place, wildfire, flood
  • NPS / NWS / NOAA — Wilderness safety and severe weather
  • NHS / MedlinePlus / Merck Manual — Medical references

The knowledge base provides retrieval grounding. When retrieval misses a scenario, Beacon still performs real local model inference — it never falls back to template output.

For public competition submissions, third-party full-text sources require a separate license review or a competition-safe source profile. See docs/competition/DATA_LICENSES.md.


Languages

Beacon supports 20 UI languages including Arabic RTL. The app detects device locale or allows manual switching at any time.

README documentation is available in 10 locales with localized hero demos.

View all 20 supported languages
Code Language Native Name Direction
en English English LTR
zh-CN Chinese (Simplified) 简体中文 LTR
zh-TW Chinese (Traditional) 繁體中文 LTR
ja Japanese 日本語 LTR
ko Korean 한국어 LTR
es Spanish Español LTR
fr French Français LTR
de German Deutsch LTR
pt Portuguese Português LTR
ru Russian Русский LTR
ar Arabic العربية RTL
hi Hindi हिन्दी LTR
id Indonesian Bahasa Indonesia LTR
it Italian Italiano LTR
tr Turkish Türkçe LTR
vi Vietnamese Tiếng Việt LTR
th Thai ไทย LTR
nl Dutch Nederlands LTR
pl Polish Polski LTR
uk Ukrainian Українська LTR

Localized documentation: CONTRIBUTING · SECURITY · I18N Guide — each available in up to 10 locales.


Quick Start

Prerequisites

  • Node.js 20+
  • npm
  • Android Studio / Android SDK
  • Xcode (for iOS)

Install & Build

# Install dependencies
npm install

# Build web app + sync native shells
npm run mobile:build

# Open in Android Studio
npm run mobile:android

# Open in Xcode
npm run mobile:ios

Build Release APK

# Standard release: APK only, users download Gemma in-app
npm run mobile:android:release

# GitHub APK release: APK only, arm64 only
npm run mobile:android:release:github

# Optional internal build: intentionally bundle Gemma E2B in the APK
npm run mobile:android:release:bundled

Other Commands

npm test                    # Run frontend tests
npm run build               # Build web app
npm run knowledge:build     # Rebuild offline knowledge base
npm run readme:demo         # Regenerate README demo assets

Testing

# Frontend tests
npm test

# Android native
cd android && ./gradlew testDebugUnitTest

# Dart backend
dart test

# Type check
npx tsc --noEmit

Roadmap

  • Offline-first retrieval and grounded local Gemma 4 inference
  • 20-language UI with manual switching and Arabic RTL
  • Native Android and iOS shells with Capacitor bridge
  • Camera and photo intake for visual emergency guidance
  • Session memory for continuous emergency conversations
  • WCAG AA accessibility (focus indicators, reduced motion, contrast)
  • Prompt injection defense with structural markers
  • Mesh relay and peer-to-peer SOS propagation
  • iPhone release-device GPU path validation
  • Public benchmark and evaluation suite
  • Store-grade release packaging

Contributing

Contributions are welcome — especially in emergency medicine review, survival knowledge curation, multilingual localization, mobile runtime optimization, real-device QA, and accessibility.

Please see CONTRIBUTING.md for guidelines. When reporting issues, include your device model, OS version, and the exact prompt or scenario.


Safety Notice

Important

Beacon is an emergency assistance tool, not a replacement for licensed medical care, rescue services, or professional incident response.

  • Always call local emergency services when a network is available
  • Treat Beacon guidance as last-mile survival support for disrupted environments
  • Validate high-risk decisions against trained professionals whenever possible

Acknowledgments

Beacon's offline knowledge base is built from publicly available emergency guidance:

US Army · WHO · CDC · American Red Cross · Ready.gov (FEMA) · NPS · NWS / NOAA · NHS · MedlinePlus · Merck Manual

Powered by Google Gemma 4 via LiteRT.


License

Beacon is released under the Apache-2.0 License.