npm package: @serii84/vertex-partner-provider
Description: Vertex AI partner models (GLM, Kimi, DeepSeek) for OpenCode
Latest version: 1.1.1

# Vertex Partner Provider

Vercel AI SDK provider for **Vertex AI partner models** (GLM, Kimi, DeepSeek, MiniMax, Qwen) using the OpenAI-compatible format.

## The Problem

Vertex AI partner models use OpenAI-compatible format, but `@ai-sdk/google-vertex` only supports Gemini format. This provider bridges that gap using the same pattern as `@ai-sdk/google-vertex/anthropic`.

## How It Works

```
┌─────────────────────────────────────────────────────────────────┐
│                    @ai-sdk/google-vertex                        │
├─────────────────────┬───────────────────────────────────────────┤
│  Main (Gemini)      │  /anthropic submodule                     │
│                     │                                           │
│  Uses:              │  Uses:                                    │
│  GoogleGenerative   │  AnthropicMessagesLanguageModel           │
│  AILanguageModel    │  (from @ai-sdk/anthropic/internal)        │
│                     │                                           │
│  Format: Gemini     │  Format: Anthropic (native)               │
└─────────────────────┴───────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│              vertex-partner-provider (this package)             │
├─────────────────────────────────────────────────────────────────┤
│  Uses:                                                          │
│  OpenAICompatibleChatLanguageModel                              │
│  (from @ai-sdk/openai-compatible)                               │
│                                                                 │
│  Format: OpenAI (native) + Google Cloud Auth                    │
│                                                                 │
│  Endpoint: /endpoints/openapi/chat/completions                  │
└─────────────────────────────────────────────────────────────────┘
```

## Installation

```bash
npm install @ai-sdk/openai-compatible google-auth-library ai
# Then copy index.js to your project
```

## Usage

```javascript
const { createGLM, createDeepSeek, createKimi } = require('./vertex-partner-provider');
const { generateText } = require('ai');

// Create provider for GLM
const glm = createGLM({
  project: 'your-gcp-project',
  location: 'global',  // or specific region
});

// Use it
const result = await generateText({
  model: glm('glm-4.7-maas'),
  prompt: 'Hello!',
});

console.log(result.text);
```

## Available Factory Functions

| Function | Publisher | Models |
|----------|-----------|--------|
| `createGLM()` | zai-org | glm-4.7-maas |
| `createKimi()` | moonshotai | kimi-k2-thinking-maas |
| `createDeepSeek()` | deepseek-ai | deepseek-v3.2-maas |
| `createMiniMax()` | minimaxai | minimax-m2-maas |
| `createQwen()` | qwen | qwen3-coder-480b-a35b-instruct-maas |

## Generic Usage

```javascript
const { createVertexPartner } = require('./vertex-partner-provider');

const provider = createVertexPartner({
  project: 'your-project',
  location: 'global',
  publisher: 'any-publisher',
});

const model = provider('model-id');
```

## Authentication

Uses Google Cloud Application Default Credentials:

```bash
gcloud auth application-default login
gcloud auth application-default set-quota-project YOUR_PROJECT
```

## Tool Calling Support

⚠️ **Note**: Tool calling should work with this provider since it uses the native OpenAI-compatible format. The previous issues were caused by using the Gemini format class with OpenAI-format responses.

## License

MIT