feat: add google-vertex-openai provider for Vertex AI partner models#716
Open
bluet wants to merge 2 commits intoanomalyco:devfrom
Open
feat: add google-vertex-openai provider for Vertex AI partner models#716bluet wants to merge 2 commits intoanomalyco:devfrom
bluet wants to merge 2 commits intoanomalyco:devfrom
Conversation
Add support for Vertex AI partner models that use OpenAI-compatible endpoint:
- GLM-4.7: Advanced multilingual MoE model with interleaved thinking
- Llama 4 Maverick: Multimodal model with 1M context
- Llama 3.3 70B: Text-only instruction model
- Qwen3 235B: Large-scale model with hybrid thinking
- DeepSeek V3.1: Advanced reasoning model
These models use the OpenAI-compatible Chat Completions API at:
/v1/projects/{project}/locations/{location}/endpoints/openapi/chat/completions
Provider uses @ai-sdk/openai-compatible with Google OAuth injection.
Remove GLM and GPT-OSS models from google-vertex provider because @ai-sdk/google-vertex SDK only supports Gemini models. These models have been moved to the new google-vertex-openai provider which uses the correct OpenAI-compatible endpoint.
Contributor
|
I think im going to consolidate all the google vertex stuff under a single provider and override npm and api fields using [provider] section per model as needed. This will require additional tweaks in opencode tho |
Author
|
@rekram1-node anything I can do/help with to accelerate this? I've also created a related PR in opencode anomalyco/opencode#10742 |
Contributor
|
User bluet does not have write permissions |
Author
|
@rekram1-node I've closed my opencode PR #10742 in favor of the existing PR #10303 by @leehack, which takes the same consolidation approach you mentioned (using For this models.dev PR, what would you like me to do? Options:
Let me know what works best for you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Google Vertex AI partner models (GLM, Llama, Qwen, DeepSeek) that use the OpenAI-compatible Chat Completions API endpoint.
Problem
The
@ai-sdk/google-vertexSDK only supports Google's Gemini models because it hardcodespublishers/googlein URL construction and uses the Gemini API format. Partner models like GLM-4.7, Llama, Qwen, and DeepSeek use a different endpoint pattern that requires OpenAI-compatible formatting.Solution
Created new provider
google-vertex-openaithat:@ai-sdk/openai-compatibleSDK instead of@ai-sdk/google-vertex/v1/projects/{project}/locations/{location}/endpoints/openapi/chat/completionsModels Added
Changes
providers/google-vertex-openai/with provider.toml and 5 model definitionsgoogle-vertex/models/zai-org/andopenai/Next Steps
A companion PR is needed in
anomalyco/opencodeto add the custom loader that injects Google OAuth authentication.References