Vertex AI GenAI Inference

Authenticate and run inference with Google Cloud Vertex AI Generative AI models.

775|303|Updated May 27, 2021
One-click install
npx skills add https://github.com/GoogleCloudPlatform/vertex-ai-samples --skill vertex-ai-genai-inference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Vertex AI GenAI Inference
Source: https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/skills/vertex-inference
Command: npx skills add https://github.com/GoogleCloudPlatform/vertex-ai-samples --skill vertex-ai-genai-inference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, google-cloud-aiplatform, openai, google-auth, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of connecting to and performing inference with Google Cloud Vertex AI's Generative AI models, including both first-party (Gemini) and third-party (OpenMaaS) models.

Core Features & Use Cases

  • Unified Access: Interact with a wide range of GenAI models through consistent SDKs (GenAI SDK, OpenAI SDK, Vertex AI SDK).
  • Model Flexibility: Supports Gemini models and various OpenMaaS models like Llama, DeepSeek, and Qwen.
  • Use Case: Quickly integrate Gemini Pro for text generation tasks or use the OpenAI SDK to access Llama 3.3 for a specific natural language processing workflow.

Quick Start

Use the Vertex AI GenAI Inference skill to generate text using the Gemini 2.5 Pro model.

Frequently Asked Questions about Vertex AI GenAI Inference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Vertex AI Generative AI models for inference?

Connect to Vertex AI Generative AI models for inference by using SDKs like the GenAI SDK, OpenAI SDK, or Vertex AI SDK, which require Application Default Credentials for authenticated access.

Can I use the OpenAI SDK to call Llama 3.3 on Google Cloud Vertex AI?

Yes, you can use the OpenAI SDK to call Llama 3.3 on Google Cloud Vertex AI. The platform supports OpenMaaS offerings including Llama, DeepSeek, and Qwen through multiple compatible SDKs.

Do I need Application Default Credentials to run Vertex AI GenAI inference?

Yes, you need Application Default Credentials to run Vertex AI GenAI inference. Authenticated access requires these credentials along with specific model ID verification to ensure successful API calls.

What is the best way to generate text using Gemini 2.5 Pro through Vertex AI?

The best way to generate text using Gemini 2.5 Pro through Vertex AI is to use the unified GenAI SDK, which provides consistent interaction for first-party Gemini models and handles text generation tasks efficiently.

Does Vertex AI inference support both chat completions and embeddings for third-party models?

Yes, Vertex AI inference supports both chat completions and embeddings for third-party models. It covers multiple interaction patterns for OpenMaaS offerings like Llama, DeepSeek, and Qwen alongside first-party Gemini models.

Why does my Vertex AI GenAI API call fail with an invalid model ID?

Your Vertex AI GenAI API call fails with an invalid model ID because successful inference requires specific model ID verification. You must ensure the provided model ID exactly matches the supported Gemini or OpenMaaS offerings.