An intelligent travel planning application that uses HuggingFace's Llama 4 model to generate personalized travel itineraries and research destinations. Built with Streamlit for an intuitive web interface.
- 🔍 Smart Destination Research: AI-powered research for attractions, accommodations, dining, and transportation
- 📅 Personalized Itinerary Generation: Custom day-by-day travel plans based on your preferences
- 💡 Travel Tips: Essential tips and local insights for your destination
- 📱 Multiple Travel Styles: Support for Honeymoon, Adventure, Cultural, Luxury, Family, Solo, and Business travel
- 💰 Budget-Aware Planning: Tailored recommendations for different budget ranges
- 🚶 Transportation Preferences: Plans adapted to walking, public transport, car rental, or mixed mobility
- 📄 Export Options: Download your itinerary as a text file
- 🔄 Offline Mode: Basic templates available when API is unavailable
- Python 3.12 or higher
- HuggingFace API key (optional but recommended for AI features)
-
Clone the repository:
git clone https://github.com/thrishank007/AI-Travel-Planner cd AI-Travel-Planner -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run src/app.py
-
Open your browser to
http://localhost:8501
- Go to HuggingFace Settings
- Create a new token with 'Read' permissions
- Enter the token in the sidebar of the application
-
Configure your preferences in the sidebar:
- Enter your HuggingFace API key
- Select travel style, budget range, and interests
- Choose accommodation and transportation preferences
-
Enter trip details:
- Destination (e.g., "Tokyo, Japan")
- Start and end dates
- Number of travelers
- Special requirements
-
Generate your plan:
- 🔍 Research Destination: Get comprehensive information about your destination
- 📅 Generate Full Itinerary: Create a detailed day-by-day plan
- 💡 Quick Tips: Get essential travel tips
-
Export and save:
- Download your itinerary as a text file
- View detailed research results and itinerary in expandable sections
- Travel Styles: Honeymoon, Adventure, Relaxation, Cultural, Luxury, Family, Solo, Business
-
Budget Ranges: Budget (
$), Mid-range ($ $), Premium ($$$), Luxury ($$$$) - Accommodations: Hotels, Hostels, Airbnb, Resorts, Boutique Hotels, Camping
- Interests: Food & Dining, Museums, Nature, Nightlife, Shopping, History, Art, Sports, Photography
- Transportation: Walking, Public Transport, Car Rental, Mixed
gt_hk/
├── src/
│ └── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
└── README.md # This file
get_hf_client(): Initializes HuggingFace Inference Clienthf_chat_completion(): Handles chat completion with error handlingHFChatAgent: Custom agent class for AI-powered responsesOfflineAgent: Fallback agent for offline mode with templates
- Primary Model:
meta-llama/Llama-4-Scout-17B-16E-Instruct - Provider: Together AI via HuggingFace
- Max Tokens: 2048 per response
streamlit # Web application framework
huggingface_hub # HuggingFace API integration
textwrap # Text formatting utilities
datetime # Date and time handling
os # Operating system interface-
Configuration Sidebar:
- API key input
- Travel preferences
- Budget and style selection
-
Trip Details:
- Destination input
- Date selection
- Traveler count
- Special requirements
-
Quick Actions:
- Feature overview cards
- Action buttons
-
Results Display:
- Research results
- Generated itinerary
- Export options
- Gradient header design
- Responsive card layouts
- API status indicators
- Color-coded sections
- Mobile-friendly interface
The application includes comprehensive error handling for:
- API Connection Issues: Graceful fallback to offline mode
- Invalid API Keys: Clear error messages and setup instructions
- Model Unavailability: Automatic retry mechanisms
- Input Validation: Checks for required fields and valid dates
- Network Errors: Timeout and connection error handling
When no API key is provided, the application operates in offline mode with:
- Research Templates: Basic destination research structure
- Itinerary Templates: Generic day-by-day planning templates
- Travel Tips Templates: Essential travel preparation guidelines
Error: 401 Unauthorized
- Verify your HuggingFace API key is correct
- Ensure the token has proper permissions
- Try regenerating your API key
Error: Model not available
- Some models may be temporarily unavailable
- Try again later or use offline mode
- Check HuggingFace status page
Slow responses
- Free tier APIs have rate limits
- Consider upgrading to paid tiers for faster responses
- Use offline mode for immediate basic results
Dependencies not installing
- Ensure Python 3.1+ is installed
- Try using a virtual environment
- Update pip:
pip install --upgrade pip
Streamlit not starting
- Check if port 8501 is available
- Try:
streamlit run src/app.py --port 8502
- 📧 Email itinerary functionality
- 📱 Social sharing features
- 🗺️ Interactive maps integration
- 💾 Save/load itinerary profiles
- 🌐 Multi-language support
- 📊 Budget tracking and expense estimation
- 🎨 Custom itinerary themes
- 🔄 Real-time weather integration
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the HuggingFace documentation
- Open an issue in the repository
Built with ❤️ using Streamlit and HuggingFace
🌟 Plan smarter, travel better!