Skip to content

thrishank007/AI-Travel-Planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ AI Travel Planner

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.

โœจ Features

  • ๐Ÿ” 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

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.12 or higher
  • HuggingFace API key (optional but recommended for AI features)

Installation

  1. Clone the repository:

    git clone https://github.com/thrishank007/AI-Travel-Planner
    cd AI-Travel-Planner
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the application:

    streamlit run src/app.py
  4. Open your browser to http://localhost:8501

Setting up HuggingFace API

  1. Go to HuggingFace Settings
  2. Create a new token with 'Read' permissions
  3. Enter the token in the sidebar of the application

๐ŸŽฏ Usage

Basic Workflow

  1. Configure your preferences in the sidebar:

    • Enter your HuggingFace API key
    • Select travel style, budget range, and interests
    • Choose accommodation and transportation preferences
  2. Enter trip details:

    • Destination (e.g., "Tokyo, Japan")
    • Start and end dates
    • Number of travelers
    • Special requirements
  3. 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
  4. Export and save:

    • Download your itinerary as a text file
    • View detailed research results and itinerary in expandable sections

Travel Preferences

  • 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

๐Ÿ—๏ธ Project Structure

gt_hk/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ app.py              # Main Streamlit application
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ””โ”€โ”€ README.md              # This file

๐Ÿ”ง Technical Details

Core Components

AI Model

  • Primary Model: meta-llama/Llama-4-Scout-17B-16E-Instruct
  • Provider: Together AI via HuggingFace
  • Max Tokens: 2048 per response

Dependencies

streamlit              # Web application framework
huggingface_hub       # HuggingFace API integration
textwrap              # Text formatting utilities
datetime              # Date and time handling
os                    # Operating system interface

๐ŸŽจ User Interface

Main Sections

  1. Configuration Sidebar:

    • API key input
    • Travel preferences
    • Budget and style selection
  2. Trip Details:

    • Destination input
    • Date selection
    • Traveler count
    • Special requirements
  3. Quick Actions:

    • Feature overview cards
    • Action buttons
  4. Results Display:

    • Research results
    • Generated itinerary
    • Export options

Styling Features

  • Gradient header design
  • Responsive card layouts
  • API status indicators
  • Color-coded sections
  • Mobile-friendly interface

โš ๏ธ Error Handling

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

๐Ÿ”„ Offline Mode

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

๐Ÿšง Troubleshooting

Common Issues

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

Setup Issues

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

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿ“ง 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

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ’ฌ Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section above
  2. Review the HuggingFace documentation
  3. Open an issue in the repository

Built with โค๏ธ using Streamlit and HuggingFace

๐ŸŒŸ Plan smarter, travel better!

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages