From 54fa4d3fc2bcc9a78e8d634bcfed30780f563f6b Mon Sep 17 00:00:00 2001 From: inference-bot Date: Sun, 27 Sep 2026 11:00:53 -0600 Subject: [PATCH] Filter audio models out of chat-facing /v1/models (visible to API users only) --- app/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/main.py b/app/main.py index 3de3dd5..6081e8b 100644 --- a/app/main.py +++ b/app/main.py @@ -1188,6 +1188,24 @@ async def list_models(request: Request): ) payload = r.json() + + # Chat-list filter: exclude audio-only models (STT/TTS). They are + # registered and callable via /v1/audio/* for API users, but they are + # not chat models — listing them in Open WebUI would just confuse + # members. The gateway's model_info carries `mode` for audio models; + # fall back to a name check for safety. + audio_modes = {"audio_transcription", "audio_speech"} + audio_name_hints = ("whisper", "voxtral", "tts") + + def is_audio_model(m) -> bool: + mode = ((m.get("info") or {}).get("meta") or {}).get("mode") or "" + if mode in audio_modes: + return True + mid = (m.get("id") or "").lower() + return any(h in mid for h in audio_name_hints) + + payload["data"] = [m for m in payload.get("data", []) if not is_audio_model(m)] + for model in payload.get("data", []): model.setdefault("info", {}).setdefault("meta", {}) model["info"]["meta"].setdefault("capabilities", {})["web_search"] = True