SkillAgentSearch skills...

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-inference

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

98/100

Supported Platforms

Gemini CLI

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.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
18/20
Freshness
15/15

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 found

Our 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.

SkillScoreStarsUpdatedFormat
agent-platform-inference (this skill)by google9820.3k2d agoSKILL.md
last30days-skillby mvanhorn10062.8k2d agoCLAUDE.md
algorithmic-artby anthropics100177.9k3d agoSKILL.md
pptxby anthropics100177.9k3d agoSKILL.md
designby nextlevelbuilder100130.2k4d agoSKILL.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.

name: 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 the agent-platform-deploy skill, 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):

  1. 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:

  1. 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
    
  2. Enable API (if not already enabled):

    gcloud services enable aiplatform.googleapis.com
    
  3. 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:

    python3 -c "import vertexai, google.genai, openai" \
      || pip install -r scripts/requirements.txt
    

    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.

  4. Verify Setup (Optional): Run all sample scripts at once to verify the environment is working end-to-end:

    ./scripts/verify_all.sh
    
  5. 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:

  1. 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.
  2. 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.

  3. 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).
  4. 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

  1. 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.
  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].
  3. 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 openapi base 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

View on GitHub
GitHub Stars20.3k
CategoryEducation
Updated2d ago
Forks1.7k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions