HydroSite-GPT: Hydrology Assistant and Build-Site Feasibility Advisor

HydroSite-GPT hydrology assistant and site feasibility advisor architecture thumbnail

Overview

I led the development of HydroSite-GPT, an AI-powered Gradio application that combines two workflows in a single chat interface: a hydrology and water-resources question-answering assistant, and a build-site feasibility screening advisor for proposed development locations.

The platform routes each user message to the correct workflow, preserves conversational context for follow-up questions, streams hydrology-focused LLM responses, and can generate screening summaries with an embedded location map when a build-site address is provided.

My Role

  • Led development of the HydroSite-GPT application architecture and implementation.
  • Designed the dual-workflow chat experience for hydrology Q&A and site feasibility screening.
  • Implemented hybrid intent routing using rule-based classification with an LLM fallback router.
  • Integrated hydrology-focused LLM response generation with token-by-token streaming.
  • Developed the build-site advisor workflow for building-type and address extraction, geocoding, FEMA flood-hazard lookup, vulnerability-index lookup, scoring, and response formatting.
  • Added embedded map generation to visually communicate screened site locations.
  • Structured the codebase into maintainable modules for routing, model runtime, hydrology generation, advisor logic, LLM slot filling, and geospatial/data utilities.

Key Capabilities

Hydrology assistant

  • Answers hydrology and water-resources questions covering topics such as runoff, floods, rainfall, groundwater, watersheds, SMAP soil moisture, and related concepts.
  • Uses a hydrology-focused language model loaded once and shared across the application.
  • Streams responses token-by-token for a responsive chat experience.
  • Applies conservative handling of forecast-style questions so the system does not fabricate real-time weather or flood predictions.

Build-site feasibility advisor

  • Accepts natural-language development questions such as whether a warehouse, hospital, school, commercial building, residential site, or industrial facility can be built at a given address.
  • Extracts building type and address from user prompts using LLM-based slot filling.
  • Geocodes addresses using the U.S. Census Geocoder.
  • Queries FEMA National Flood Hazard Layer data at the proposed location.
  • Looks up a block-level vulnerability index from a Parquet data source using GEOID-based matching.
  • Combines FEMA flood-hazard tier, vulnerability tier, and building-type penalty into an overall screening tier and feasibility score.
  • Returns practical screening summaries, risk context, and recommended next steps.
  • Displays the proposed site on an embedded map when coordinates are available.

Architecture

HydroSite-GPT is organized as a modular Python application:

  • app.py — Gradio interface, message dispatch, follow-up handling, streaming handoff, and map embed generation.
  • router.py — rule-based first-pass intent routing.
  • llm_router.py — LLM fallback router for ambiguous messages.
  • hydrology_chat.py — hydrology prompt construction and streamed model generation.
  • advisor_flow.py — end-to-end build-site advisor workflow and response formatting.
  • advisor_llm.py — LLM-based slot filling for building type and address extraction.
  • advisor_tools.py — geocoding, FEMA lookup, vulnerability lookup, caching, tier combination, and scoring.
  • model_runtime.py — one-time model/tokenizer loading and shared runtime management.

Technical Stack

  • Application framework: Gradio
  • Language model runtime: PyTorch, Transformers, PEFT-compatible loading
  • LLM serving pattern: shared in-memory model, token streaming with TextIteratorStreamer
  • Geospatial/data services: U.S. Census Geocoder, FEMA NFHL point lookup, block-level vulnerability Parquet lookup
  • Data processing and storage: DuckDB, Parquet, SQLite caching
  • Deployment context: GPU/HPC-compatible Python runtime with configurable host, port, map URL, FEMA settings, and vulnerability data path

Impact

HydroSite-GPT demonstrates how domain-specific LLMs can be combined with geospatial data services and scientific risk indicators to support practical decision-making. Instead of acting only as a chatbot, the system connects natural-language user intent to structured hydrologic knowledge, address-level geospatial analysis, flood-hazard data, vulnerability information, and explainable screening outputs.

Important Note

The build-site advisor is designed as a screening-level decision-support tool, not a replacement for a surveyed site boundary, local floodplain determination, drainage study, engineering review, or code and ordinance review for critical facilities.