Skip to content

Conversation

@bluet
Copy link

@bluet bluet commented Jan 26, 2026

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-vertex SDK only supports Google's Gemini models because it hardcodes publishers/google in 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-openai that:

  • Uses @ai-sdk/openai-compatible SDK instead of @ai-sdk/google-vertex
  • Targets the correct OpenAI-compatible endpoint: /v1/projects/{project}/locations/{location}/endpoints/openapi/chat/completions
  • Requires custom loader in OpenCode to inject Google OAuth tokens (companion PR needed)

Models Added

Model Publisher Context Use Case
GLM-4.7 zai-org 204K Multilingual MoE with interleaved thinking
Llama 4 Maverick 17B-128E meta 1M Multimodal reasoning with vision
Llama 3.3 70B meta 131K Text-only instruction following
Qwen3 235B Instruct qwen 131K Hybrid thinking mode
DeepSeek V3.1 deepseek-ai 131K Advanced reasoning

Changes

  • ✅ Created providers/google-vertex-openai/ with provider.toml and 5 model definitions
  • ✅ Removed non-working models from google-vertex/models/zai-org/ and openai/

Next Steps

A companion PR is needed in anomalyco/opencode to add the custom loader that injects Google OAuth authentication.

References

bluet added 2 commits January 27, 2026 06:12
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.
@rekram1-node
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants