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 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.
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:
- Install the Qualcomm QNN SDK and the LiteRT-LM AAR.
- Drop the following
.sofiles intoapp/src/main/jniLibs/arm64-v8a/:libLiteRt.solibLiteRtDispatch_Qualcomm.so(must be patched — see below)libLiteRtGpuAccelerator.solibLiteRtOpenClAccelerator.solibLiteRtTopKOpenClSampler.so,libLiteRtTopKWebGpuSampler.so,libLiteRtWebGpuAccelerator.solibGemmaModelConstraintProvider.solibQnnHtp.so,libQnnHtpPrepare.so,libQnnHtpV79Skel.so,libQnnHtpV79Stub.so,libQnnSystem.so
- The dispatch lib needs a one-time
patchelfpatch so it can find symbols fromlibLiteRt.soat dlopen time:brew install patchelf # or apt install patchelf patchelf --add-needed libLiteRt.so app/src/main/jniLibs/arm64-v8a/libLiteRtDispatch_Qualcomm.so - 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/ - Build with JDK 17 (
JAVA_HOMEpointing to a real JDK, not a JRE):./gradlew :app:assembleDebug adb install -r app/build/outputs/apk/debug/app-debug.apk
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.
| 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. |
┌─────────────────────────────────────────────────────┐
│ 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 | 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 |
- 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.
| 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 | |
| < 35 | 😴 Exhausted |
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
- Android Studio Ladybug or newer
- JDK 11+
- Qualcomm device with Snapdragon 8 Elite (for NPU inference)
git clone <repo>
cd hackk
./gradlew assembleDebugOpen in Android Studio → Select device → ▶ Run
adb push gemma-4-E2B-it_qualcomm_sm8750.litertlm /sdcard/Download/| 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. |
The codebase is structured for easy model integration:
AIEngines.kt—LiteRtGemmaEngineclass with TODO comments showing exact integration stepsAIEngines.kt—LiteRtVisionEngineclass with TODO for FastVLM receipt scanningLiteRTLMManager.kt— Existing engine manager with NPU/GPU/CPU backend fallbackPromptBuilder.kt— Production-ready prompt templates optimized for low TTFT
- 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