This is a practical project of an AI Travel Itinerary Generator that uses 100% local Artificial Intelligence. Powered by the LangChain framework, the system takes a destination and travel style to create a detailed, personalized itinerary.
- Local Processing: Runs the Llama-3.2-1B model via GPT4All (100% privacy, no API keys required).
- Prompt Engineering: Optimized English templates for better logical reasoning, with output tailored to the user's needs.
- LCEL Architecture: Built using LangChain Expression Language for a clean and scalable data pipeline.
- Python 3.10+
- LangChain (Orchestration Framework)
- GPT4All (Backend for local model execution)
- Llama-3.2-1B-Instruct (Meta's lightweight LLM)
Before running the project, you must download the model using the GPT4All software and note the absolute path to the .gguf file.
Install the required libraries:
pip install langchain langchain-community gpt4all
In the main script, ensure you update the model path to the correct directory on your machine:
model_path = r"C:\Users\YOUR_USER\...\Llama-3.2-1B-Instruct-Q4_0.gguf"The main script uses an input dictionary to define the trip details:
input_data = {
"destination": "Rio de Janeiro",
"days": "3",
"style": "budget-friendly and cultural"
}To run the generator:
python main.py
- Model (LLM): Loading Llama-3.2 via the GPT4All integration.
- Prompt Template: A structured instruction set that defines the AI's behavior as an expert travel guide.
- Chain: Connecting the prompt and the model using the pipe (
|) operator.