skills/vertex-tuning/gemini/SKILL.md
<!-- Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific l
npx skillsauth add GoogleCloudPlatform/vertex-ai-samples skills/vertex-tuning/geminiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides procedural knowledge for fine-tuning Gemini Large Language Models using Vertex AI's tuning service. It covers the entire lifecycle from environment setup and data preparation to job configuration, monitoring, and deployment.
Environment Check: Has the environment (Auth, APIs, IAM, Venv) been initialized?
Dataset Status: Is the dataset ready in JSONL format and uploaded to GCS?
Configuration: Have the target Gemini model and hyperparameters been decided?
Job Status: Has the tuning job been submitted?
Job Completion: Is the tuning job complete?
Deployment: Has the tuned model been deployed (if required)?
Ensure the foundational environment is ready before proceeding.
gcloud CLI is installed. If it is not installed, prompt the user
for permission to install it before proceeding.gcloud auth list. If not authenticated, run gcloud auth login.project and location are known. Use gcloud config get project
to retrieve the current project (and gcloud config get compute/region for
region).Ensure aiplatform.googleapis.com and storage.googleapis.com are enabled.
gcloud services enable aiplatform.googleapis.com storage.googleapis.com --project=YOUR_PROJECT
Verify the following identities have the required roles.
[email protected]service-PROJECT_NUMBER@gcp-sa-vertex-moss-ft.iam.gserviceaccount.comCreate and use a virtual environment named tuning_agent_venv in the home
directory. Install dependencies from references/requirements.txt.
python3 -m venv ~/tuning_agent_venv
source ~/tuning_agent_venv/bin/activate
pip install -r references/requirements.txt
Vertex AI requires valid JSONL format in GCS.
scripts/prepare_dataset.py
to convert.bash python3 scripts/prepare_dataset.py \ --input my_data.jsonl \ --format messages_gemini \ --validate_onlyUpload formatted .jsonl files to GCS using a unique directory (e.g., with a
datetime timestamp) to avoid overwriting outputs from different runs.
gcloud storage cp dataset.jsonl gs://YOUR_BUCKET/tuning_agent_job_<datetime>/dataset.jsonl
Help the user choose the best Gemini model and parameters. Always seek user confirmation before submitting the job.
Submit the Gemini model tuning job using scripts/tune_gemini_model.py.
python3 scripts/tune_gemini_model.py
Monitor the job via the Cloud Console link provided in the script output or by polling the job status.
Once the Gemini model tuning job is SUCCEEDED, deploy the model using
scripts/deploy_gemini_model.py.
python3 scripts/deploy_gemini_model.py
scripts/prepare_dataset.py: Data conversion & validation.scripts/tune_gemini_model.py: Gemini model tuning job submission.scripts/deploy_gemini_model.py: Gemini model deployment.development
<!-- Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific l
development
<!-- Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific l
development
<!-- Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific l
development
<!-- Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific l