vertex

package
v1.115.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package vertex provides an Anthropic client for Claude models hosted on Google Cloud's Vertex AI. It lives in its own package so that importing the core anthropic provider does not pull the Google Cloud auth stack (cloud.google.com/go/auth, google.golang.org/api, grpc, ...).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, cfg *latest.ModelConfig, env environment.Provider, project, location string, opts ...options.Opt) (*anthropic.Client, error)

NewClient creates a new Anthropic client that talks to Claude models hosted on Google Cloud's Vertex AI via the Anthropic-native endpoints (`:rawPredict` and `:streamRawPredict`), authenticated with Google Application Default Credentials.

This is required because Anthropic models on Vertex AI do not support the OpenAI-compatible `/chat/completions` endpoint and fail with `FAILED_PRECONDITION: The deployed model does not support ChatCompletions.`

See: https://docs.anthropic.com/en/api/claude-on-vertex-ai

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL