I am trying to programmatically list Google's first party Gemini models, but I don't see any such endpoint in the Vertex documentation. I do see this in the Gemini docs: https://ai.google.dev/api/models
Is there a way for me to call that from the vertexai SDK?
I already tried
aiplatform.Model.list()
That returns an empty list. Could there be a parameter I'm missing?
Hello rahul-appliedxl,
Welcome to Google Cloud Community!
The aiplatform.Model.list() function you used is to list all model resource instances. Based on this documentation with regards to list.
For us to list all the existing AI Platform models we may use this code gcloud ai-platform models list.
These variants are also available:
gcloud alpha ai-platform models list
gcloud beta ai-platform models list
I hope the above information is helpful.
Hi! Can I use that code from Python?
Unfortunately, this works with gcloud SDK or by using Google Cloud CLI.
For Python, you may use this code.
list(
filter: typing.Optional[str] = None,
order_by: typing.Optional[str] = None,
project: typing.Optional[str] = None,
location: typing.Optional[str] = None,
credentials: typing.Optional[google.auth.credentials.Credentials] = None,
) -> typing.List[google.cloud.aiplatform.models.Model]
I hope the above information is helpful.