Skip to content

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

Draft
XrossFox wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
XrossFox:vertex-to-genai-language-models-model-tuning
Draft

feat(genai/model_tuning) Migrate samples to genai/model_tuning using vertexai.language_models.#14494
XrossFox wants to merge 3 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
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.

1 participant