@nilskluewer/pi-gcp-agent-platform

Use Claude and Gemini models on Google Cloud Vertex AI / Gemini Enterprise Agent Platform from pi.

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.2.0
Published
Aug 28, 2026
Downloads
236/mo · 181/wk
Author
nilskluewer
License
MIT
Types
extension
Size
20.1 KB
Dependencies
1 dependency · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/gcp-agent-platform/index.ts"
  ]
}

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 Claude and Gemini models through Google Cloud Vertex AI / Gemini Enterprise Agent Platform in pi.

This package contains both Vertex model adapters:

  • anthropic-vertex uses Anthropic's AnthropicVertex client for Claude.
  • google-vertex uses pi's native Google Vertex provider for Gemini.

The Google Cloud project, location, and Application Default Credentials setup are shared by both providers.

Getting Started

pi install npm:@nilskluewer/pi-gcp-agent-platform
pi
/setup-gemini-vertexai your-project-id eu
/model google-vertex/gemini-3.1-flash-lite

Select Claude in the same session with:

/model anthropic-vertex/claude-opus-5

The legacy /setup-vertexai command remains available as an alias.

Structure

.
├── extensions/
│   └── gcp-agent-platform/
│       ├── index.ts       # shared setup and provider registration
│       └── anthropic.ts    # AnthropicVertex adapter for Claude
├── LICENSE
├── README.md
└── package.json

Setup

Requirements:

  • Google Cloud project with the Vertex AI API enabled.
  • Claude and/or Gemini models enabled and available in Vertex AI / Gemini Enterprise Agent Platform.
  • gcloud installed for Google Application Default Credentials.

Run the setup command in pi:

/setup-gemini-vertexai <google-cloud-project> [location]

Examples:

/setup-gemini-vertexai my-project-id eu
/setup-gemini-vertexai my-project-id global

The command stores the shared project and location in:

~/.pi/agent/gcp-agent-platform.json

It also checks Google Application Default Credentials and can start:

gcloud auth application-default login

Environment variables override the saved setup:

Name Description Default
GOOGLE_CLOUD_PROJECT Google Cloud project ID. Saved setup value
ANTHROPIC_VERTEX_PROJECT_ID Claude-compatible project ID fallback. Optional
GCLOUD_PROJECT Google Cloud project ID fallback. Optional
GOOGLE_CLOUD_LOCATION Vertex region or multi-region. Saved setup value or eu
CLOUD_ML_REGION Region fallback. Optional
VERTEX_REGION Additional region fallback. Optional

The package reads the former Anthropic Vertex setup file as a migration fallback, but new configuration is written only to gcp-agent-platform.json.

Endpoints and model availability

Location Endpoint
global https://aiplatform.googleapis.com
eu EU multi-region Vertex endpoint
us US multi-region Vertex endpoint
other regions Regional Vertex endpoint

Model availability depends on the selected location and the Google Cloud project. For example, some Gemini models available on global are not available in eu.

Models

Use any Claude model exposed by pi's Anthropic catalog and available in the project:

/model anthropic-vertex/claude-opus-5
/model anthropic-vertex/claude-sonnet-5
/model anthropic-vertex/claude-opus-4-8

Use any Gemini model exposed by pi's Google Vertex catalog and available in the project:

/model google-vertex/gemini-3.1-flash-lite
/model google-vertex/gemini-3.5-flash

Vertex AI does not support Anthropic's server-side fallbacks request parameter. The Claude adapter removes that Anthropic-only model metadata before sending requests.

Run without installing

pi -e npm:@nilskluewer/pi-gcp-agent-platform

Migration from the standalone packages

Use this package as the single canonical Vertex package. The former standalone Anthropic package is no longer needed in pi settings.

pi remove /path/to/pi-anthropic-vertex-enterprise-agent-platform
pi install npm:@nilskluewer/pi-gcp-agent-platform

pi-vertex-gemini-search is a separate optional web-search extension and is not part of this model package.

License

MIT