Providers

Google Vertex AI

Route Anthropic or Gemini models through Google Cloud Vertex AI.

Setup

pnpm add @ai-sdk/google-vertex
import { AiSdkProvider } from "noumen";
import { createVertex } from "@ai-sdk/google-vertex";

const vertex = createVertex({
  project: process.env.GOOGLE_CLOUD_PROJECT ?? "my-gcp-project",
  location: process.env.GOOGLE_CLOUD_LOCATION ?? "us-central1",
});

// Claude via Vertex:
const claudeProvider = new AiSdkProvider({
  model: vertex.anthropic("claude-opus-4.6"),
  providerFamily: "anthropic",
  cacheConfig: { enabled: true },
});

// Native Gemini via Vertex:
const geminiProvider = new AiSdkProvider({
  model: vertex("gemini-2.5-pro"),
  providerFamily: "google",
});

Options

All connection-level options come from createVertex.

OptionSourceDescription
projectcreateVertexGCP project ID. Falls back to application default credentials.
locationcreateVertexGCP region (e.g. us-central1, us-east5).
googleAuthOptionscreateVertexOptions forwarded to the google-auth-library GoogleAuth constructor.
headers, baseURLcreateVertexCustom headers and endpoint override.

AiSdkProvider options

Set providerFamily: "anthropic" when using vertex.anthropic(...) so noumen routes thinking/cache config through Anthropic's format. Use providerFamily: "google" for native Gemini-on-Vertex. The CLI shorthand (provider: "vertex") auto-selects based on whether the model id contains "claude".

Authentication

When googleAuthOptions is omitted, the provider uses application default credentials. Pass your own GoogleAuth-style options for custom authentication:

const vertex = createVertex({
  project: "my-project",
  googleAuthOptions: { keyFile: "/path/to/service-account.json" },
});

Prompt caching

Claude-on-Vertex supports Anthropic-style prompt caching:

const provider = new AiSdkProvider({
  model: vertex.anthropic("claude-opus-4.6"),
  providerFamily: "anthropic",
  cacheConfig: { enabled: true },
});

Streaming

Vertex traffic goes through the AI SDK's doStream() and noumen's shared family-specific mapping. For Claude-on-Vertex, thinking, signature, and redactedData flow through unmodified.

Models

Vertex accepts both Anthropic and Google Gemini model IDs:

Claude (via vertex.anthropic(...))

  • claude-opus-4.6 — highest capability (default for the "vertex" CLI shorthand).
  • claude-sonnet-4 — balanced speed and capability.
  • claude-haiku-3 — fastest, most affordable.

Gemini (via vertex(...))

  • gemini-2.5-pro
  • gemini-2.5-flash
  • gemini-2.0-flash