agent-platform-eval-flywheel
>- Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results before and after a fix, or when guidance is needed on Agent Platform eval methodology — including dataset schema, LLM-as-judge scoring, and common failure causes. For fine-tuning, use agent-platform-tuning. For general production deployment, use agent-platform-deploy.
Why we recommend it: Evaluates and improves AI models and agents using the Eval Quality Flywheel: eval datasets, metrics, failure analysis, and LLM-as-judge scoring.
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
---
name: agent-platform-eval-flywheel
metadata:
category: AiAndMachineLearning
description: >-
Measures and improves the quality of AI models and agents on Google Cloud
using the Eval Quality Flywheel methodology. Use when evaluating an agent or
model, building an eval dataset, picking or writing evaluation metrics,
analyzing failures, comparing results before and after a fix, or when
guidance is needed on Agent Platform eval methodology — including
dataset schema, LLM-as-judge scoring, and common failure causes. For
fine-tuning, use agent-platform-tuning. For general production deployment,
use agent-platform-deploy.
---
# Agent Platform Eval Flywheel Skill
Help users evaluate and iteratively improve GenAI models and agents using the
Agent Platform GenAI Evaluation SDK (`google.genai` / `agentplatform`).
## When to use this skill
- Evaluating GenAI agents or models with the Agent Platform GenAI Evaluation
SDK (`client.evals.evaluate()`).
- Creating evaluation datasets from session traces, pandas DataFrames, or
synthetic generation.
- Selecting, configuring, or writing custom evaluation metrics.
- Analyzing rubric verdicts, loss patterns, and clustering failures.
- Suggesting concrete code/prompt improvements based on eval results.
- Evaluating a model served on an Agent Platform **endpoint** (BYOM) or a
**Model-as-a-Service (MaaS)** model by ID — including deploying the model
first if needed. For this case, follow
[references/deployment.md](references/deployment.md) and use the
`endpoint_evaluation.py` / `maas_evaluation.py` scripts.
## 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:
1. **Tier R**: Read-only (`inspect_results.py`, `compare_results.py`,
`validate_dataset.py`, `parse_adk_traces.py`, `render_html_report.py`)
* **Rule**: No confirmation needed. You may execute these helper scripts
immediately to inspect data, validate schemas, parse traces, or compare
evaluation results.
2. **Tier M: Read-only with Compute Costs (`client.evals.run_inference`,
`client.evals.evaluate`, `client.evals.generate_conversation_scenarios`,
`client.evals.generate_loss_clusters`)**
* **Rule**: These operations invoke LLMs or remote evaluation services
that consume compute resources and incur costs. This requires
**interactive confirmation** with 'Yes'/'No' options. Once granted once,
you do not have to prompt for future evaluation.
* **Same-turn restriction**: Do not run the evaluation in the same turn as
presenting the confirmation prompt. End your turn after asking and wait
for the user's reply; only execute after explicit 'Yes' / approval.
Printing a preview and then calling the tool before the user can answer
does not count as obtaining confirmation.
## Setup
The scripts need `vertexai` (from `google-cloud-aiplatform[evaluation]`),
`google-genai`, `pandas`, and `requests`. 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, pandas, requests" \
|| pip install 'google-cloud-aiplatform[evaluation]>=1.163.0' 'google-genai>=1.0.0'
```
The version specifiers must stay quoted: unquoted, bash reads `>=1.154.0` as a
redirect and silently writes an empty file instead of constraining the install.
Need `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`. Check env vars first;
if missing, ask the user. Newer Gemini models often need `location="global"`.
### Correct SDK entrypoints
```python
import agentplatform
client = agentplatform.Client(project=PROJECT, location=LOCATION)
client.evals.run_inference(model=..., src=...)
client.evals.evaluate(dataset=..., metrics=...)
cliRead the full source on GitHub (opens external page)