How mansipatel42/smart-travel works
Project type and purpose
• From the file tree and README, this is a full-stack “smart travel” chatbot application:
• A React/TypeScript front end (chatbot/ui)
• A Python FastAPI back end (chatbot/server) that exposes chat endpoints
• Fine-tuning scripts (fine-tuning/) to train a Mistral 7B travel companion model
• A web scraper (scraper/) to gather travel data for training/knowledge
File structure
• Top-level directories:
• chatbot/server – FastAPI service, test harness, “travel_agent” business logic
• chatbot/ui – Single-page application built with Vite + React + TypeScript
• fine-tuning – Python scripts to merge and tune models on travel prompts/data
• scraper – Data-collection tooling (scraper.py, main.py, config.json)
• Key configs: package.json, tsconfig*, eslint.config.js in UI; REQUIREMENTS.txt for Python deps
README for additional insights
• Confirms “Fine tuned Mistral 7B-v0.3 for travel companion”
• Implies
• A pipeline: scrape → preprocess → fine-tune → deploy as API → UI consumption
a. Main components
1. UI (React SPA)
2. API Server (FastAPI)
3. Travel Agent module (encapsulates LLM calls, prompt logic)
4. Fine-tuning pipeline (merge-models.py, tuning-travel.py)
5. Web Scraper (scraper.py, data_eda.py)
6. Model Storage (local disk or S3 bucket)
7. External LLM base model repository (Mistral 7B)
b. Relationships & data flow
• User → UI: chat input
• UI → API Server: JSON over HTTP
• API Server ↔ Travel Agent: function calls
• Travel Agent → LLM runtime (loads fine-tuned weights from Model Storage)
• Scraper → Raw travel data → Preprocessor → Training dataset
• Fine-tuning scripts read training dataset + base model → produce new model → store in Model Storage
c. Architectural patterns & design principles
• Separation of concerns: UI vs API vs AI logic vs data collection vs model training
• Stateless API server; state (models, data) is externalized to storage
• Pipeline pattern: scraping → data preparation → model tuning → deployment
d. Key technologies & libraries
• Frontend: React, Vite, TypeScript, ESLint
• Backend: Python, FastAPI, Uvicorn
• AI: Mistral 7B, transformers (or similar), custom “travel_agent” logic
• Data tooling: pandas/EDA (data_eda.py), custom scraper
• Deployment: Docker (implied), model artifact storage