Skip to content

Deepak-karani/roost

Repository files navigation

πŸ‰ Roost

Grow your dragon by spending wisely. An offline, on-device budgeting game powered by Qualcomm Snapdragon NPU + Google LiteRT-LM.

Track 1: LLM Based Consumer Use Journeys Google AI Edge x Qualcomm Hackathon 2026

Earlier name: DragonBudget. The app, the package, and most code identifiers still use that name; Roost is the user-facing brand only.

πŸ“² Download

⬇️ Download Roost v1.0 APK (106 MB)

Requires an Android device with a Snapdragon 8 Elite NPU (e.g. Galaxy S25 Ultra) for the on-device Gemma 4 model. After installing, push the model file:

adb push gemma-4-E2B-it.litertlm /sdcard/Android/data/com.example.dragonbudget/files/

The model file (~2.4 GB) is downloadable from HuggingFace. All other releases are listed here.


πŸ› οΈ Building from source

This repo deliberately does not ship the Qualcomm Snapdragon NPU native libraries β€” they're 80+ MB each and come from the Qualcomm QNN SDK. To build the APK locally:

  1. Install the Qualcomm QNN SDK and the LiteRT-LM AAR.
  2. Drop the following .so files into app/src/main/jniLibs/arm64-v8a/:
    • libLiteRt.so
    • libLiteRtDispatch_Qualcomm.so (must be patched β€” see below)
    • libLiteRtGpuAccelerator.so
    • libLiteRtOpenClAccelerator.so
    • libLiteRtTopKOpenClSampler.so, libLiteRtTopKWebGpuSampler.so, libLiteRtWebGpuAccelerator.so
    • libGemmaModelConstraintProvider.so
    • libQnnHtp.so, libQnnHtpPrepare.so, libQnnHtpV79Skel.so, libQnnHtpV79Stub.so, libQnnSystem.so
  3. The dispatch lib needs a one-time patchelf patch so it can find symbols from libLiteRt.so at dlopen time:
    brew install patchelf  # or apt install patchelf
    patchelf --add-needed libLiteRt.so app/src/main/jniLibs/arm64-v8a/libLiteRtDispatch_Qualcomm.so
  4. Download the Gemma 4 E2B universal LiteRT-LM model from HuggingFace and push it to the device:
    curl -L -o gemma-4-E2B-it.litertlm \
      "https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it.litertlm"
    adb push gemma-4-E2B-it.litertlm /sdcard/Android/data/com.example.dragonbudget/files/
  5. Build with JDK 17 (JAVA_HOME pointing to a real JDK, not a JRE):
    ./gradlew :app:assembleDebug
    adb install -r app/build/outputs/apk/debug/app-debug.apk

🎯 What is DragonBudget?

DragonBudget turns personal budgeting into a game. Users care for a virtual dragon called SnapDragon whose health, mood, and level directly reflect their spending habits. Log purchases, track budgets, and get personalized AI advice β€” all 100% offline on the Snapdragon 8 Elite NPU.

No cloud. No bank login. No tracking. Just you, your budget, and your dragon.


πŸ”₯ Core Features

Feature Description
Dragon Companion Visual health bar, XP, level, mood, and streak tracking
Purchase Logging Manual entry or AI-powered receipt scanning
Budget Tracking 8 categories with weekly limits and progress bars
Ask Dragon Natural language budgeting Q&A powered by on-device Gemma
Purchase History Full history with category filtering and spending totals
100% Offline All data stored locally via Room. Zero network calls.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Jetpack Compose UI                β”‚
β”‚  HomeScreen β”‚ AddPurchase β”‚ Budget β”‚ AskDragon β”‚ History β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    ViewModels (MVVM)                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              DragonBudgetRepository                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Room Databaseβ”‚ DragonEngine  β”‚   AI Engines          β”‚
β”‚  (SQLite)     β”‚ (Deterministicβ”‚   LocalLLMEngine      β”‚
β”‚  - Purchases  β”‚  health/XP    β”‚   ReceiptVisionEngine β”‚
β”‚  - Budgets    β”‚  mood logic)  β”‚   PromptBuilder       β”‚
β”‚  - DragonStateβ”‚               β”‚                       β”‚
β”‚  - AIAdvice   β”‚               β”‚                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚           LiteRT-LM / Qualcomm QNN NPU              β”‚
β”‚  Gemma 4 E2B β†’ Budget Advice Generation              β”‚
β”‚  FastVLM     β†’ Receipt/Item Scan Understanding       β”‚
β”‚  EmbeddingGemma β†’ Spending History Search (planned)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€– Model Stack

Model Source Role
Gemma 4 E2B litert-community/gemma-4-E2B-it-litert-lm Generates personalized budgeting advice via "Ask Dragon"
FastVLM 0.5B litert-community SM8750 Receipt scan β†’ extracts merchant, amount, category
EmbeddingGemma litert-community (Planned) Vector search over spending history

