Skip to content

SUPPORTED_MODALITIES is global, not per-model #231

Description

@t-avil

What happened?

Summary

entrypoint.py:34 declares one modality set for every model:

SUPPORTED_MODALITIES = frozenset({"text", "image", "audio", "video", "action", "scalar", "tensor"})

used at entrypoint.py:273 to validate input_modalities on intake. It has
no per-model dimension, so audio validates for BAGEL even though BAGEL has
no audio encoder — the request is accepted and only fails (or misbehaves)
downstream, instead of being rejected at intake with a clear message.

Current state

  • One frozenset, checked against every model's input_modalities regardless
    of what that model actually implements.
  • Each model already knows its own supported modalities implicitly (e.g. via
    which load_* methods and prefill walks it defines), but nothing exposes
    that to the entrypoint.

Proposed fix

Add a per-model modality declaration (e.g. a SUPPORTED_MODALITIES class
attribute or a supports_modality(name) method on Model), and have
entrypoint.py:273 consult the loaded model instead of the global frozenset.

Acceptance criteria

  • A request declaring a modality the loaded model doesn't support is
    rejected at intake with a clear 400, not accepted and left to fail later
  • BAGEL specifically rejects audio/video input modalities
  • Existing models' currently-valid modality combinations are unaffected

How to reproduce

No response

Environment

No response

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions