seriffic Claude Opus 4.7 (1M context) commited on
Commit
2e8df60
Β·
1 Parent(s): 4d60f04

Stones C8: README anchored on the five Stones

Browse files

Replaces the bare HF-Space frontmatter README with a "How Riprap works"
overview anchored on the five Stones taglines:

Cornerstone remembers. Keystone tallies. Touchstone watches.
Lodestone projects. Capstone writes it all down with citations.

Adds a Stones table mapping each role to the underlying FSM specialists,
links the three Apache-2.0 NYC-specialised fine-tunes published this
week (TerraMind-NYC-Adapters, Prithvi-EO-2.0-NYC-Pluvial,
Granite-TTM-r2-Battery-Surge), and points at the local-dev runbook +
probe-mellea command.

Final commit of the Stones architecture migration described in
UPDATE_STONES.md. The migration ships:
C1 taxonomy modules (app/stones/*)
C2 reconciler emit-order regrouped per Stone
C3 TerraMind-NYC adapter wrapper (app/context/terramind_nyc.py)
C4 step_terramind_lulc / step_terramind_buildings + chip cache
C5 prithvi_live upgraded to NYC-Pluvial v2 (test IoU 0.5979)
C6 step_ttm_battery_surge (Battery 96 h surge fine-tune)
C7 stone_start / stone_done SSE envelope
C8 README anchored on the five Stones (this commit)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. README.md +113 -1
README.md CHANGED
@@ -7,4 +7,116 @@ sdk: docker
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  pinned: false
8
  ---
9
 
10
+ # Riprap β€” citation-grounded NYC flood-exposure briefings
11
+
12
+ Riprap takes any NYC address (or neighborhood, or development-permit query)
13
+ and produces a four-section briefing β€” **Status / Empirical evidence /
14
+ Modeled scenarios / Policy context** β€” where every numeric claim is
15
+ anchored to a `[doc_id]` citation pointing back into the source document.
16
+
17
+ The Capstone reconciler is **Granite 4.1** (8B, served via Ollama on T4
18
+ or vLLM on AMD MI300X), wrapped in **Mellea**-validated rejection
19
+ sampling. Sentences that fail one of four grounding checks
20
+ (`numerics_grounded`, `no_placeholder_tokens`, `citations_dense`,
21
+ `citations_resolve`) are rerolled with surgical feedback until the
22
+ budget is exhausted.
23
+
24
+ Live demo: <https://msradam-riprap-nyc.hf.space>
25
+
26
+ ---
27
+
28
+ ## How Riprap works β€” the Five Stones
29
+
30
+ Behind every briefing, ~25 atomic specialists fan out across NYC datasets,
31
+ satellite imagery, sensors, and forecasts. The **Five Stones** are a
32
+ re-grouping of those specialists into five legible roles:
33
+
34
+ > **Cornerstone** remembers. **Keystone** tallies. **Touchstone**
35
+ > watches. **Lodestone** projects. **Capstone** writes it all down with
36
+ > citations.
37
+
38
+ | Stone | Role | What fires |
39
+ |---|---|---|
40
+ | **Cornerstone** | The Hazard Reader β€” what NYC's ground remembers | Sandy 2012 inundation extent, NYC DEP stormwater scenarios, 2021 Ida USGS high-water marks, baked Prithvi-EO Ida-attributable polygons, USGS 3DEP DEM + HAND/TWI |
41
+ | **Keystone** | The Asset Register β€” what's exposed | MTA subway entrances, NYCHA developments, NYC DOE schools, NYS DOH hospitals, **TerraMind-NYC Buildings LoRA** |
42
+ | **Touchstone** | The Live Observer β€” current state of the city | FloodNet ultrasonic depth sensors, NYC 311 flood complaints, NWS hourly METAR, NOAA tide-gauge water levels, **Prithvi-EO 2.0 NYC-Pluvial v2**, **TerraMind-NYC LULC LoRA** |
43
+ | **Lodestone** | The Projector β€” what's coming | NWS public flood alerts, Granite TTM r2 surge nowcast (zero-shot, 6-min cadence, 9.6 h horizon), per-address 311 weekly forecast, FloodNet sensor recurrence forecast, **Granite-TTM-r2-Battery-Surge fine-tune** (96 h hourly horizon) |
44
+ | **Capstone** | The Synthesiser β€” citation-grounded briefing | Granite 4.1 + Mellea rejection sampling |
45
+
46
+ The four data-Stones run sequentially per query; the Capstone reconciles
47
+ their documents into one cited paragraph.
48
+
49
+ ---
50
+
51
+ ## NYC-specialised foundation models (Apache 2.0)
52
+
53
+ Three NYC-specific fine-tunes built on AMD Instinct MI300X via AMD
54
+ Developer Cloud, published under permissive licence:
55
+
56
+ - **[`msradam/TerraMind-NYC-Adapters`](https://huggingface.co/msradam/TerraMind-NYC-Adapters)**
57
+ β€” LoRA family on TerraMind 1.0 base. LULC mIoU 0.5866 (+6.13 pp over
58
+ full-FT baseline), TiM 0.6023, Buildings 0.5511. Trained in ~18 min on
59
+ a single MI300X.
60
+ - **[`msradam/Prithvi-EO-2.0-NYC-Pluvial`](https://huggingface.co/msradam/Prithvi-EO-2.0-NYC-Pluvial)**
61
+ β€” NYC pluvial-flood fine-tune of Prithvi-EO 2.0. Test flood IoU
62
+ 0.5979 vs 0.10 on the Sen1Floods11 base β€” a 6Γ— lift. LovΓ‘sz-Softmax
63
+ loss + copy-paste augmentation.
64
+ - **[`msradam/Granite-TTM-r2-Battery-Surge`](https://huggingface.co/msradam/Granite-TTM-r2-Battery-Surge)**
65
+ β€” NYC Battery storm-surge nowcast fine-tune of Granite TimeSeries TTM
66
+ r2. Test MAE 0.1091 m, βˆ’41% vs persistence and βˆ’25% vs zero-shot.
67
+
68
+ All three are loaded at runtime by their respective FSM specialists in
69
+ `app/context/` and `app/live/`.
70
+
71
+ ---
72
+
73
+ ## Architecture pointers
74
+
75
+ - `app/stones/` β€” the Stones taxonomy (NAME / TAGLINE / SOURCES /
76
+ collect()) over the FSM specialists.
77
+ - `app/fsm.py` β€” Burr FSM with one specialist per `@action`.
78
+ - `app/reconcile.py` β€” `build_documents()` emits Granite-native
79
+ document-role messages in canonical Stone order.
80
+ - `app/mellea_validator.py` β€” strict reconcile path (4-check rejection
81
+ sampling).
82
+ - `app/llm.py` β€” LiteLLM Router shim. Routes to Ollama (T4 / local) or
83
+ vLLM (AMD MI300X) without changing caller code.
84
+ - `web/main.py` β€” FastAPI + SSE. The stream emits
85
+ `plan / step / token / mellea_attempt / final` events plus the
86
+ `stone_start / stone_done` envelope around each Stone group.
87
+ - `web/sveltekit/` β€” primary UI (SvelteKit + adapter-static).
88
+ - `web/svelte/` + `web/static/` β€” legacy custom-element bundle, still
89
+ serving `/legacy`, `/single`, `/compare`.
90
+ - `experiments/18_terramind_nyc_lora/` /
91
+ `experiments/19_prithvi_nyc_v2/` /
92
+ `experiments/20_ttm_battery_surge/` β€” full reproduction recipes for
93
+ the three HF artifacts above.
94
+
95
+ ---
96
+
97
+ ## Local development
98
+
99
+ ```bash
100
+ # Local server (Ollama primary)
101
+ .venv/bin/uvicorn web.main:app --host 127.0.0.1 --port 7860
102
+
103
+ # Local server pointed at AMD MI300X (vLLM primary, Ollama fallback)
104
+ RIPRAP_LLM_PRIMARY=vllm \
105
+ RIPRAP_LLM_BASE_URL=http://<droplet-ip>:8000/v1 \
106
+ RIPRAP_LLM_API_KEY=<token> \
107
+ .venv/bin/uvicorn web.main:app --host 127.0.0.1 --port 7860
108
+
109
+ # Programmatic Mellea probe (server must be running)
110
+ .venv/bin/python scripts/probe_mellea.py --query "Hollis" --runs 5
111
+ ```
112
+
113
+ ---
114
+
115
+ ## License
116
+
117
+ Apache 2.0 (this repository). The three NYC-specialised models above
118
+ are also Apache 2.0; underlying upstream models retain their own
119
+ permissive licences (see each `MODEL_CARD.md`).
120
+
121
+ Check out the HF Space configuration reference at
122
+ <https://huggingface.co/docs/hub/spaces-config-reference>.