Skip to content

fix(models): list only chat-capable models in the picker and empty the exclude default - #1132

Merged
edenreich merged 5 commits into
mainfrom
fix/issue-1127
Aug 30, 2026
Merged

edenreich merged 5 commits into
mainfrom
fix/issue-1127

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #1127

Summary

The model picker now lists only chat-capable models, filtered from the modalities the gateway already reports (include=modalities), instead of special-casing image generation. That makes the hand-maintained gateway.exclude_models default list unnecessary, so the default is now an empty, opt-in blocklist.

Changes

  • Added IsChatCapableModalities in internal/platform/models/context.go alongside IsImageGenModalities: true only when the modality set includes text in input and text in output (unit tested against text->text, image+text->text vision chat, text->image, audio->text, text->audio, and empty/unknown shapes).
  • HTTPModelService.ListModels now filters with the chat-capability predicate instead of the image-generation-only special case. Models whose modalities are absent or empty (nothing reported) remain listed - an unreported capability never filters a model out. Pinned by TestHTTPModelService_ListModelsKeepsUnknownModalities (and HasReportedModalities guards the empty-report case).
  • config.DefaultConfig() now ships gateway.exclude_models: []. The four groq speech/TTS entries are subsumed by the chat-capability filter on correctness grounds; the four ollama_cloud large-chat entries were a size/cost opinion and become a per-user exclusion knob instead of a shipped default. The key remains fully supported (userspace/project config, joined into the gateway's DISALLOWED_MODELS as before).
  • Docs: docs/configuration-reference.md no longer shows a default exclude list and describes the picker as chat-capable-only with exclude_models as an opt-in knob.

Verification

  • go test on internal/platform/models, internal/conversation, and config (new/renamed tests: TestIsChatCapableModalities, TestHTTPModelService_ListModelsFiltersNonChatModels with the four groq speech/TTS modality shapes, TestHTTPModelService_ListModelsKeepsUnknownModalities), go vet, and the pre-commit suite (golangci-lint 0 issues, markdownlint) all pass.
  • The live-gateway spot check could not run in the CI sandbox (no Docker); the equivalent is pinned by the fake-client test that returns the groq speech/TTS modalities exactly as the gateway reports them - they drop out with the default exclude list empty. The ollama_cloud size/cost exclusions are intentionally gone from the defaults; add them back per-user via exclude_models if wanted.

Notes

  • The four groq whisper/TTS entries were removed from the default list because the client-side modality filter now subsumes them; exclude_models remains a supported user knob.
  • no docs ticket: this PR updates the in-repo docs/configuration-reference.md directly.

Generalize the image-generation special case into a chat-capability
predicate: a model is selectable when the gateway-reported modalities say it
accepts text input and produces text output. This drops speech-to-text,
text-to-speech, image-generation, and video models from the picker, not
just image generators.

Models whose modalities are absent or empty (nothing reported) stay listed
- an unreported capability never filters a model out. The
gateway.exclude_models default becomes an empty, opt-in list; the four
groq speech/TTS entries are subsumed by the filter and the ollama_cloud
size exclusions become a per-user choice.
…de list

Drop the eight-model default exclude list from the documented default
configuration and describe gateway.exclude_models as an empty, opt-in knob,
noting that the picker itself filters to chat-capable models via the
gateway-reported modalities.
Comment thread config/config.go Resolved
The chat-capability filter failed open on missing data: models with
`"modalities": null` were kept on the theory that filtering on an
unreported capability would empty the picker. In practice the gateway
reports null for 156 of 270 models, because its only source is the
embedded models.dev table and that table has no entry for openai/tts-*,
openai/whisper-1, openai/omni-moderation-* or groq/playai-tts*. The
filter dropped 2 models and the TTS models stayed in the picker.

Treat an unreported capability as "cannot chat" instead. A model is
listed only when the gateway reports modalities for it and those
modalities are text in, text out. IsChatCapableModalities already
rejects the empty set, so HasReportedModalities goes away with its
only caller.
@edenreich
edenreich merged commit 2b94231 into main Aug 30, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1127 branch August 30, 2026 21:54
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.185.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor filter the model list to chat-capable models and drop the default exclude list

1 participant