agent-platform-inference
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.)
Install / Use
npx skills add google/skills --skill agent-platform-inferenceInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Education & ResearchSupported Platforms
Tags
Our assessment of agent-platform-inference
agent-platform-inference scores 98/100 on our quality scale, 10th of 127 Education & Research skills we index (top 8%).
Its SKILL.md is 37 KB long, well organised into 35 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so agent-platform-inference is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
agent-platform-inference compared with similar skills
All 4 of these similar skills score higher than agent-platform-inference; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| agent-platform-inference (this skill)by google | 98 | 20.3k | 2d ago | SKILL.md |
| last30days-skillby mvanhorn | 100 | 62.8k | 2d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 4d ago | SKILL.md |
Frequently asked questions
- How do I install agent-platform-inference?
- Run
npx skills add google/skills --skill agent-platform-inference. The install tabs above show the steps for each supported agent. - Which AI agents does agent-platform-inference work with?
- It is written for Gemini CLI, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is agent-platform-inference safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is agent-platform-inference still maintained?
- The repository was last updated 2 days ago, so agent-platform-inference is actively maintained.
Skill content
View source on GitHubname: agent-platform-inference metadata: version: "1.0.0" category: AiAndMachineLearning description: >- 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.
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 theagent-platform-deployskill, and legacy custom models) — section 4.
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.
- Project ID: The Google Cloud project ID or number (e.g.
- 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]
- Project ID:
- 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-proor<MODEL_ID>). - SDK: The SDK used (e.g.
Google GenAI SDK (google-genai)orOpenAI SDK). - Project ID: The Google Cloud project ID/number used.
- Region: The region or endpoint location used (e.g.
globalorus-central1). - Generated Output: The model's complete generated answer.
- Model ID: The exact model ID used (e.g.
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:
gcloud auth login gcloud auth application-default login -
Enable API (if not already enabled):
gcloud services enable aiplatform.googleapis.com -
Python Dependencies: The scripts import
vertexai(fromgoogle-cloud-aiplatform),google-genai, andopenai. 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:python3 -c "import vertexai, google.genai, openai" \ || pip install -r scripts/requirements.txtscripts/requirements.txtis 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:
./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: See Use Open Models on Agent Platform for Llama, DeepSeek, Qwen, etc. * Incomplete Lists: The Model IDs listed in this skill are examples only and may be incomplete or outdated. * Action: Always verify the Model ID and Region using the links above before generating 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, ordeepseek-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 asus-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.
- Global:
-
-
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-genaifor Gemini, OpenAI SDKopenaifor OpenMaaS).
- If the user specifies a model but does not specify an SDK, use the
preferred SDK for that model family (GenAI SDK
-
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 withgoogle-genai,openai, orvertexai). Do not use raw curl commands for final inference execution.
- When executing model inference in the sandbox via
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].
- Gemini (e.g.,
-
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 on a numeric
projects/.../endpoints/<id>, a self-deployed OSS LLM (Llama, DeepSeek, Qwen, Gemma, etc.), or a legacy custom model. Those requests hit a specific endpoint resource whose region is fixed at deploy time; if the caller-side region doesn't match, the endpoint lookup returns a clean 404 without incurring inference cost. Go to §4.- The user is calling an OpenMaaS publisher model (§2) — Llama, DeepSeek, Qwen, etc. served via the global
openapibase URL. These don't have per-region availability restrictions in the same way first-party Gemini does. Go to §2.Apply this section only if the user is calling a first-party managed Gemini model (
gemini-*, via §1), including fine-tuned LoRA adapters on top of Gemini — these route through a publisher endpoint whose regional availability actually varies.
Before r
Truncated for display — read the full file on GitHub.
Related Skills
last30days-skill
62.8kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
