PORTFOLIO
01 // PROJECTWeatherGPT
02 // PLATFORMAndroid + Cloud + On-Device
03 // OFFLINE ENGINEQwen 2.5 (1.5B & 3B on Phone)
04 // BUILDERDhruv Sharma · Eurt-labs

WeatherGPT

A voice and chat weather assistant built for Android. It uses cloud AI when you have a connection, and runs small Qwen 2.5 models directly on your phone when you don't.

[ RUNS LOCALLY ON PHONES ]

You can download Alibaba's Qwen 2.5 models (1.5B or 3B) straight onto your Android phone. Once downloaded, you get full AI answers out in the fields with zero internet or phone signal.

[ DOES NOT CRASH IN STORMS ]

Most apps spin out and crash when cell towers drop in bad weather. WeatherGPT automatically steps down through 4 backup options so you always get clear advice.

[ GROUNDED IN REAL NUMBERS ]

Instead of vague forecasts, it uses real soil moisture at three depths, wind speed, and daily evaporation. It checks 29 verified guides before answering so it never makes things up.

§ 01.0 // OVERVIEW

Reference Code: 26068

Languages: English + 7 Indian Regional Languages

Offline Support: 100% On-Device (Zero internet needed)

Mobile AI Models: Qwen 2.5 1.5B & 3B (GGUF 4-Bit)

Speed: ~800ms Cloud / ~10ms Local Rule

Weather advice should still work when power lines break and phone towers fail.

Most weather apps are designed like advertising pages. They need a fast internet connection to load heavy banners and show generic temperatures. When a heavy storm hits, cell towers get congested or lose electricity, and those apps become useless.

I built WeatherGPT with a different priority: reliable, practical advice that works anywhere. A farmer out in a remote village shouldn't be left guessing if a sudden storm is coming. By letting the app download and run small language models (Qwen 2.5) right on the phone, users can get full weather guidance with zero cellular signal.

[ TABLE 1.1 — KEY WEATHER MEASUREMENTS USED BY THE SYSTEM ]

MEASUREMENTRANGE / DEPTHDATA SOURCEPRACTICAL USE
Soil Moisture0–1cm, 1–9cm, 9–27cmOpen-Meteo Land ModelTells you if the ground is safe for heavy tractors or needs water
Water Evaporation (ET₀)mm of water lost per dayFAO-56 FormulaHelps farmers know how much water crops actually lose each day
Storm Energy (CAPE)0 to 4500 J/kgForecast Models & RadarWarns about sudden thunderstorms, hail, and high winds
Runway Visibility (RVR)50m to 2000mAirport METAR FeedsChecks safe landing conditions and heavy road fog
Dew Point DistanceTemperature vs Dew PointLocal Weather SensorsWarns early about morning fog and fungal plant diseases
§ 02.0 // PROJECT ARCHITECTURE

The 4 Repositories

The project is split into four clean parts: Android client, cloud backend, verified knowledge base, and the local on-device engine.

PART 01 // ANDROID APPKOTLIN · JETPACK COMPOSE

WeatherGPT_Android

The primary mobile app installed on users' phones. Built with 48 clean Kotlin files. It includes 6 custom math screen shaders, on-device voice recognition for 7 Indian regional languages, local database caching, and a background model downloader to run AI models on the phone.

// Key Directories
├── core/components/ — 6 GPU Canvas Screen Shaders
├── inference/download/ — In-app model downloader (ModelDownloadManager.kt)
├── inference/engine/ — OnDeviceEngine.kt (Runs local GGUF on phone)
├── domain/assistant/ — Local SQLite database for offline chat history
└── domain/voice/ — Sherpa-ONNX streaming speech recognition
PART 02 // CLOUD SERVERPYTHON · FASTAPI · GEMINI 3.6

WeatherGPT_Backend

The cloud server running on Render. When your phone has internet, this backend streams AI answers word-by-word using Google Gemini 3.6 Flash. It pulls live forecasts from Open-Meteo, searches knowledge vectors in Qdrant, and prevents server abuse with request signatures.

