Allow Claude model requests to route through Google Vertex AI#23985
Allow Claude model requests to route through Google Vertex AI#23985vincentkoc merged 11 commits intoopenclaw:mainfrom
Conversation
|
Merge-readiness deep-dive (timeline-aware):
Current gate status:
Requested final patch before merge:
Changelog/credit suggestion (when merged):
If you want, I can do a final merge-gate pass immediately after the missing-project fix commit lands. |
10d482d to
7143019
Compare
|
Deep-dive update complete:
Current CI note:
|
|
Implemented now (before merge) per naming discussion:
Net effect: no post-merge migration required for the naming direction, while avoiding immediate breakage for anyone already testing with |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
8a56657 to
98d52c7
Compare
|
@sallyom please be mindful of generating huge changes, as you can see the change required was only very very minimal. |
|
@greptile review |
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
|
The PR content itself is drifting inside, vertex -> vercel ... ? seems like opus confused itself haha |
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
|
@vincentkoc The merged PR only added Vercel AI Gateway Claude shorthand normalization (letting users write vercel-ai-gateway/claude-opus-4.6 instead of vercel-ai-gateway/anthropic/claude-opus-4.6) I actually didn't have this change in the PR. The actual Google Vertex AI provider — streaming implementation, auth wiring, provider registration, and docs — was stripped out. This doesn't resolve the issue: #6937 - the PR solved a completely different problem than what was submitted. The Vertex provider still needs to land. @paulclarkaranz @KMilhan I rebased against upstream/main: https://github.com/sallyom/openclaw/tree/vertex-anthropic, feel free to build off of it to test - unless I'm missing something that is what is needed to run anthropic models through google vertex ai accounts that have access to anthropic. Please confirm if possible! |
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
|
I'll re-open the PR with my vertex-anthropic branch, here's why we still need it. @paulclarkaranz @KMilhan hopefully can confirm that I'm not missing something, ty! [summary from Claude] |
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…aw#23985) * feat: add anthropic-vertex provider for Claude via GCP Vertex AI Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for openclaw#23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
organizations bill Claude usage through their existing GCP projects/agreements.
Claude Sonnet 4.5, Claude Opus 4.5, and Claude Haiku 3.5. No manual config needed.
(Gemini) provider. Supports GOOGLE_APPLICATION_CREDENTIALS, ANTHROPIC_VERTEX_PROJECT_ID, and CLOUD_ML_REGION env vars.
No breaking changes. The new provider is additive and only activates when GCP env vars are present.
List user-visible changes (including defaults/config).
If none, write
None.Security Impact (required)
Yes)Yes)Yes)No)No)Yes, explain risk + mitigation:New network calls are made to
https://{region}-aiplatform.googleapis.comvia the @anthropic-ai/vertex-sdk. The SDK handles GCP access token acquisition and refresh internally through Application Default Credentials (reads the service account JSON atGOOGLE_APPLICATION_CREDENTIALS). No tokens are stored, logged, or passed through OpenClaw code — the SDK manages the full auth lifecycle. The risk profile is identical to the existing google-vertex (Gemini) and amazon-bedrock providers, which follow the same pattern of delegating cloud auth to their respective SDKs. The provider only activates when bothGOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONare explicitly set.Repro + Verification
Configuration
Set two environment variables and authenticate with Google Cloud:
export GOOGLE_CLOUD_PROJECT=your-gcp-project-id
export GOOGLE_CLOUD_LOCATION=global
Authenticate via one of:
gcloud auth application-default login
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa-key.json
The provider is automatically detected — no changes to openclaw.json are needed. Run openclaw models list to verify. To set it as the default model:
{ "agents": { "defaults": { "model": { "primary": "anthropic-vertex/claude-sonnet-4-6" } } } }
Note: Latest models (Opus 4.6, Sonnet 4.6) use plain IDs on Vertex AI. Only older models require @yyyymmdd date suffixes. I tested with claude-sonnet-4-5@20250929
Environment
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Verified scenarios:
Set creds.json as a secret in a K8s deployment, mounted and accepted by openclaw's FS
What you did not verify: I only verified with the single claude-sonnet-4.5 and note: need to use the google-vertex/anthropic model ID with any model prior to 4.6
Compatibility / Migration
Yes)Yes)No)Greptile Summary
This PR adds Vercel AI Gateway Claude shorthand normalization so users can write
vercel-ai-gateway/claude-opus-4.6orvercel-ai-gateway/opus-4.6instead of the fully qualifiedvercel-ai-gateway/anthropic/claude-opus-4.6. The normalization reuses the existingnormalizeAnthropicModelIdalias resolution and only activates for model IDs that resolve to aclaude-*prefix, leaving non-Claude models untouched.vercel-ai-gatewaybranch innormalizeProviderModelId()that prependsanthropic/to Claude shorthand refs, guarded by!model.includes("/")to avoid double-prefixingclaude-*prefixed models and alias-style shorthand (opus-4.6)docs/providers/vercel-ai-gateway.mdConfidence Score: 4/5
Last reviewed commit: b13654d