How subhashdoc234xyz/whatifgpt works
WhatIfGPT is a web app for exploring and modifying AI-generated reasoning. A user submits a question, the app displays the generated steps as a tree, and editing a step creates a fork that continues reasoning from the changed assumption. Users can request alternative steps, compare branches, and synthesize a final report for viewing and copying. The backend routes these operations through a reasoning parser and an LLM client; Groq is the documented model provider. Some frontend request handlers were not excerpted, so those links rely on README documentation.
Main entry points: App.jsx App state and API · main.py Reasoning API · gpt_oss_client.py LLM client · PromptInput.jsx Prompt input
Components 11
Reasoning interface
- App state and API
frontend/src/App.jsx - Prompt input
frontend/src/components/PromptInput.jsx - Reasoning tree
frontend/src/components/ReasoningTree.jsx - Step editor
frontend/src/components/NodeEditor.jsx - Branch comparison
frontend/src/components/BranchCompare.jsx - Conclusion report
frontend/src/components/ConclusionView.jsx
Reasoning backend
- Reasoning API
backend/main.py - Step parser
backend/reasoning_parser.py
AI service
- LLM client
backend/gpt_oss_client.py
Other components
- User
- Groq API
Connections 17
- User → Prompt input: submits question
README.md - Prompt input → App state and API: submits prompt
frontend/src/components/PromptInput.jsx - App state and API → Reasoning tree: renders reasoning
frontend/src/App.jsx - App state and API → Step editor: opens editor
frontend/src/App.jsx - App state and API → Branch comparison: shows comparison
frontend/src/App.jsx - App state and API → Conclusion report: shows report
frontend/src/App.jsx - App state and API → Reasoning API: requests fork
frontend/src/App.jsx - App state and API → Reasoning API: requests generation
README.md - App state and API → Reasoning API: requests comparison
README.md - App state and API → Reasoning API: requests suggestions
README.md - App state and API → Reasoning API: requests conclusion
README.md - Reasoning API → LLM client: requests generation
backend/main.py - Reasoning API → LLM client: requests comparison
backend/main.py - Reasoning API → LLM client: requests suggestions
backend/main.py - Reasoning API → LLM client: requests synthesis
backend/main.py - Reasoning API → Step parser: parses generated steps
backend/main.py - LLM client → Groq API: requests completion
backend/gpt_oss_client.py