An end-to-end AI-powered recipe generation system supporting advanced LLM reasoning strategies — Chain-of-Thought (CoT), ReAct, and Tree-of-Thought (ToT) — along with voice-based input.
Built using FastAPI (backend), React (frontend), and Gemini LLM, this project demonstrates modern LLM orchestration, reasoning pipelines, structured outputs, and clean result management.
- Chain-of-Thought (CoT) – step-by-step logical reasoning
- ReAct – structured reasoning with action-oriented responses
- Tree-of-Thought (ToT) – multi-sample reasoning with scoring and best-answer selection
- Voice Input – generate recipes by speaking instead of typing
- View responses for each reasoning mode
- Timestamped, structured outputs
- Unified result view across CoT, ReAct, and ToT
- All final outputs are stored in a single tracked directory:
backend/results/
- No unnecessary nested folders for ToT
- Clean, readable JSON outputs for inspection and debugging
AI-recipe-generator/
│
├── backend/
│ ├── main.py
│ ├── models/
│ │ ├── cot.py
│ │ ├── react.py
│ │ └── tot.py
│ │
│ ├── gemini/
│ │ └── client.py
│ │
│ ├── utils/
│ │ ├── results_manager.py
│ │ └── memory_manager.py
│ │
│ ├── results/ # MAIN results folder (tracked in Git)
│ │
│ └── requirements.txt
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ └── Dashboard.jsx
│ │ └── App.jsx
│ │
│ └── package.json
│
├── .env
├── .gitignore
└── README.md
cd backend
conda activate transformer-2 # or your preferred environment
pip install -r requirements.txtCreate a .env file:
GEMINI_API_KEY=your_api_key_here
USE_MOCK_GEMINI=falseRun the backend:
uvicorn main:app --reloadBackend will run on:
http://127.0.0.1:8000
cd frontend
npm install
npm run devFrontend will run on:
http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
| POST | /cot |
Chain-of-Thought reasoning |
| POST | /react |
ReAct reasoning |
| POST | /tot |
Tree-of-Thought reasoning |
| POST | /voice |
Voice-based recipe generation |
- Gemini Python SDK with prompt-enforced JSON outputs
- Safe JSON parsing with graceful fallback handling
- No unsupported SDK schema usage
- Modular, extensible reasoning architecture
- Production-safe FastAPI backend design
- Mock mode support for quota-free testing
backend/results/is intentionally version-controlledbackend/utils/results/is ignored to avoid local clutter- Mock mode enables testing without consuming Gemini API quota
Aryaman Jain AI / ML / LLM Engineering