Skip to content

feat(providers): add Google Vertex AI provider for Claude#3569

Open
eilonc-pillar wants to merge 2 commits intoNousResearch:mainfrom
eilonc-pillar:feat/vertex-ai-provider
Open

feat(providers): add Google Vertex AI provider for Claude#3569
eilonc-pillar wants to merge 2 commits intoNousResearch:mainfrom
eilonc-pillar:feat/vertex-ai-provider

Conversation

@eilonc-pillar
Copy link
Copy Markdown

@eilonc-pillar eilonc-pillar commented Mar 28, 2026

Summary

Adds vertex-ai as a first-class provider, enabling Claude models via Google Cloud Vertex AI with Application Default Credentials (ADC).

  • Uses AnthropicVertex from anthropic[vertex] SDK
  • Reuses 100% of the existing Anthropic adapter (message conversion, tool handling, streaming)
  • Only client instantiation differs — zero new adapters needed

Configuration

provider: vertex-ai
model: claude-opus-4-6
# Environment
export VERTEX_PROJECT=my-gcp-project   # required
export VERTEX_REGION=us-east5           # optional, default: us-east5

# Auth (any of these):
# 1. Attached service account on GCP VMs (ADC) — zero config
# 2. GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
# 3. gcloud auth application-default login (local dev)

Changes

File Lines What
agent/anthropic_adapter.py +58 build_vertex_client() + resolve_vertex_credentials()
agent/auxiliary_client.py +28 _try_vertex() + auto-chain guard + aux model entry
hermes_cli/auth.py +7 Provider registry entry
run_agent.py +17 Provider detection + client init
pyproject.toml +2 vertex optional extra

Tested

$ python3 -c "..."
Credentials: project=test-project, region=us-east5
Client: AnthropicVertex
Response: Hello to you!
Model: claude-opus-4-6
SUCCESS

Design Decisions

  • No new adapter: AnthropicVertex speaks the same Messages API as Anthropic. Setting api_mode = "anthropic_messages" reuses all existing message conversion, tool handling, and streaming code.
  • No beta headers: Beta headers are not forwarded to Vertex — feature availability may differ from the direct API. The SDK handles its own negotiation.
  • Auto-chain guard: _resolve_api_key_provider() has an explicit vertex-ai guard to prevent the generic OpenAI client path from mishandling GCP project IDs.
  • Credential fallback: Checks VERTEX_PROJECT, GOOGLE_CLOUD_PROJECT, and GCP_PROJECT_ID in order.

Install

pip install 'hermes-agent[vertex]'

Enables Claude models via Google Cloud Vertex AI with Application
Default Credentials (ADC). Uses the official AnthropicVertex client
from the anthropic[vertex] SDK, reusing 100% of the existing
Anthropic adapter (message conversion, tool handling, streaming).

Configuration:
  provider: vertex-ai
  model: claude-opus-4-6

Environment:
  VERTEX_PROJECT=my-gcp-project  (required)
  VERTEX_REGION=us-east5          (optional, default: us-east5)

Authentication:
  - Attached service account on GCP VMs (ADC)
  - GOOGLE_APPLICATION_CREDENTIALS key file
  - gcloud auth application-default login (local dev)

No new adapters needed — Vertex AI Claude speaks the same Messages API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eilonc-pillar
Copy link
Copy Markdown
Author

Hi all - @leon @intertwine @timknip @rewbs

Very good job on the Hermes agent! It delivers a lot of value and innovation.
I've opened this PR to enable powering hermes agent with Google's vertex AI juice (both ACP and SA json). Would appreciate if you consider to add this.

Best,
Eilon, Pillar Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant