You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Supporting Vertex-based models using google auth #272
And actually this isn't fully accurate, @ai-sdk/google-vertex works for Gemini models but @ai-sdk/google-vertex/anthropic is needed for Claude models hosted on Vertex.
Alternatively, what I did for now is simply use my litellm proxy gateway running in a seperate process with the following config:
The only problem with this is you don't get token/cost tracking data. I think a fair number of people do this, so it could be nice to simply flag somehow that the model you're passing through is the "official" model from models.dev?
Reacted by Anurag Roy, Graham Anderson, Aryk Anderson, Nacho Vazquez, suwncap, Petter Søland, jbb494, Jeff Grover, Andrew Grigorev, CAB and 13 more
I would also like to see Vertex AI support for Anthropic models. I believe most large companies already provide their employees access to LLMs through Vertex AI due to corporate policies. What is the current status of this feature? I look forward to helping with this.
Authentication seems to be made under the hood by gcloud auth - or was it the fact that I ran opencode auth and gave it the access token from gclound auth application-default print-access-token? 🤷
I can see from cloud logs I'm making authenticated requests, so I can see that it really works.
@NachoVazquez not sure what you mean. I'm using gemini-cli and various Neovim plugins (codecompanion, avante) as well as opencode with the Gemini models in Vertex, namely flash 2.5 and pro 2.5. The models are specified in the snippet above.
Right, there are two PRs related to this, but it would probably not be enough since @ai-sdk/google-vertex is not enough; @ai-sdk/google-vertex/anthropic is needed here.
@thdxr is this something that qualifies for open source contribution (I'm unsure what the line is for "core features") and/or would you be able to take a look?
@thdxr said they are working on it, they actually will be using vertex for a bunch of their work internally so I expect the vertex support to be really good once it is here
Activity
NachoVazquez commentedon Jun 22, 2025
Oh yes, I need this, all my credits are in Vertex.
@thdxr, happy to help with the implementation. I won't jump into it right now, as you're assigned, but please let me know.
admSla99 commentedon Jul 9, 2025
I would also like to see Vertex AI support for Anthropic models. I believe most large companies already provide their employees access to LLMs through Vertex AI due to corporate policies. What is the current status of this feature? I look forward to helping with this.
fredrikaverpil commentedon Jul 22, 2025
This worked for me, targeting a GCP project in Vertex AI (
aiplatform.googleapis.com):{ "$schema": "https://opencode.ai/config.json", "theme": "system", "autoupdate": true, "provider": { "google-vertex": { "models": { "gemini-2.5-flash": {}, "gemini-2.5-pro": {} }, "options": { "project": "{env:GOOGLE_CLOUD_PROJECT}", "location": "{env:GOOGLE_CLOUD_LOCATION}" } } } }Authentication seems to be made under the hood by
gcloud auth- or was it the fact that I ranopencode authand gave it the access token fromgclound auth application-default print-access-token? 🤷I can see from cloud logs I'm making authenticated requests, so I can see that it really works.
NachoVazquez commentedon Jul 22, 2025
This is interesting, @fredrikaverpil. How would you define the model if you are using Claude through Vertex?
fredrikaverpil commentedon Jul 22, 2025
@NachoVazquez not sure what you mean. I'm using gemini-cli and various Neovim plugins (codecompanion, avante) as well as opencode with the Gemini models in Vertex, namely flash 2.5 and pro 2.5. The models are specified in the snippet above.
NachoVazquez commentedon Jul 22, 2025
I'm trying to use Claude Code through Vertex. That's how I use it with Claude Code. I tried following your config, but it doesn't seem to work for me.
NachoVazquez commentedon Jul 22, 2025
Some development is needed, it seems, as stated in the issue description.
fredrikaverpil commentedon Jul 22, 2025
Claude is not listed under Vertex in https://models.dev, which is what opencode uses.
NachoVazquez commentedon Jul 22, 2025
Right, there are two PRs related to this, but it would probably not be enough since
@ai-sdk/google-vertexis not enough;@ai-sdk/google-vertex/anthropicis needed here.I will try to put a PR together this weekend.
anomalyco/models.dev#23
anomalyco/models.dev#60
king-11 commentedon Aug 15, 2025
Both the PRs are merged I think we can work on bringing the anthropic SDK into opencode?
jacobmikesell commentedon Aug 18, 2025
Opened #2028 and confirmed its enough, theres probably a more elegant way, but it gets me off to the races for now!
cafreeman commentedon Aug 20, 2025
Any updates on this PR? I think this is the only thing between me and being able to use opencode at work 🤞
jacobmikesell commentedon Aug 22, 2025
@thdxr is this something that qualifies for open source contribution (I'm unsure what the line is for "core features") and/or would you be able to take a look?
rekram1-node commentedon Aug 22, 2025
more to come on this v soon
evatths commentedon Aug 26, 2025
This works now right?
thdxr commentedon Aug 27, 2025
ill fix this this week, we're getting setup on vertex ourselves
chris-freeman-glean commentedon Aug 27, 2025
yessssssss can't wait
bqrkhn commentedon Aug 29, 2025
Can't wait. Google gave us credits and fire up Opus with OpenCode
yukukotani commentedon Sep 2, 2025
opened PR #2347
nefthy commentedon Sep 5, 2025
@bqrkhn can't use your credits with anthropic models.
cafreeman commentedon Sep 10, 2025
Any updates on this? There's been a couple minor version updates and I keep hoping one of them will make my vertex stuff start working
rekram1-node commentedon Sep 10, 2025
@thdxr said they are working on it, they actually will be using vertex for a bunch of their work internally so I expect the vertex support to be really good once it is here
phase7 commentedon Sep 18, 2025
Would love to see this work, I believe this will help opencode's adoption soar higher
dan-myles commentedon Sep 23, 2025
Would love seeing this, their TPS is off the charts.
jonnypillar-cio commentedon Sep 25, 2025
I check this daily in the hope I can finally use this at work 😢
rawwerks commentedon Oct 1, 2025
i am sitting on $100K in gcp credits and a super high vertex rate limit, would love to experiment with opencode if we could get this through: #2347
Merge pull request anomalyco#272 from Latitudes-Dev/shuvcode-dev
chore(config): governance and config foundation (anomalyco#292)