TODO: I need to update all of this. It's GitHub Copilot-generated.
-
Clone the repository:
git clone https://github.com/gallimorej/llm-comparator.git cd llm-comparator -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory of the project and add the following environment variables:DOCKER_IMAGE=your_docker_image_name DOCKER_CONTAINER=your_docker_container_name PORT=your_port_number PROJECT_ID=your_google_cloud_project_id APP_NAME=your_app_name REGION=your_google_cloud_region REACT_APP_OPENAI_API_KEY=your_openai_api_key REACT_APP_ANTHROPIC_API_KEY=your_anthropic_api_key SERVICE_ACCOUNT=your_google_cloud_service_account SLACK_TOKEN=your_slack_token (if applicable) CONFIG_BUCKET_NAME=your_google_cloud_storage_bucket_name # Name of the GCS bucket where config.json is stored -
Run the Flask app:
python app.py
-
Open your web browser and go to
http://127.0.0.1:5000to access the app.
-
Build the Docker image:
docker build -t gcr.io/[PROJECT_ID]/[IMAGE_NAME] . -
Push the Docker image to Google Container Registry:
docker push gcr.io/[PROJECT_ID]/[IMAGE_NAME]
-
Deploy the container to Google Cloud Run:
gcloud run deploy [SERVICE_NAME] --image gcr.io/[PROJECT_ID]/[IMAGE_NAME] --platform managed --region [REGION] --allow-unauthenticated
-
Retrieve the service URL:
gcloud run services describe [SERVICE_NAME] --platform managed --region [REGION] --format "value(status.url)" -
Open the service URL in your web browser to access the deployed app.