Skip to content

[Python] Bedrock: list the model catalog like Google GenAI so Bedrock() needs no models= #208

Open

Description

@huangjeff5

Problem

plugins=[Bedrock()] lists nothing in the Dev UI. Models only show up if you pass them by ID:

Bedrock(models=['us.anthropic.claude-sonnet-4-5-20250929-v1:0'], embedders=['amazon.titan-embed-text-v2:0'])

Any ID still resolves on demand, so generate() works without the list. The list is only there for the Dev UI, and users have to know and type model IDs the provider already knows.

Google GenAI doesn't ask for this. GoogleAI() / VertexAI() call client.aio.models.list(), classify the results (Gemini, Veo, embedders), and list them. resolve() still covers anything the listing misses.

Why Bedrock is different today

The plugin opens only a bedrock-runtime client. Listing the catalog takes a second, control-plane bedrock client and extra IAM actions:

  • bedrock:ListFoundationModels for base model IDs (amazon.nova-lite-v1:0)
  • bedrock:ListInferenceProfiles for cross-region IDs (us.anthropic.claude-...), which is what most Claude calls need

A runtime-only IAM policy will deny both.

Proposal

  1. list_actions() lists the catalog through a bedrock client built from the same session, region and config as the runtime client.
  2. Classify the results with the existing routing: embedding → embedder, image-generation family → image config schema, rerank → skipped, everything else → chat. Filter by output modality and ON_DEMAND / inference-profile support so the list holds only IDs that work.
  3. An AccessDenied or other failure logs once at debug level and lists nothing. Listing never fails init or resolve, which is the bar the Ollama probing already meets.
  4. Cache the result for the process, as GoogleAI does.
  5. Then decide whether models= / embedders= stay as an override for locked-down IAM or go away, the same way ModelDefinition went in refactor(py)!: plugin packages expose only their top-level module genkit#6671.

Open questions

  • Inference profiles: list every one, or only those whose underlying model is routable?
  • Should the listing also run in init()? GoogleAI's init() does it with no error handling, so a failed listing blocks startup. Bedrock shouldn't copy that.

cc @hilariie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions