google/skills/agent-platform-inference
Claude Code and agent skill by google/skills
- vendor
Checking that the SKILL.md file is still in the repository.
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints or for running model evaluations.
Install
npx vskill@latest install google/skills/agent-platform-inferenceSKILL.md
Agent Platform GenAI Inference Skill
This skill provides instructions for authenticating and connecting to Google Cloud Agent Platform to use Generative AI models. It covers:
- First-Party publisher models (Gemini) — section 2.
- Third-Party publisher models (OpenMaaS: Llama, DeepSeek, Qwen, etc.)
— section 3.
- Custom endpoints (any model on a numeric
projects/.../endpoints/<id>
resource — tuned Gemini models, OSS LLMs self-deployed from Model Garden via the agent-platform-deploy skill, and legacy custom models) — section 4.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION and append the attribution suffix to User-Agent headers:
Safety & Confirmation Tiers (CRITICAL)
Before executing any commands or scripts on behalf of the user, you must adhere to the following safety tiers based on the action requested. (The skill is read-only; other safety tiers are omitted):
- **Tier R: Read-only / Inference (
client.models.generate_content,
client.chat.completions.create, client.completions.create, client.embeddings.create)**
- Requires interactive confirmation with 'Yes'/ 'No' options before
executing model inference on behalf of the user, to prevent unexpected cost or quota consumption.
- Required Fields in Confirmation Card: The confirmation prompt must
clearly explain the proposed inference execution and explicitly list all of the following parameters:
- Project ID: The Google Cloud project ID or number (e.g.
123456789012, my-project).
- Region / Location: The target region (e.g.
us-central1,
global).
- Model ID: The exact model ID (e.g.
gemini-2.5-flash,
deepseek-ai/deepseek-v3.2-maas).
- SDK: The SDK choice (e.g.
Google GenAI SDK (google-genai),
OpenAI SDK).
- Input Prompt (or Input Image / Input Media): The prompt
text or media URI.
- Any additional generation parameters (e.g.
max_output_tokens,
response_schema) if specified. Natural-language paraphrases without explicitly listing these parameters are NOT sufficient.
- Same-turn restriction: Do not execute the inference scripts or
commands in the same turn as presenting the confirmation prompt. Stop and wait for the user's reply; only execute after explicit 'Yes' / approval.
- Gold Standard Example:
> I will perform model inference with the following parameters. Please > confirm this information before I proceed: > * Project ID: my-project > * Region: us-central1 > * Model ID: gemini-2.5-pro > * SDK: Google GenAI SDK (google-genai) > * Input Prompt: "Summarize the plot of Hamlet in 3 sentences" > > Do you confirm? [Yes/No]
- Post-Execution Response Grounding (CRITICAL):
After receiving explicit user approval and executing the inference call via the SDK, the response returning the generated text MUST explicitly confirm the execution parameters alongside the model's output. Never return a bare model response alone. Always include:
- Model ID: The exact model ID used (e.g.
gemini-2.5-pro
or <MODEL_ID>).
- SDK: The SDK used (e.g.
Google GenAI SDK (google-genai)
or OpenAI SDK).
- Project ID: The Google Cloud project ID/number used.
- Region: The region or endpoint location used (e.g.
global
or us-central1).
- Generated Output: The model's complete generated answer.
Phase 0: Environment Setup
CRITICAL: Before running any of the Python sample scripts in the scripts/ directory (e.g., scripts/openmaas_openai_sdk.py), you MUST ensure the environment is correctly initialized by following these steps:
- Google Cloud Authentication: Authenticate with your Google Cloud
credentials and configure active Application Default Credentials (ADC) for Agent Platform access:
``bash gcloud auth login gcloud auth application-default login ``
- Enable API (if not already enabled):
``bash gcloud services enable aiplatform.googleapis.com ``
- Python Dependencies: The scripts import
vertexai(from
google-cloud-aiplatform), google-genai, and openai. Do not create a virtual environment — it starts empty and hides packages the environment already provides, forcing a redundant install. Probe, and install only what is missing:
```bash python3 -c "import vertexai, google.genai, openai" \
```
scripts/requirements.txt is a fallback for an environment that does not already provide these SDKs; do not install it on top of a working environment.
- Verify Setup (Optional): Run all sample scripts at once to verify the
environment is working end-to-end:
``bash ./scripts/verify_all.sh ``
- Execution: Run the scripts with a plain
python3 scripts/.... There is
no environment to activate first.
[!IMPORTANT] CRITICAL: Model IDs & Availability * Gemini Models: See[Gemini Models][gemini-models-docs] for valid Model IDs and Regions. *OpenMaaS Models: Seefor Llama, DeepSeek, Qwen, etc. * Incomplete Lists: The Model IDs listedin this skill are examples only and may be incomplete or outdated. *Action: Always verify the Model ID and Region using the links above beforegenerating code.\[gemini-models-docs]:https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate
Parameter Grounding & Clarification Protocol (CRITICAL)
Before preparing code or presenting a Tier R confirmation card, you MUST ensure all necessary parameters are grounded:
- Missing Model ID, Model Family, or SDK (CRITICAL):
- If the user has NOT specified which model or model family to use
(e.g., "run a test prompt", "ask a generative AI model to...", "ask DeepSeek a question" without model version), or has not specified the SDK preference:
- NEVER guess, volunteer, or default to a model (such as
gemini-2.5-flash, gemini-2.5-pro, or deepseek-v3.2-maas). Proposing a defaulted model in a confirmation card without asking violates parameter grounding.
- YOU MUST STOP AND ASK THE USER: "Which model (or model family,
such as Gemini, Llama, DeepSeek, or Qwen) and SDK preference (such as Google GenAI SDK or OpenAI SDK) would you like to use?" and ask for the target region and project ID if not specified.
- Only after the user specifies the model (and any missing SDK preference)
should you proceed to prepare the execution and present the Tier R confirmation prompt.
- Missing Project ID or Region:
- If the user's project ID or region is not specified in the prompt or
conversation context, ASK the user for the project ID and region (e.g. "Which project ID and region would you like to use?"). Do not silently assume a project or region.
- OpenMaaS Locations: OpenMaaS publisher models are hosted on
global
(e.g. deepseek-ai/deepseek-v3.2-maas, meta/llama-3.3-70b-instruct-maas) or regional endpoints such as us-central1 (e.g. deepseek-ai/deepseek-r1-0528-maas). When configuring inference for OpenMaaS models, use the appropriate endpoint:
- Global:
https://aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/global/endpoints/openapi - Regional:
https://{REGION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{REGION}/endpoints/openapi
and explicitly reflect the region in the confirmation card and final response.
- SDK Choice:
- If the user specifies a model but does not specify an SDK, use the
preferred SDK for that model family (GenAI SDK google-genai for Gemini, OpenAI SDK openai for OpenMaaS).
- Sandbox Execution via Python (CRITICAL):
- When executing model inference in the sandbox via
run_command,
ALWAYS run Python code using the official SDKs (e.g., writing and running a Python script with google-genai, openai, or vertexai). Do not use raw curl commands for final inference execution.
Workflow Decision Tree
- Model Specified?
- No (user omitted model name/family) -> Ask the user which model
or model family, target region, and SDK preference they want to use.
- Underspecified (e.g., user said "DeepSeek" or "Llama" without
version) -> Ask the user which specific model version they prefer (e.g., deepseek-ai/deepseek-r1-0528-maas, deepseek-ai/deepseek-v3.2-maas, meta/llama-3.3-70b-instruct-maas).
- Yes -> Proceed to Step 2.
- Model Family & SDK Selection:
- Gemini (e.g.,
gemini-2.5-pro,gemini-2.5-flash) -> Preferred:
GenAI SDK (google-genai). Proceed to [1. Gemini Models].
- OpenMaaS (e.g.,
deepseek-ai/*,meta/llama-*,qwen/*) ->
Preferred: OpenAI SDK (openai). Proceed to [2. OpenMaaS Models].
- Custom Endpoint (numeric endpoint ID
projects/.../endpoints/<id>) -> Proceed to [4. Custom Endpoints].
- Troubleshooting: Is the user reporting an error (429 Resource Exhausted,
400 User Validation, 404 Not Found, empty response due to token limits, etc.)?
- Yes -> Proceed to [5. Troubleshooting & Common Error Codes].
- No -> Present Tier R confirmation prompt with all required fields
(Project ID, Region, Model ID, SDK, Input Prompt), wait for user confirmation, then execute via Python SDK.
0.5 Region Availability Check for Publisher Endpoints (Gemini + LoRA base)
[!NOTE] Skip this section if either of these applies:- The user is calling a custom endpoint (§4) — a tuned Gemini model served ona numericprojects/.../endpoints/<id>, a self-deployed OSS LLM (Llama,DeepSeek, Qwen, Gemma, etc.), or a legacy custom model. Those requests hita specific endpoint resource whose region is fixed at deploy time; if thecaller-side region doesn't match, the endpoint lookup returns a clean 404without incurring inference cost. Go to §4.- The user is calling an OpenMaaS publisher model (§2) — Llama, DeepSeek,Qwen, etc. served via the globalopenapibase URL. These don't haveper-region availability restrictions in the same way first-party Geminidoes. Go to §2.Apply this section only if the user is calling a first-party managedGemini model (gemini-*, via §1), including fine-tuned LoRA adapters ontop of Gemini — these route through a publisher endpoint whose regionalavailability actually varies.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 30 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cloud/agent-platform-inference/SKILL.md
Popularity
- Repository stars
- 20,494
- Repository forks
- 1,694
- 7-day trend score
- 50
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/google/skills/agent-platform-inference)