@nilskluewer/pi-gcp-agent-platform
v0.1.1
Published
Use Gemini models on Google Cloud Vertex AI / Gemini Enterprise Agent Platform from pi with ADC setup and multi-region endpoint support.
Maintainers
Readme
@nilskluewer/pi-gcp-agent-platform
Overview
Use Gemini models through Google Cloud Vertex AI / Gemini Enterprise Agent Platform in pi.
The extension configures Google Application Default Credentials and the Vertex location
for Pi's built-in google-vertex provider. Pi's Google SDK then selects the matching
global, EU, US, or regional Vertex endpoint.
Getting Started
pi install npm:@nilskluewer/pi-gcp-agent-platform
pi
/setup-gemini-vertexai your-project-id global
/model google-vertex/gemini-3.1-flash-liteStructure
.
├── extensions/
│ └── gcp-agent-platform/
│ └── index.ts # Pi extension entry point
├── LICENSE
├── README.md
└── package.json # npm and Pi package manifestSetup
Requirements:
- Google Cloud project with the Vertex AI API enabled.
- Gemini models enabled/available in Vertex AI / Gemini Enterprise Agent Platform.
gcloudCLI installed for Google Application Default Credentials.
Run the Pi setup command after installing the package:
/setup-gemini-vertexai <google-cloud-project> [location]Examples:
/setup-gemini-vertexai my-project-id global
/setup-gemini-vertexai my-project-id euThe command stores the project and location in Pi's user config directory and checks Google Application Default Credentials. If credentials are missing in interactive mode, it can run:
gcloud auth application-default loginEnvironment variables override the saved setup:
| Name | Description | Default |
|------|-------------|---------|
| GOOGLE_CLOUD_PROJECT | Google Cloud project ID used by Vertex AI. | Saved setup value |
| GCLOUD_PROJECT | Fallback project ID. | Optional |
| GOOGLE_CLOUD_LOCATION | Vertex AI region or multi-region. Use global for the global endpoint or eu for the EU multi-region endpoint. | Saved setup value or eu |
| CLOUD_ML_REGION | Compatibility fallback region. | Optional |
| VERTEX_REGION | Additional fallback region. | Optional |
Common endpoint mapping used by Vertex AI:
| Location | Endpoint |
|----------|----------|
| global | https://aiplatform.googleapis.com |
| eu | EU multi-region endpoint |
| us | US multi-region endpoint |
| other regions | Regional Vertex AI endpoint |
If the Anthropic Vertex package was configured first, this package reads that saved project/location as a fallback so both packages can share the same Google auth setup.
Run
Try the package without adding it to your settings:
pi -e npm:@nilskluewer/pi-gcp-agent-platformUse any Gemini model exposed by Pi's built-in google-vertex model list and available
in your Vertex AI project, for example:
pi --provider google-vertex --model gemini-3.1-flash-lite
pi --provider google-vertex --model gemini-3.5-flashLicense
MIT
