-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add custom Vertex AI Model Garden example #2868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e6221ae
Add custom Vertex AI Model Garden example
stefannae b0f17a2
Add Model Garden link
stefannae 5841e76
Remove custom client
stefannae 67c1b97
Clarify model access for generateContent API
stefannae acdcf14
Use the simplest model name pattern
stefannae fa8cf90
Add & use the publisher/model name pattern
stefannae b0977bf
Update docs/models/google.md
DouweM f2cfb6e
Update docs/models/google.md
DouweM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From googleapis.github.io/python-genai/genai.html#genai.models.AsyncModels.generate_content_stream, it seems like this should be
meta/llama-3.3-70b-instruct-maas, so we should fix it here and specify{publisher}/{model_id}in the docs above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this 4th way of specifying the model. Still, the simplest way, according to the same docs (and tested - I've tested them all), is
llama-3.3-70b-instruct-maas.Should we keep
llama-3.3-70b-instruct-maasin the example and add{publisher}/{model_id}to the list of patterns?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefannae Hmm, the docs make it sound like excluding the publisher only works with Gemini models, so even though you've verified it works with llama as well, I'd prefer to document and use only
{publisher}/{model_id}, or say "{model_id}for Gemini models" like the docs do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DouweM, they have a formatting issue with the docs, which visually reads better from the docstring https://github.com/googleapis/python-genai/blob/538c755e84777e6b76d5152aac18268e4d0c99c6/google/genai/models.py#L6377-L6401
This way, seems Gemini is only used as an example:
Though given how the endpoints are defined in Vertex AI, it is probably better to switch to
{publisher}/{model_id}in the example. Let me know your preference, and I'll make the change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefannae Yeah let's do that, I'm interpreting "Gemini model ID" as "this only works for Gemini models"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DouweM ok, pushed the update!