genkit icon indicating copy to clipboard operation
genkit copied to clipboard

Python: Vertex AI models missing from Dev UI: discovery filters on `supported_actions`, which Vertex returns as None

Open hilariie opened this issue 5 months ago • 0 comments

Describe the bug

In the Python google-genai plugin, no Vertex AI models (Gemini, Imagen, Veo, embedders) appear in the Dev UI model picker. The cause is in the model discovery helper _list_genai_models, which categorises models based on each model's supported_actions field. For Vertex AI, client.models.list() returns publisher models with supported_actions = None, so the early continue skips every model before it can be categorised. As a result, the gemini/imagen/veo/embedder lists come back empty, and nothing is registered.

This affects all Vertex AI users of the Python plugin, not just newly added models.

The relevant code is in _list_genai_models:

if not m.supported_actions:
    continue

# Embedders
if 'embedContent' in m.supported_actions:
    models.embedders.append(name)

# Imagen (Vertex mostly)
if 'predict' in m.supported_actions and 'imagen' in name.lower():
    models.imagen.append(name)

# Veo
if 'generateVideos' in m.supported_actions or 'veo' in name.lower():
    models.veo.append(name)

# Gemini / Gemma
if 'generateContent' in m.supported_actions:
    lower_name = name.lower()
    if 'gemini' in lower_name or 'gemma' in lower_name:
        models.gemini.append(name)

For comparison, the JS plugin does not depend on supported_actions; it filters Vertex models by name in listActions in vertexai/gemini.ts:

return models
    .filter(
      (m) =>
        (isGeminiModelName(modelName(m.name)) ||
          isImageModelName(modelName(m.name))) &&
        !KNOWN_DECOMISSIONED_MODELS.includes(modelName(m.name) || '')
    )

To Reproduce

  1. Authenticate for Vertex AI:
    • gcloud auth application-default login
    • export GCLOUD_PROJECT=<your-vertex-project>
  2. Run a Vertex sample, e.g. from py/samples/vertexai-imagen:
    • genkit start -- uv run src/main.py
  3. Open the Dev UI at http://localhost:4000 and open the model dropdown.
  4. Observe that no vertexai/... models are listed.

Minimal direct reproduction that shows the underlying API behavior (supported_actions is None for every model):

import os
from google import genai

client = genai.Client(
    vertexai=True,
    project=os.environ['GCLOUD_PROJECT'],
    location='us-central1',
)

for m in client.models.list():
    print(m.name, '|', m.supported_actions)

Example output (130 models returned, all with None):

publishers/google/models/gemini-2.5-pro | None
publishers/google/models/gemini-3-pro-preview | None
publishers/google/models/gemini-3.1-pro-preview | None
publishers/google/models/gemini-3.5-flash | None
publishers/google/models/imagen-3.0-generate-002 | None
... (every model prints None)

Expected behavior

Vertex AI Gemini, Imagen, Veo, and embedder models should be discovered and appear in the Dev UI model picker, the same way they do for the Google AI backend (which does populate supported_actions). Discovery should not depend on a field that the Vertex API leaves unset.

Screenshots

Image

Desktop:

  • OS: macOS
  • Browser: Chrome
  • Version: 149.0.7827.103
  • Genkit Version: 0.7.0 (genkit-plugin-google-genai 0.7.0)

Python version

  • Python 3.12 (uv-managed venv)

Additional context

  • google-genai SDK version: 1.63.0
  • Suggested fix: for the Vertex path (is_vertex=True), categorise models by name rather than gating on supported_actions, mirroring the JS plugin's listActions. The Google AI path can keep using supported_actions since that backend populates it.
  • A model explicitly referenced in flow code (e.g. vertexai/imagen-3.0-generate-002 in the vertexai-imagen sample) still appears in the Dev UI, because it is resolved on demand via the plugin's resolve() path, which bypasses _list_genai_models. Only automatic discovery is broken, so no Vertex model the user hasn't hard-coded will be listed.

hilariie avatar Jun 17 '26 12:06 hilariie