Over the last sprint I used an LLM to refactor and fine-tune our real-estate rent-estimation engine. The result is a cleaner, deterministic progression that’s easier to reason about (and debug), plus a simple path to a web app on Replit.
What changed in Mod 2
Tier flow stays the same: Subdivision → Subdivision Root → Zip → City.
Inside each tier, the LLM helped me rewrite the comp selection to a strict sequence and stop at the first valid match:
Exact model match — same Beds, same Baths, same SQFT.
Same SQFT, bath variance — same Beds + SQFT, then try ±0.5 baths (lower first, then higher).
Size variance ±150 — same Beds, SQFT within ±150; bath order: exact → lower (−0.5) → higher (+0.5).
Fallback ±300 — if ±150 fails, repeat Step 3 with ±300.
Other upgrades:
Dynamic bath handling — subject bath drives the ±0.5 search (no hard-coding to 2.5/3.0).
Subdivision “rooting” — e.g., “Desert Valley Estates 5” collapses to “Desert Valley Estates” to pull sister tracts.
PSF caps with backstops — caps at Zip/City (Beds + effective Baths), plus a global cap.
Transparent tags — every estimate explains itself (e.g., SubRoot(size±150_bath_exact)).
How we validated (spot checks)
We pulled closed rentals by root subdivision and verified:
we stay in-band for ±150 before widening,
bath variance respects ±0.5, and
subdivision tiers aren’t capped while Zip/City are.
When something looked off, we traced the exact comp IDs and confirmed why they were (or weren’t) included. That tightened confidence and revealed tiny rounding edge cases.

What I’d ship next
Live MLS/rental APIs for fresh comps.
Taxes/HOA/utilities in carrying costs and profit.
ROI/cap-rate/break-even visuals.
Scheduled runs + cloud storage.
One-page PDF briefs for investors.
From script to app (Replit)
The script ingests actives.csv + rentals.csv, estimates rent, and outputs investor_results.csv. On Replit you can turn it into a UI fast:
Backend: Flask/FastAPI /estimate that accepts two CSVs, runs the engine, returns JSON.
Frontend: React table with sorting/filters + “Download CSV.”
Nice to have: a “trace” toggle to show comp IDs per subject (our debug mode).
If you’re curious how the comp sequence (bath ±0.5 and size ±150 → ±300) works, or want a starter repo, let’s connect.
