Last active
November 7, 2025 19:16
-
-
Save sallyom/25ff7164c57aec2855dd17d83f0a62c1 to your computer and use it in GitHub Desktop.
gcloud script to get claude vertex models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Simple script to list available Claude models in Vertex AI using gcloud CLI | |
| # | |
| # Usage: | |
| # ./list-vertex-models.sh [REGION] | |
| # | |
| # Example: | |
| # ./list-vertex-models.sh us-east5 | |
| set -e | |
| REGION="${1:-us-east5}" | |
| echo "Listing Claude models available in Vertex AI (region: $REGION)..." | |
| echo "" | |
| # Check if gcloud is installed | |
| if ! command -v gcloud &> /dev/null; then | |
| echo "ERROR: gcloud CLI not found" | |
| echo "Install from: https://cloud.google.com/sdk/docs/install" | |
| exit 1 | |
| fi | |
| # List models | |
| gcloud ai models list \ | |
| --region="$REGION" \ | |
| --filter="publisherModelId:claude*" \ | |
| --format="table(publisherModelId:label='Model ID',createTime:label='Created')" \ | |
| 2>/dev/null || { | |
| echo "ERROR: Failed to list models" | |
| echo "" | |
| echo "Make sure:" | |
| echo " 1. You're authenticated: gcloud auth login" | |
| echo " 2. Project is set: gcloud config set project YOUR_PROJECT" | |
| echo " 3. Region '$REGION' is valid and has Claude models" | |
| exit 1 | |
| } | |
| echo "" | |
| echo "To use a different region: $0 <region>" | |
| echo "Common regions: us-east5, us-central1, europe-west1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment