feat: add google-vertex-openai provider for Vertex AI partner models #716
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