Final Product: Chat with your Data (Scrape public websites/ your PDFs) GenAI project
This repository is designed for a workshop teach the concept of in context learning and working with vectirstires (pgvector) when building GenAI applications with LangChain.
Server Side: LangChain 🦜🔗
Vectorstore: Postgres PGVector
Embeddings: GCP VertexAI
LLM: PaLM 2
To run this project, you will need to add the following environment variables to your .env file
DB_URL
APPLICATION_DEFAULT_CREDENTIALS
Clone the project
git clone https://github.com/emarco177/gcp-llm-workshop.gitGo to the project directory
cd gcp-llm-workshopInstall dependencies
pipenv installStart the Streamlit server
python3 run rag/ingestion.py
python3 run rag/retrieval_aguentation.pyNOTE: When running locally make sure GOOGLE_APPLICATION_CREDENTIALS is set to a service account with permissions to use VertexAI
Please replace $PROJECT_ID with your actual Google Cloud project ID.
To deploy manually:
- Make sure you enable GCP APIs:
gcloud services enable vertexai.googleapis.com
- Create a service account
vertex-ai-consumerwith the following roles:
gcloud iam service-accounts create vertex-ai-consumer \
--display-name="Vertex AI Consumer"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:vertex-ai-consumer@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/serviceusage.serviceUsageConsumer"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:vertex-ai-consumer@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/ml.admin"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:vertex-ai-consumer@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/vertexai.admin"Eden Marco, Customer Engineer @ Google Cloud, Tel Aviv🇮🇱
