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