AI/ML · Apr 2026
WhatIf
I built WhatIf so one question comes back as a timeline, three impact notes, a risk word, and a short summary.
WhatIf media, 2 items. Use the arrow keys to move.
Illustration. Not a screenshot of the app.
“What if” questions sprawl. I built WhatIf so one question comes back as a timeline, three impact notes, a risk word, and a short summary.
The problem
An open question comes back as a wall of prose unless the page asks for a fixed shape. The person it frustrates is the one who wanted a near-term answer and a long-term answer and got eight paragraphs that are both and neither. It was worth refusing the wall, and refusing the version that made seven calls to get a structure.
The shape I wanted was small enough to read on one screen: three horizons, three kinds of impact, one risk, one summary.
How I built it
The Next.js page posts the question once. The prompt asks for JSON, not for an essay. Three outcomes each for 0–12 months, 1–3 years, and 3 or more years. A note each for technology, economy, and society. A risk of Low, Medium, or High. A short summary. The page renders that object. It does not try to recover a structure from free prose.
Gemini is tried first. If it is down, the same prompt goes to a local Ollama model. One prompt, two backends, same shape. The local model is the fallback so a Gemini outage is a slower answer and not an empty page. Tailwind is the layout. TypeScript is the shape of the object the page expects.
An earlier version used seven calls, one per section, and hit the free-tier limit. The single call is the replacement. The JSON is what makes one call enough: the sections are fields, not follow-up requests.
Challenges and what I learned
The shape of the answer is the thing that survived that cut. Seven calls were a nicer draft and a worse product, because the limit arrived before the answer did. Asking once, for a fixed object, is why the page can show a timeline and a risk word instead of a paragraph that mentions both.

Let's talk ↗









