hermesonehq/hermes-registry/agent-platform-inference
Claude Code and agent skill by hermesonehq/hermes-registry
- community
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 you need to 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 hermesonehq/hermes-registry/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 both First-Party (Gemini) and Third-Party (OpenMaaS) models.
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. The confirmation prompt must clearly explain the proposed inference execution and its key parameters (e.g., target model ID, SDK choice, input prompt). Natural-language paraphrases without specifying the 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: > * Model ID: deepseek-ai/deepseek-v3.2-maas > * SDK: OpenAI SDK (via Vertex AI Endpoint) > * Input Prompt: "Explain the concept of quantum computing..." > Do you confirm? [Yes/No]
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 ``
- Virtual Environment: Create and activate a dedicated local virtual
environment:
``bash python3 -m venv .venv source .venv/bin/activate ``
- Install Dependencies: Install the required SDKs:
``bash pip install -r scripts/requirements.txt ``
- Verify Setup (Optional): Run all sample scripts at once to verify the
environment is working end-to-end:
``bash ./scripts/verify_all.sh ``
- Execution: Advise the user that every time they execute a Python
snippet from this skill, they must ensure this virtual environment is activated first.
<!-- disableFinding(LINE_OVER_80) -->
[!IMPORTANT]CRITICAL: Model IDs & Availability* Gemini Models: See [Gemini Models][gemini-models-docs] for validModel IDs and Regions.* OpenMaaS Models: See [Use Open Models on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/maas/use-open-models)for Llama, DeepSeek, Qwen, etc.* Incomplete Lists: The Model IDs listed in this skill are **examplesonly** and may be incomplete or outdated.* Action: Always verify the Model ID and Region using the links abovebefore generating code.[gemini-models-docs]: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate
<!-- enableFinding(LINE_OVER_80) -->
Workflow Decision Tree
- Model Family Identification: Has the user specified whether they want
to call a Gemini (First-Party) model or an OpenMaaS (Third-Party, e.g. Llama, DeepSeek, Qwen) model?
- No -> Ask the user which model family they want to use. If they
provide a specific model name, infer the family from the name.
- Yes -> Proceed to Step 2.
- SDK Choice: Which SDK does the user want to use?
- Gemini + GenAI SDK (preferred for Gemini) -> Proceed to
[1. Gemini Models].
- Gemini + legacy Vertex AI SDK -> Proceed to [1. Gemini Models].
- OpenMaaS + OpenAI SDK (preferred for OpenMaaS) -> Proceed to
[2. OpenMaaS Models].
- OpenMaaS + GenAI SDK -> Proceed to [2. OpenMaaS Models].
- Unsure -> Default to the preferred SDK for the chosen family.
- Troubleshooting: Is the user reporting an error (429 Resource
Exhausted, 400 User Validation, 404 Not Found, etc.)?
- Yes -> Proceed to [3. Troubleshooting & Common Error Codes].
- No -> Proceed with the SDK choice from Step 2.
1. Gemini Models
For Gemini models (e.g., gemini-2.5-pro, gemini-3-flash-preview), the GenAI SDK (google-genai) is the PREFERRED method. The legacy vertexai SDK is still supported but GenAI SDK is recommended for new projects.
[!IMPORTANT]Preview Models (including Gemini 3.1) are often ONLY available in theglobalregion. Stable models are available inus-central1and otherregions.
Choosing the Right SDK
- Gemini Models: GenAI SDK (
google-genai) is PREFERRED. Use OpenAI SDK for compatibility, or Legacy SDK (vertexai) if needed. - OpenMaaS Models: OpenAI SDK is HIGHLY RECOMMENDED. Use GenAI SDK or Legacy SDK if you have specific infrastructure requirements.
Installation
Python Example (GenAI SDK - Preferred)
See `scripts/gemini_genai_sdk.py` for the complete code.
Alternative: OpenAI SDK (Chat Completions)
Use the standard OpenAI SDK with the Agent Platform endpoint. This is great for cross-compatibility.
See `scripts/gemini_openai_sdk.py` for the complete code.
Legacy: Agent Platform SDK
The legacy vertexai SDK is still widely used but google-genai is preferred for new Gemini projects.
See `scripts/gemini_vertexai_sdk.py` for the complete code.
Documentation: Google GenAI SDK
Documentation: Agent Platform Gemini Models
2. OpenMaaS Models (Llama, DeepSeek, Qwen, etc.)
For OpenMaaS (Model-as-a-Service) models, the HIGHLY RECOMMENDED approach is to use the standard OpenAI SDK with a specific Vertex AI endpoint.
[!WARNING]WhileGenerativeModelcan support some OpenMaaS models, it is
discouraged. Use the OpenAI SDK for best compatibility (especially for Chat Completions).
Installation
Authentication for OpenAI SDK
You MUST use a Google Cloud OAuth access token as the API key for the OpenAI SDK.
[!NOTE]Google Cloud access tokens typically expire after 1 hour. Theget_gcp_access_token()function above retrieves a fresh token at the timeit is called.
<!-- disableFinding(LINE_OVER_80) -->
For long-running applications, you implement a refresh mechanism. See Refresh the access token for details.
<!-- enableFinding(LINE_OVER_80) -->
Configuration (Base URL)
<!-- disableFinding(LINE_OVER_80) -->
- Global Endpoint (Recommended for most models requiring global
availability): https://aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/global/endpoints/openapi
- Regional Endpoint:
https://{REGION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{REGION}/endpoints/openapi <!-- enableFinding(LINE_OVER_80) -->
Python Example (OpenMaaS - Chat Completions)
See `scripts/openmaas_openai_sdk.py` for the complete code.
[!TIP]Alternative: Environment VariablesYou can set environment variables in your shell instead of updating the code.```bashexport OPENAI_BASE_URL="https://aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/global/endpoints/openapi"export OPENAI_API_KEY="$(gcloud auth print-access-token)"```Then initialize the client without arguments:client = OpenAI()
Python Example (OpenMaaS - Completions API)
The following models support the legacy Completions API: zai-org/glm-5-maas, moonshotai/kimi-k2-thinking-maas, minimaxai/minimax-m2-maas, deepseek-ai/deepseek-v3.1-maas, and deepseek-ai/deepseek-v3.2-maas.
Python Example (OpenMaaS - Embeddings)
Alternative: GenAI SDK
The google-genai SDK can also access OpenMaaS models via the vertexai backend.
See `scripts/openmaas_genai_sdk.py` for the complete code.
[!IMPORTANT]Model ID Format: For GenAI SDK with OpenMaaS, you MUST use the fullpath:publishers/PUBLISHER/models/MODEL(e.g.,publishers/zai-org/models/glm-5-maas).
Legacy: Agent Platform SDK (OpenMaaS)
For OpenMaaS, you can also use GenerativeModel (if supported).
See `scripts/openmaas_vertexai_sdk.py` for the complete code.
[!IMPORTANT]Model ID Format: For Agent Platform SDK with OpenMaaS, you MUST use thefull path:publishers/PUBLISHER/models/MODEL.
Model Reference & Availability
Documentation: Use Open Models on Agent Platform
[!TIP]Self-Deployment for Control: If you need dedicated hardware(GPUs/TPUs), guaranteed capacity, or specific regional placement notoffered by MaaS, you can Self-Deploy these models to Agent PlatformEndpoints. Search for the model in Model Garden and click "Deploy" to selectyour machine type.
[!IMPORTANT]Finding Inference Examples: The list above is a starting point. For thedefinitive inference snippets (especially for Chat Completions payloadstructure):1. Consult the Use Open Models on Agent Platformlist.2. Click the link for your specific model (e.g., "DeepSeek-V3") to visit itsModel Garden page.3. Look for the "Sample Code" or "Use this model" button on the ModelGarden page to get the exactcurlor Python code for that specific modelversion.
[!NOTE]This list is INCOMPLETE. See [Use Open Models on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/maas/use-open-models)for the full list of supported models.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mlops/agent-platform-inference/SKILL.md
Popularity
- Repository stars
- 91
- Repository forks
- 17
- 7-day trend score
- 23
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/hermesonehq/hermes-registry/agent-platform-inference)