Why This Architecture?

  • Rule-based engine controls the dragon. Gemma explains decisions but never controls financial logic. This ensures deterministic, reliable behavior.
  • AI inference is triggered only on user action (scan receipt or ask question). No continuous drain.
  • LiteRT-LM compiled models run on the Snapdragon 8 Elite NPU for maximum speed and energy efficiency.
  • Memory scheduling: Only one model is loaded at a time to stay within NPU memory limits.

πŸ‰ Dragon Health Logic

Condition Effect
Purchase keeps category under 50% budget +5 XP
Category at 50–80% Mood β†’ "Alert"
Category at 80–100% Health βˆ’5, Mood β†’ "Worried"
Category exceeds 100% Health βˆ’15, Mood β†’ "Tired"
3-day logging streak Health +10, XP +20
Every 100 XP Level up
Health Range Mood
β‰₯ 85 πŸ‰ Energized
60–84 🐲 Stable
35–59 ⚠️ Worried
< 35 😴 Exhausted

πŸ“‚ Project Structure

app/src/main/java/com/example/dragonbudget/
β”œβ”€β”€ AppContainer.kt          # Simple DI container
β”œβ”€β”€ MainActivity.kt          # Compose entry point
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ Entities.kt          # Room entities + data classes
β”‚   β”œβ”€β”€ Daos.kt              # Room DAOs
β”‚   β”œβ”€β”€ DragonBudgetDatabase.kt
β”‚   └── DragonBudgetRepository.kt
β”œβ”€β”€ engine/
β”‚   β”œβ”€β”€ DragonStateEngine.kt # Deterministic health/XP logic
β”‚   β”œβ”€β”€ AIEngines.kt         # LLM + Vision interfaces + mocks
β”‚   └── PromptBuilder.kt     # Gemma prompt templates
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ Navigation.kt        # NavHost setup
β”‚   β”œβ”€β”€ theme/Theme.kt       # Snapdragon-inspired dark theme
β”‚   └── screens/
β”‚       β”œβ”€β”€ HomeScreen.kt
β”‚       β”œβ”€β”€ AddPurchaseScreen.kt
β”‚       β”œβ”€β”€ BudgetScreen.kt
β”‚       β”œβ”€β”€ AskDragonScreen.kt
β”‚       └── HistoryScreen.kt
└── viewmodel/
    β”œβ”€β”€ HomeViewModel.kt
    β”œβ”€β”€ AddPurchaseViewModel.kt
    β”œβ”€β”€ BudgetViewModel.kt
    β”œβ”€β”€ AskDragonViewModel.kt
    └── HistoryViewModel.kt

πŸš€ Setup & Run

Prerequisites

  • Android Studio Ladybug or newer
  • JDK 11+
  • Qualcomm device with Snapdragon 8 Elite (for NPU inference)

Build

git clone <repo>
cd hackk
./gradlew assembleDebug

Run

Open in Android Studio β†’ Select device β†’ β–Ά Run

(Optional) Push Gemma model for real AI

adb push gemma-4-E2B-it_qualcomm_sm8750.litertlm /sdcard/Download/

πŸ“Š Judging Criteria Fit

Criteria How DragonBudget Addresses It
Uses LiteRT / LiteRT-LM Gemma 4 via LiteRT-LM for advice; FastVLM for receipt scanning. Clean LocalLLMEngine interface with TODO-annotated LiteRtGemmaEngine placeholder.
Runs fully offline Room database, no INTERNET permission needed for core functionality. All AI inference on-device.
Uses provided HuggingFace models litert-community/gemma-4-E2B-it-litert-lm SM8750 variant
Resource utilization Rule-based engine handles 95% of logic; AI only fires on explicit user request. Single model loaded at a time.
Latency & performance NPU-accelerated. Rule-based dragon updates < 1ms.
Energy efficiency No background processing, no network polling, no always-on inference.
Easy to install and demo Standard Android Studio project. Mock engines work without model files.
Clear code & documentation MVVM + Repository + clean interfaces. This README.

πŸ”§ LiteRT-LM Integration Points

The codebase is structured for easy model integration:

  1. AIEngines.kt β€” LiteRtGemmaEngine class with TODO comments showing exact integration steps
  2. AIEngines.kt β€” LiteRtVisionEngine class with TODO for FastVLM receipt scanning
  3. LiteRTLMManager.kt β€” Existing engine manager with NPU/GPU/CPU backend fallback
  4. PromptBuilder.kt β€” Production-ready prompt templates optimized for low TTFT

πŸ›‘οΈ Privacy

  • No cloud APIs. No Firebase. No Supabase. No OpenAI. No Anthropic.
  • No Plaid. No bank login. No online banking connections.
  • Financial data never leaves the device.
  • All AI inference runs locally on the Snapdragon NPU.

Built with ❀️ for the Google AI Edge x Qualcomm Hackathon 2026

About

roost x google x qualcomm -- deepak karani, sai pisupati, adhya maddukuri, tarun nagaraju

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors