I built a real-time flood digital twin of a UK river that runs entirely in the browser, GPU and on-device AI included
Описание и применение
Don Watch – полностью клиентское приложение для моделирования наводнений реки Дон, использующее WebGPU для рендеринга и WebLLM для локального ИИ. Оно работает офлайн, кэширует данные и модель, и предоставляет решения для принятия решений в реальном времени.
Задача
Create a serious flood-response tool that runs entirely in a browser tab without a server, providing real-time simulation and decision support for the River Don flood events.
Результат
Don Watch delivers a real‑time, decision‑support flood simulation that runs entirely in the browser, leveraging WebGPU for rendering and WebLLM for local AI inference. It operates offline, caches data locally, and provides transparent, deterministic hydrology calculations with AI‑generated briefs.
Рабочий процесс
- 1. Load static assets (terrain, river geometry, gauge data) via Next.js static export.
- 2. Render terrain and water with three.js WebGPURenderer, using a breadth‑first flood surface algorithm.
- 3. Run an on‑device LLM (1‑2B parameters) via WebLLM to generate plain‑language briefs and risk rankings.
- 4. Coordinate five agents (ingest, forecast, risk, comms, orchestrator) to process gauge, rainfall, and forecast data.
- 5. Stream live reasoning feed and delegation graph to the UI.
- 6. Cache all assets and model in OPFS via service worker for offline use.
- 7. Allow network cut‑off button to test offline functionality.
Доказательства
It rebuilds the Don valley from open LIDAR elevation, drapes the real river over it, and replays the November 2019 Sheffield flood hour by hour from the Environment Agency's own gauge records.
The model, an open model in the 1-to-2-billion range, loads straight into the browser through WebLLM and runs on the visitor's own GPU.
It ships as a Next.js static export and installs as a progressive web app. A service worker caches the shell, the data and the model, so once it has run it runs with the network cut, on a locked‑down laptop or in a field office with no signal.
- Дата записи: 2026-09-21T13:00:33.833Z