feat: Add Vertex AI provider for Claude models via Google ADC
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
Problem
mecatl cannot use Claude models hosted on Google Vertex AI. Vertex AI serves Claude via the Anthropic Messages API but requires Google Application Default Credentials (ADC) instead of an Anthropic API key, and routes through Vertex-specific endpoints (publishers/anthropic/models/{model}) rather than api.anthropic.com.
Attempting to use a Claude model on Vertex AI today requires a workaround outside mecatl because the existing anthropic provider only supports direct Anthropic API key authentication.
Proposed approach
The anthropic-sdk-go already ships vertex.WithGoogleAuth() and vertex.WithCredentials() (source), which handle ADC token injection and URL path rewriting (/v1/messages → Vertex-specific endpoints) transparently. The implementation adds a new registry entry that constructs the existing provider/anthropic adapter with Vertex options — no new wire-protocol translation needed.
Changes
provider/anthropic/— add Vertex constructionOptions wrappinganthropic-sdk-go/vertex(WithGoogleAuth+WithCredentials). The Vertex options are adapter-construction-time only, consistent with the existing pattern where provider-private knobs areOptions, notLLMRequestfields.internal/app/registry.go— newvertexai-anthropicregistry entry, constructed whenGOOGLE_CLOUD_PROJECTis set. Reuses the Anthropic adapter with Vertex options.internal/cliconfig/— wireGOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATION(defaultus-central1) environment variables intoProviderCredentials.
Authentication
Standard Google ADC — the same credential chain used by all Google Cloud SDKs:
- Local development:
gcloud auth application-default login - GKE/Cloud Run: workload identity (automatic)
- Elsewhere:
GOOGLE_APPLICATION_CREDENTIALSenv var pointing to a service account key
No API key required.
Usage
--model vertexai-anthropic:claude-sonnet-4-6
Out of scope (initial)
Non-Claude Vertex AI models (Gemini, Llama, Mistral, etc.) use different wire protocols (Google generateContent API or OpenAI-compatible Chat Completions). These can follow as separate providers in future work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading provider/anthropic/, internal/app/registry.go, and internal/cliconfig/ to trace provider construction and credential wiring. Check the anthropic-sdk-go vertex options and existing provider Option patterns before implementing the adapter construction. Done means vertexai-anthropic accepts Claude model names, uses Google ADC, and reads GOOGLE_CLOUD_PROJECT plus GOOGLE_CLOUD_LOCATION with the stated default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, google-cloud
- Domain
- backend, cli, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100