Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@twogiants/pi-anthropic-vertex

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twogiants/pi-anthropic-vertex

Anthropic Claude models on Google Cloud Vertex AI for pi

latest
Source
npmnpm
Version
0.1.8
Version published
Weekly downloads
502
135.68%
Maintainers
1
Weekly downloads
 
Created
Source

pi-anthropic-vertex

npm

Anthropic Claude models on Google Cloud Vertex AI for pi.

Compatibility

Extensionpi
0.1.80.75.5
0.1.70.75.4
0.1.60.75.1
0.1.50.74.1
0.1.40.72.0 - 0.73.1
0.1.30.72.0 - 0.73.0
0.1.20.67.1 - 0.71.0
0.1.00.66.1

Prerequisites

  • Google Cloud project with Vertex AI API enabled
  • Claude models enabled in Model Garden
  • gcloud CLI installed and authenticated

How it works

This extension injects an AnthropicVertex client into pi's built-in anthropic-messages streaming implementation. All message transformation, prompt caching, tool call normalization, thinking block replay, partial JSON streaming, and usage tracking are handled by pi's battle-tested internals, nothing is reimplemented.

Other Vertex AI extensions (pi-vertex-claude, pi-vertex, pi-anthropic-vertex) reimplement the Anthropic streaming protocol from scratch at 500–1500 lines, losing features like prompt caching, tool call adjacency enforcement, aborted message filtering, and partial JSON parsing. This extension delegates to pi's built-in at ~160 lines and inherits everything for free.

Model definitions are pulled at runtime from pi's built-in Anthropic provider via getModels("anthropic"), so new Claude models are picked up automatically when pi updates.

Install

pi install npm:@twogiants/pi-anthropic-vertex

Or install from git:

pi install git:github.com/twoGiants/pi-anthropic-vertex

Setup

Authenticate with Google Cloud:

gcloud auth application-default login

Set your project and region:

export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=us-east5  # optional, defaults to us-east5

Usage

pi --provider anthropic-vertex --model claude-opus-4-6
pi --provider anthropic-vertex --model claude-sonnet-4-6

All Claude models available on Vertex AI are registered automatically.

License

MIT

Keywords

pi-package

FAQs

Package last updated on 24 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts