Skip to content

providers=[...] includes image and music generation models as candidates #6

Description

@TheCoder30ec4

Problem

fetch_catalog() keeps every model whose output_modalities contains "text". Image and music generators also list text as an output, so they become routing candidates for text tasks.

Checked against the live catalog: 7 of the 24 models picked for providers=["google"] are generators:

google/gemini-3.1-flash-lite-image    google/gemini-3.1-flash-image
google/gemini-3-pro-image             google/gemini-3.1-flash-image-preview
google/gemini-3-pro-image-preview     google/lyria-3-pro-preview   (text + audio, listed at $0)
google/lyria-3-clip-preview           (text + audio, listed at $0)

The lyria music models show as $0, so Jev sees them as the cheapest option for simple text tasks.

Where

src/model_router/catalog.py, the filter in fetch_catalog().

Suggested fix

For routing text tasks, keep only models whose output_modalities is exactly ["text"]. Explicit models=[...] could still allow anything, if we want an escape hatch.

Done when

  • Router(providers=["google"], ...) excludes image and music models
  • Test in tests/test_catalog.py with a text+image and a text+audio model
  • README's "Choosing candidate models" mentions the rule

Activity

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

    area: catalogLive model list, prices and provider filteringbugSomething isn't workingpriority: highFix soon: wrong results or breaks a documented guarantee

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions