@nilskluewer/pi-gcp-agent-platform

Use Gemini models on Google Cloud Vertex AI / Gemini Enterprise Agent Platform from pi with ADC setup and multi-region endpoint support.

Packages

Package details

extension

Install @nilskluewer/pi-gcp-agent-platform from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@nilskluewer/pi-gcp-agent-platform
Package
@nilskluewer/pi-gcp-agent-platform
Version
0.1.1
Published
Jul 10, 2026
Downloads
254/mo · 12/wk
Author
nilskluewer
License
MIT
Types
extension
Size
10.7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions/gcp-agent-platform"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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-lite

Structure

.
├── extensions/
│   └── gcp-agent-platform/
│       └── index.ts  # Pi extension entry point
├── LICENSE
├── README.md
└── package.json      # npm and Pi package manifest

Setup

Requirements:

  • Google Cloud project with the Vertex AI API enabled.
  • Gemini models enabled/available in Vertex AI / Gemini Enterprise Agent Platform.
  • gcloud CLI 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 eu

The 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 login

Environment 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-platform

Use 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-flash

License

MIT