- Setting up environment
- Create Virtual environment
- Install requirements in a text file; I named mine
requirements.txt which lists:
- streamlit
- google-cloud-aiplatform
- vertexai```
pip install -r requirements.txt
- Setting the region to one that supports Vertex AI
- gcloud config set ai/region us-central1
- gcloud config list (verifying)
- Downloaded Google Cloud
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
tar -xvf google-cloud-cli-linux-x86_64.tar.gz
cd google-cloud-sdk ./install.sh
- Authenticating gcloud
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
gcloud auth list for verification
nano ~/.bashrc and adding export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"
source ~/.bashrc for reloading and applying changes
- Code (in github)
- Enable API (AI Platform, Vertex AI, Service Usage API)
- Connect billing information for Vertex AI
- Add credentials and create a service account
- Add specific roles to the service account
- Run the application
streamlit run gemini_explorer.py
Useful
- Checking all projects:
gcloud projects list
- Checking current project config:
gcloud config list