Skip to content

feat(genai/model_tuning) Migrate samples to genai/model_tuning using vertexai.language_models. - #14494

Merged
XrossFox merged 4 commits into
GoogleCloudPlatform:mainfrom
XrossFox:vertex-to-genai-language-models-model-tuning
Aug 12, 2026
Merged

feat(genai/model_tuning) Migrate samples to genai/model_tuning using vertexai.language_models.#14494
XrossFox merged 4 commits into
GoogleCloudPlatform:mainfrom
XrossFox:vertex-to-genai-language-models-model-tuning

Conversation

@XrossFox

@XrossFox XrossFox commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Refactored tests to wrok with new changes.

Description

This PR migrates model tuning examples to use the most up-to-date features from the google-genai and google-cloud-aiplatform
libraries.

Changes:

  • feat: Added pretrained_codegen_example.py demonstrating supervised fine-tuning using google-genai.
  • feat: Added evaluate_model_example.py demonstrating model evaluation using vertexai.evaluation.
  • test: Added corresponding test files (pretrained_examples_test.py and evaluate_model_example_test.py) with cleanup logic.
  • chore: Created noxfile_config.py, requirements.txt, and requirements-test.txt for the new genai/model_tuning
    directory.

Fixes b/540948584

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

Refactored tests to wrok with new changes.
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Aug 10, 2026
@XrossFox

Copy link
Copy Markdown
Contributor Author

Tested locally:

image image

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces code examples and tests for evaluating and tuning Gemini models using the Vertex AI and Google GenAI SDKs. The feedback recommends updating the Nox configuration to include Python 3.13 in tests, increasing the backoff retry duration to handle rate limits during model evaluation, and wrapping the tuning test's cleanup logic in a try...finally block to prevent resource leaks on assertion failures.

Comment thread genai/model_tuning/noxfile_config.py
Comment thread genai/model_tuning/evaluate_model_example_test.py
Comment thread genai/model_tuning/pretrained_examples_test.py Outdated
@XrossFox
XrossFox marked this pull request as ready for review August 11, 2026 19:41
@XrossFox
XrossFox requested review from a team as code owners August 11, 2026 19:41
@snippet-bot

snippet-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@XrossFox
XrossFox merged commit 22f9bcb into GoogleCloudPlatform:main Aug 12, 2026
10 of 18 checks passed
@XrossFox
XrossFox deleted the vertex-to-genai-language-models-model-tuning branch August 24, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants