npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@core-ai/anthropic-vertex

v0.16.0

Published

Vertex AI Anthropic (Claude) provider package for @core-ai/core-ai

Readme

@core-ai/anthropic-vertex

npm

Vertex AI Anthropic (Claude) provider package for @core-ai/core-ai. It uses the @anthropic-ai/vertex-sdk client and shares its request, streaming, tool-calling, structured-output, and reasoning behavior with @core-ai/anthropic.

Installation

npm install @core-ai/core-ai @core-ai/anthropic-vertex zod

Usage

import { generate } from '@core-ai/core-ai';
import { createAnthropicVertex } from '@core-ai/anthropic-vertex';

const anthropicVertex = createAnthropicVertex({
    projectId: process.env.GOOGLE_VERTEX_PROJECT,
    region: 'europe-west1',
});
const model = anthropicVertex.chatModel('claude-sonnet-4-6');

const result = await generate({
    model,
    messages: [{ role: 'user', content: 'Hello!' }],
});

console.log(result.content);

Authentication

By default, the provider uses Google Application Default Credentials (ADC):

const anthropicVertex = createAnthropicVertex({
    projectId: process.env.GOOGLE_VERTEX_PROJECT,
    region: 'europe-west1',
});

To authenticate with an explicit service account instead, parse its JSON key and pass it as credentials:

const rawCredentials = process.env.GOOGLE_APPLICATION_CREDENTIALS_JSON;
const credentialsJson = rawCredentials?.trim().startsWith('{')
    ? rawCredentials
    : Buffer.from(rawCredentials ?? '', 'base64').toString('utf8');

const anthropicVertex = createAnthropicVertex({
    projectId: process.env.GOOGLE_VERTEX_PROJECT,
    region: 'europe-west1',
    credentials: JSON.parse(credentialsJson),
});

You can also inject a preconfigured client (for example a custom AnthropicVertex instance, or one wired up for testing):

import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';

const anthropicVertex = createAnthropicVertex({
    client: new AnthropicVertex({ projectId: 'my-project', region: 'eu' }),
});

Model IDs and regions

Pass the Vertex model ID (as listed in the Vertex AI Model Garden) to chatModel(). Model availability and naming vary by region — for example, some Claude models are only published to Vertex AI's eu multi-region while others are published to region-specific endpoints like europe-west1. Since a provider instance targets a single region, create separate providers if you need to reach models hosted in different regions:

const anthropicVertexEu = createAnthropicVertex({
    projectId: process.env.GOOGLE_VERTEX_PROJECT,
    region: 'eu',
});
const anthropicVertexEuWest1 = createAnthropicVertex({
    projectId: process.env.GOOGLE_VERTEX_PROJECT,
    region: 'europe-west1',
});

This package supports chat models only.

Caveat: Pass the unversioned Vertex model id (e.g. claude-sonnet-4-6) rather than a version-pinned id (e.g. claude-sonnet-4-6@20250929). Reasoning-effort and sampling-restriction capability detection (getAnthropicModelCapabilities and friends in @core-ai/anthropic) only recognizes the unversioned form today, so a version-pinned id silently falls back to standard capabilities instead of the model's actual ones.

Provider options and model capabilities

This provider shares its request, streaming, and reasoning behavior with @core-ai/anthropic. Provider-options schemas (anthropicGenerateProviderOptionsSchema), reasoning metadata types (AnthropicReasoningMetadata), and model capability helpers (getAnthropicModelCapabilities) are available from @core-ai/anthropic and apply equally to Vertex-hosted Claude models.