prem / README.md
NitishStark's picture
Deploy source code to Hugging Face without binaries
c25dcd7
metadata
title: Prem
emoji: ๐Ÿ”ฅ
colorFrom: red
colorTo: yellow
sdk: static
pinned: false
short_description: In device co-pilot

Premithius V0.0.3

India-First On-Device AI Security | Zero LLM Footprint | ARMadillo Architecture

Premithius is an uncompromising, edge-native security layer for Android devices. Designed specifically for the Indian cybersecurity context, it proactively intercepts sophisticated threats like โ‚น1 collect requests, Aadhaar/PAN data leaks, and zero-day scams before they ever reach the user's eyesโ€”all without sending a single byte of personal data to the cloud.


๐Ÿ›ก๏ธ Kavacha Engine (5-Layer Defense)

Inspired by NVIDIA's ARMadillo architecture, Premithius utilizes a DOCA FLOW-style early-exit pipeline. This ensures maximum efficiency, allowing standard traffic to pass cleanly while trapping anomalies with progressive computational weight.

  1. Layer 0 (Whitelist): Immediate pass for trusted, verified senders.
  2. Layer 1 (India Threat Pack): Hardened heuristic rules targeting specific local threat vectors (see below).
  3. Layer 2 (Vector Similarity): Sub-millisecond KNN semantic search against offline scam embeddings using sqlite-vec (ARM NEON accelerated).
  4. Layer 3 (Random Forest): A lightweight trained ensemble classifier exported to pure Dart via m2cgen. Trained on the HuggingFace india-spam-sms dataset with 13 custom numerical and categorical features. Scales dynamically during high-risk festival periods.
  5. Layer 4 (MobileBERT): Our final deep-learning fallback layer. Integrates the mrm8488/bert-tiny-finetuned-sms-spam-detection model running locally via tflite_flutter and a custom-built native Dart WordPiece tokenizer.

๐Ÿ‡ฎ๐Ÿ‡ณ India Threat Pack

Premithius is built for the ground reality of Indian digital fraud:

  • UPI Firewall: Natively catches the classic "โ‚น1 collect request" marketplace fraud, scanning for suspicious VPA usage and urgency indicators.
  • OTP Context Verifier: Intercepts incoming OTP messages and cross-references them against the active foreground application to prevent OTP-forwarding phishing.
  • Aadhaar/PAN Data Shield: A final line of defense baked directly into the custom Premithius Keyboard, warning users before they inadvertently send sensitive documents to untrusted contacts.
  • Festival Calendar: Scam volume spikes ~340% during major holidays. The pipeline dynamically adjusts its sensitivity multiplier during these critical windows.

๐Ÿš€ Edge-Native & Privacy First

  • Zero LLM Overhead: V0.0.3 maintains a tiny footprint by running Random Forest directly in Dart arithmetic and utilizing a highly optimized, quantized BERT module instead of a 900MB Qwen2 model.
  • Data Shield Insights: A custom Android native Kotlin telemetry layer continuously and securely queries AppOpsManager and UsageStatsManager in the background. It surfaces hardware access events (Mic/Camera) and compiles local privacy stories translating background behavior for users.
  • Home Screen Widget: A completely native Kotlin AppWidget provides users with 4x2 interactive real-time monitoring of their device's security status, avoiding Flutter engine wakelocks entirely.

๐Ÿ› ๏ธ Build Requirements

  • Flutter SDK (^3.11.1)
  • Android Studio / Android SDK
  • Note: The final release build requires the sqlite-vec-android:0.1.7 dependency. Ensure your Android build.gradle is configured with the correct Maven artifact repositories if retrieving io.github.asg017 fails during compilation.
# Debug Build
flutter build apk --debug

# Release Build 
flutter build apk --release

Built for the next billion users. Because security shouldn't require surrendering your privacy.