DEV Community

Edison Flores
Edison Flores

Posted on

VIGÍA ML: Gas-Well Predictive Monitoring That Runs Entirely in the Browser (TensorFlow.js + React)

VIGÍA ML is a predictive console for gas wells — production forecasting, anomaly detection, fault diagnosis, and operational recommendations — where every model trains and runs live in the browser. No backend, no GPU cluster, no data leaving the device.

Live demo (Spanish-first UI): https://alicelabs-llc.github.io/vigia-ml/
Source: https://github.com/alicelabs-llc/vigia-ml

The problem it targets

Production engineers and field operators work with well time series — tubing pressure, flow rates, temperatures, choke positions — that are almost always proprietary. Sending that data to a cloud ML pipeline means negotiating data-export policies, paying for inference infrastructure, and depending on connectivity at sites where connectivity is often the least reliable thing around. Most small operations just... don't do ML at all, and rely on threshold alarms and gut feel.

We built VIGÍA ML around a simple constraint: the data never has to leave the laptop it's already on.

Four models, all on-device

The console runs four distinct models, each trained in-session on the data you load:

  1. LSTM production forecaster — a recurrent net trained on the well's own history, projecting pressure/flow trajectories hours ahead. You watch it train (loss curve and all), which builds the right amount of trust: you saw it converge on your data, not on a benchmark you never see.
  2. Autoencoder anomaly detector — trained on "normal" operating windows; flagged anomalies are windows with high reconstruction error. This catches slow drifts (sand accumulation, gradual choke wear) that fixed thresholds miss, because the model learns the well's baseline rather than a static rule.
  3. Neural fault classifier — maps operating-state features to common failure modes (liquid loading, hydrate risk, valve malfunction), with per-class confidence so "UNKNOWN" is an honest output, not a forced guess.
  4. Recommendation layer — turns diagnosis + forecast into operational suggestions (choke adjustment, surveillance frequency), always shown with the reasoning, never as a black-box verdict.

Why in-browser ML is the right call here

  • Privacy by architecture. Well data stays in the browser tab. There is no server to subpoena, leak, or breach — the strongest data-governance story is the one where the data simply never moves.
  • Offline as a feature, not a fallback. VIGÍA ML is a PWA: once loaded, it keeps working at a pad site with zero connectivity. Field conditions are the expected condition, not the error case.
  • Zero inference cost. Training and inference are free at the edge. The marginal cost of one more engineer opening the console is zero, which is the only pricing model that makes sense for tools used across dozens of marginal wells.
  • Auditability. The weights are right there in DevTools. An engineer who wants to inspect what the model learned can — no API access requests, no vendor tickets.

Engineering notes

  • React 18 + TypeScript 5.7, TensorFlow.js 4.22, Vite 6, Tailwind 4
  • 140 tests passing (unit + integration over the training/eval pipelines)
  • License: AL-1.0 (source-available; free to run and evaluate)
  • Everything — data loading, training, evaluation, export of results — happens client-side

The UI is Spanish-first because the initial users are LATAM operations teams, but the codebase is standard TypeScript/React; the language of the interface is a config concern, not an architectural one.

Try it

Open the demo, load a well dataset (or use the synthetic one), and watch the forecaster train in ~30 seconds on a plain laptop. The anomaly detector's reconstruction-error view is the most interesting screen — you'll see drift accumulate in the error signal well before any threshold alarm would have fired.

VIGÍA ML comes from the same team that builds UTA (Universal Trust Adapter — trust infrastructure for AI agents). Different domain, same philosophy: verification you can run yourself, on hardware you control, without shipping your data to anyone.

Top comments (0)