From ff27ce86d6ebda4c1eefa112188db66a4309ab75 Mon Sep 17 00:00:00 2001 From: Idriss Sbaaoui <112825897+6ba3i@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:24:47 +0800 Subject: [PATCH] fix: gpt-5 name-based config clearing from base chat path (#13949) ### What problem does this PR solve? fix #13944 where OpenAI-compatible custom endpoints failed verification when model names contained `gpt-5` becauser of incorrect name-based handling in the Base/backend=`base` path. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/chat_model.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 8cbd8933c7..fb1353706d 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -77,9 +77,6 @@ def _apply_model_family_policies( sanitized_kwargs["extra_body"] = {"enable_thinking": False} if backend == "base": - # GPT-5 and GPT-5.1 endpoints in this path have inconsistent generation-param support. - if "gpt-5" in model_name_lower: - sanitized_gen_conf = {} return sanitized_gen_conf, sanitized_kwargs if backend == "litellm": @@ -151,14 +148,11 @@ class Base(ABC): return LLMErrorCode.ERROR_GENERIC def _clean_conf(self, gen_conf): - model_name_lower = (self.model_name or "").lower() gen_conf, _ = _apply_model_family_policies( self.model_name, backend="base", gen_conf=gen_conf, ) - if "gpt-5" in model_name_lower: - return gen_conf if "max_tokens" in gen_conf: del gen_conf["max_tokens"]