WebInfer

🤖

Anthropic on Vertex AI

Claude models via Google Cloud Vertex AI

Flagship
Major Cloud Provider
API

Configure Anthropic on Vertex AI

Enable Anthropic on Vertex AI in Settings

Go to Settings
Capabilities
chat
vision
function-calling
enterprise
vertex-ai
Configuration Schema
Required and optional fields for configuring this provider
FieldTypeRequired
projectId
text
Required
region
text
Optional
CLI Usage
For users running the daemon server locally or a self-hosted gateway

Add provider:

npx webinfer provider add anthropic-vertex

Test connection:

npx webinfer provider test anthropic-vertex
Programmatic Usage
Use Anthropic on Vertex AI in your code with WebInfer

Basic usage:

import { generateText } from "webinfer"

// WebInfer automatically routes to the best available provider
const result = await generateText({
  prompt: "Write a haiku about programming"
})

console.log(result.text)

Specify Anthropic on Vertex AI explicitly:

import { generateText } from "webinfer"

const result = await generateText({
  prompt: "Write a haiku about programming",
  provider: "anthropic-vertex",
  model: "claude-3-5-sonnet-v2@20241022"
})

console.log(result.text)
console.log("Provider:", result.provider)
console.log("Model:", result.model)

Streaming:

import { streamText } from "webinfer"

const { textStream } = await streamText({
  prompt: "Write a story about AI",
  provider: "anthropic-vertex"
})

for await (const chunk of textStream) {
  process.stdout.write(chunk)
}