UNPKG

@ai-sdk/google-vertex

Version:

The **[Google Vertex provider](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the [Google Vertex AI](https://cloud.google.com/vertex-ai) APIs.

61 lines (56 loc) 2.98 kB
import { GoogleAuthOptions } from 'google-auth-library'; import { OpenAICompatibleProvider } from '@ai-sdk/openai-compatible'; import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils'; type GoogleVertexMaasModelId = 'deepseek-ai/deepseek-r1-0528-maas' | 'deepseek-ai/deepseek-v3.1-maas' | 'deepseek-ai/deepseek-v3.2-maas' | 'openai/gpt-oss-120b-maas' | 'openai/gpt-oss-20b-maas' | 'meta/llama-4-maverick-17b-128e-instruct-maas' | 'meta/llama-4-scout-17b-16e-instruct-maas' | 'minimax/minimax-m2-maas' | 'qwen/qwen3-coder-480b-a35b-instruct-maas' | 'qwen/qwen3-next-80b-a3b-instruct-maas' | 'qwen/qwen3-next-80b-a3b-thinking-maas' | 'moonshotai/kimi-k2-thinking-maas' | (string & {}); interface GoogleVertexMaasProvider extends OpenAICompatibleProvider<GoogleVertexMaasModelId, string, string, string> { } interface GoogleVertexMaasProviderSettings$1 { /** * Google Cloud project ID. Defaults to the value of the `GOOGLE_VERTEX_PROJECT` environment variable. */ project?: string; /** * Google Cloud location/region. Defaults to the value of the `GOOGLE_VERTEX_LOCATION` environment variable. * Use 'global' for the global endpoint. */ location?: string; /** * Base URL for the API calls. If not provided, will be constructed from project and location. */ baseURL?: string; /** * Headers to use for requests. Can be: * - A headers object * - A Promise that resolves to a headers object * - A function that returns a headers object * - A function that returns a Promise of a headers object */ headers?: Resolvable<Record<string, string | undefined>>; /** * Custom fetch implementation. You can use it as a middleware to intercept requests, * or to provide a custom fetch implementation for e.g. testing. */ fetch?: FetchFunction; } interface GoogleVertexMaasProviderSettings extends GoogleVertexMaasProviderSettings$1 { /** * Optional. The Authentication options provided by google-auth-library. * Complete list of authentication options is documented in the * GoogleAuthOptions interface: * https://github.com/googleapis/google-auth-library-nodejs/blob/main/src/auth/googleauth.ts. */ googleAuthOptions?: GoogleAuthOptions; } /** * Create a Google Vertex AI MaaS (Model as a Service) provider instance for Node.js. * Uses the OpenAI-compatible Chat Completions API for partner and open models. * Automatically handles Google Cloud authentication. * * @see https://cloud.google.com/vertex-ai/generative-ai/docs/maas/use-open-models */ declare function createVertexMaas(options?: GoogleVertexMaasProviderSettings): GoogleVertexMaasProvider; /** * Default Google Vertex AI MaaS provider instance for Node.js. */ declare const vertexMaas: GoogleVertexMaasProvider; export { type GoogleVertexMaasModelId, type GoogleVertexMaasProvider, type GoogleVertexMaasProviderSettings, createVertexMaas, vertexMaas };