skills/vertex-tuning/open-model/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/open-modelInstall 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 Open Large Language Models (LLMs) 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 open 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).The following locations are available for tuning:
No other values are supported for this section, ensure that the location is listed above.
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.--validation_split 0.2). If they agree, proceed with the split. If they
decline, just use the training dataset without a validation dataset.bash python3 scripts/prepare_dataset.py \ --input my_data.jsonl \ --format messages \ --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 open model and parameters. Always seek user confirmation before submitting the job.
tuning_mode, epochs, learning_rate, and adapter_size based
on the Tuning Guide and model-specific
baselines in the Models Catalog.python3 \
open-model/scripts/calculate_cost.py \
--input my_data.jsonl \
--model MODEL_NAME \
--tuning_mode TUNING_MODE \
--epochs EPOCHS
Submit the open model tuning job using scripts/tune_open_model.py. Identify
the model id using available models documentation at
documentation.
python3 scripts/tune_open_model.py \
--project YOUR_PROJECT \
--location YOUR_LOCATION \
--bucket YOUR_STAGING_BUCKET \
--base_model BASE_MODEL_ID \
--train_dataset gs://YOUR_BUCKET/tuning_agent_job_<datetime>/dataset.jsonl \
--output_uri gs://YOUR_BUCKET/tuning_agent_job_<datetime>/output \
--epochs EPOCHS \
--learning_rate LR \
--tuning_mode MODE
Monitor the job via the Cloud Console link provided in the script output or by polling the job status.
Once the open model tuning job is SUCCEEDED, deploy the model using
scripts/deploy_open_model.py.
python3 scripts/deploy_open_model.py \
--project YOUR_PROJECT \
--location YOUR_LOCATION \
--artifacts_uri gs://YOUR_BUCKET/tuning_agent_job_<datetime>/output/postprocess/node-0/checkpoints/final \
--machine_type MACHINE_TYPE \
--accelerator_type ACCELERATOR_TYPE \
--accelerator_count COUNT
Refer to Models Catalog for hardware recommendations for specific open models.
scripts/prepare_dataset.py: Data conversion & validation.scripts/tune_open_model.py: Open model tuning job submission.scripts/deploy_open_model.py: Open 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