// Core Services
├── main.py — API endpoints, rate limiting, HMAC security check
├── services/ai_service.py — Gemini 3.6 Flash streaming generator
├── services/weather_service.py — Live weather cache and proxy
├── services/rag_service.py — Vector similarity search in Qdrant
└── services/supabase_service.py — User accounts & cloud chat sync
PART 03 // KNOWLEDGE BASE29 CURATED GUIDES · QDRANT

WeatherGPT_RAG

A verified collection of 29 expert documents. Contains official government farming advisories, crop calendars, cyclone danger scales, and airport safety manuals so the AI sticks to proven guidelines instead of hallucinating.

// Knowledge Domains
├── 01_agriculture/ — 6 guides (crop cycles, watering, spray safety)
├── 02_aviation/ — 5 guides (wind shear, turbulence, runway limits)
├── 03_disaster/ — 5 guides (cyclone categories, flood water warnings)
├── 04_energy/ — 4 guides (solar power yield, wind turbine limits)
└── 05_urban_mobility/ — 5 guides (street flooding, commute timing)
PART 04 // OFFLINE & LOCAL ENGINEQWEN 2.5 (1.5B & 3B ON PHONE)

WeatherGPT_Local

The offline engine setup. It handles running small models directly on mobile devices (Qwen 2.5 1.5B and 3B in 4-bit GGUF format) as well as developer PC testing over USB and Wi-Fi. It allows testing prompts, measuring token speeds, and running the whole system without cloud keys or internet.

// Models Run Directly on Phone & PC
├── qwen2.5-1.5b-instruct.gguf — ~1.1 GB RAM (Fast on mobile phones)
├── qwen2.5-3b-instruct.gguf — ~2.2 GB RAM (Sharp reasoning on phone)
├── qwen2.5-7b-instruct.gguf — ~4.8 GB RAM (For PC developer testbed)
├── model_engine.py — Streaming inference engine wrapper
└── USB / Wi-Fi Android Pairing — Direct ADB reverse port forwarding
§ 03.0 // ON-DEVICE INFERENCE

Running Locally On Mobile Devices

How WeatherGPT runs Qwen 2.5 (1.5B and 3B models) directly on your Android phone with zero internet connection.

Works 100% Offline

When you are out in remote farmlands or in disaster areas where cell towers are down, you can still ask full weather questions. The model runs locally on the phone's processor without sending any data over the internet.

PRIVACY: No questions or GPS data leave your phone

Qwen 2.5 (1.5B & 3B)

We chose Alibaba's Qwen 2.5 models compressed to 4-bit GGUF format:

  • • 1.5B Model: Uses ~1.1 GB of RAM. Super fast on budget Android devices.
  • • 3B Model: Uses ~2.2 GB of RAM. Sharp reasoning for complex farming and travel advice.
FORMAT: 4-bit Quantized GGUF (Q4_K_M)

In-App Downloader

You don't need a computer to transfer files. The Android app includes an in-app download manager (ModelDownloadManager.kt). You connect to Wi-Fi once, tap download, and the model is stored securely in the app's private storage forever.

INTEGRATION: Android Background Download Service

[ TABLE 3.1 — LOCAL MODEL COMPARISON: MOBILE PHONE VS DEVELOPER TESTBED ]

MODELPARAMETERSFILE SIZERAM NEEDEDRUNS ONBEST FOR
Qwen 2.5 1.5B1.54 Billion~1.0 GB~1.1 GBAndroid Mobile PhonesBudget phones (3-4GB RAM), fast answers, low battery use
Qwen 2.5 3B3.09 Billion~2.1 GB~2.2 GBAndroid Mobile PhonesMid-range phones (6-8GB RAM), complex farming & storm advice
Qwen 2.5 7B7.61 Billion~4.7 GB~6.0 GBPC Testbed (USB/Wi-Fi Pair)Developer benchmarking, prompt testing, laptop pairing
USB & Wi-Fi Pairing in WeatherGPT_Local: During testing, developers can also link an Android phone directly to a PC running WeatherGPT_Local via USB (using ADB port forwarding) or local Wi-Fi. This allows running bigger models on your laptop while controlling everything through the Android touch interface.
§ 04.0 // HOW IT HANDLES CONNECTION DROPS

The 4-Tier Backup Plan

When you ask a question, the app does not just hope for a good internet connection. If the mobile network is slow or cuts out completely, WeatherGPT automatically switches through 4 backup options so you always get an answer.

[ USER ASKS A QUESTION OR SPEAKS ]
       │
       ▼
[ ANDROID INFERENCE ROUTER CHECKS CONNECTION ]
       │
       ├─► LEVEL 01: CLOUD SERVER (FastAPI + Render)
       │     • Uses Google Gemini 3.6 Flash + Qdrant Knowledge Base
       │     • Response speed: ~800 milliseconds
       │     • [ IF SERVER TAKES TOO LONG OR TIMES OUT ] ──────────────┐
       │                                                               │
       ├─► LEVEL 02: DIRECT GOOGLE GEMINI CONNECTION                   │
       │     • Connects straight from phone to Google AI Studio        ▼
       │     • No server in the middle                                 │
       │     • Response speed: ~600 milliseconds                       │
       │     • [ IF GOOGLE FREE TIER LIMIT IS REACHED ] ───────────────┤
       │                                                               │
       ├─► LEVEL 03: OPENROUTER CLOUD BACKUP                           │
       │     • Automatically switches to secondary cloud models        ▼
       │     • Response speed: ~700 milliseconds                       │
       │     • [ IF MOBILE INTERNET IS COMPLETELY GONE ] ──────────────┤
       │                                                               │
       └─► LEVEL 04: ON-DEVICE LOCAL AI (Qwen 2.5 ON YOUR PHONE)       ▼
             • Runs 100% inside your Android phone (Zero cell signal)
             • Reads saved weather readings from phone memory
             • Response speed: Under 10 milliseconds (or local model streaming)
             • Result: You ALWAYS get a helpful, accurate answer.
LEVEL 01 SPEED~800 ms

Full cloud server + live radar

LEVEL 02 SPEED~600 ms

Direct to Google Gemini

LEVEL 03 SPEED~700 ms

Secondary cloud backup

LEVEL 04 SPEED< 10 ms

Runs directly on your phone

§ 05.0 // PHONE GRAPHICS

6 Smooth Screen Shaders

Drawn in real time with math equations on the phone GPU at 60 to 120 FPS. No heavy video files, GIFs, or battery drain.

VOICE_ORB_SIMULATOR[idle]
Resting slowly. Ready when you want to speak.
CLICK TO TEST STATES:
SOURCE FILE: ConcentricPulsingOrb.kt (Kotlin)
ConstellationField.kt60–120 FPS
Sensor Network Grid

Draws 50 drifting dots with fine connecting lines representing weather stations. They move away smoothly when you touch the screen.

ConcentricPulsingOrb.kt60 FPS
Voice Pulse Orb

The central visual element for voice conversations. Expands, contracts, and breathes smoothly while you talk to the AI.

VoiceWaveAnimation.kt60 FPS
Audio Waveform

A moving wave that bounces with microphone sound, giving instant visual confirmation that your phone hears you clearly.

VoiceEdgeLighting.kt60 FPS
Screen Edge Glow

A soft border of light along the edges of the phone screen that glows during voice chats without covering up any text.

AmbientGlowBackground.kt30–60 FPS
Outdoor Temperature Background

Gently adjusts background warmth depending on the actual outdoor temperature and time of day.

FrostedGlassComponents.ktOLED Safe
Frosted Glass Cards

Crisp card borders designed for pure black screens so text is easy to read outside in direct sunlight.

§ 06.0 // VERIFIED GUIDES

29 Curated Knowledge Guides

Stored as searchable vectors so the AI checks official rules before answering, preventing false statements.

SECTOR 016 GUIDES

Farming & Agriculture

Crop planting calendars, watering needs, and pest spray safety.

  • • Crop calendar for Kharif & Rabi seasons
  • • Water evaporation & irrigation formulas
  • • Safe weather windows for pesticide spraying
  • • Protecting crops from frost and heatwaves
  • • Soil moisture levels for tractor work
  • • Official monsoon farming advisories
SECTOR 025 GUIDES

Aviation & Flights

Official airport weather codes and flight safety regulations.

  • • How to decode airport METAR & TAF reports
  • • High-altitude clear air turbulence alerts
  • • Dangerous sudden wind shear & microbursts
  • • Runway fog & landing visibility limits
  • • Aircraft wing icing hazards in cold clouds
SECTOR 035 GUIDES

Disaster Response

Emergency rescue steps and storm classification rules.

  • • Official cyclone danger categories & wind speeds
  • • City flood depth risks and road closures
  • • Dangerous heatwave & high humidity safety
  • • Lightning safety rules and outdoor precautions
  • • Step-by-step flood evacuation warning stages
SECTOR 044 GUIDES

Clean Energy

Solar power sunlight forecasting and wind turbine safety.

  • • Sunlight intensity calculations for solar panels
  • • Wind turbine startup & storm shut-off limits
  • • Power grid load changes during heat and cold
  • • Dam water reservoir inflows during rain
SECTOR 055 GUIDES

City Travel & Roads

Commute timing, air quality, and electric vehicle battery life.

  • • Predicting street waterlogging during monsoons
  • • Best travel timing to avoid heavy downpours
  • • Air pollution (PM2.5) inversion health alerts
  • • Electric car battery range drops in hot weather
  • • Concrete curing conditions on construction sites
SECTOR 064 GUIDES

Marine & Ocean

Wave heights, storm surges, and fishing boat safety.

  • • Sea wave height & swell danger ratings
  • • Coastal storm surge water levels
  • • Safe distance limits for small fishing boats
  • • Sea surface temperature changes and fish movement
§ 07.0 // BACKEND CONTRACTS

Clean Backend Endpoints

All backend requests use HMAC-SHA256 signatures with 60-second expiration timestamps to prevent automated scrapers.

POST/api/v1/chat
STREAMS ANSWER TOKEN BY TOKEN
// What the Android phone sends:
HEADERS:
  X-Signature: <HMAC_SHA256_HASH>
  X-Timestamp: 1727618400

BODY:
{
  "message": "Can I spray my paddy crop today?",
  "session_id": "sess_8f3d1a9e",
  "mode": "chat",          // "chat" or "voice"
  "detail_level": "detail", // "standard" or "detail"
  "language": "hi",         // Hindi, Marathi, etc.
  "sector": "farmer",
  "location": {
    "latitude": 28.6139,
    "longitude": 77.2090,
    "city": "New Delhi"
  }
}
// Streamed response tokens:
data: {"token": "आज ", "done": false}

data: {"token": "हवा ", "done": false}

data: {"token": "की ", "done": false}

data: {"token": "गति ", "done": false}

data: {"token": "18 किमी/घंटा है, छिड़काव न करें।", "done": false}

data: {"done": true, "tokens_used": 42}
GET/api/v1/weather/current?lat=28.6139&lon=77.2090
CACHED IN MEMORY FOR 10 MINUTES
// Clean JSON telemetry reply:
{
  "status": "success",
  "telemetry": {
    "temperature": 31.4,
    "humidity": 68,
    "dew_point": 24.8,
    "wind_speed": 14.8,
    "soil_moisture": 0.32,
    "daily_evaporation_et0": 4.85,
    "storm_cape_energy": 1850.0,
    "visibility_meters": 4200
  },
  "cached": true
}