From 84920a7bc966725093f4ca1d373003de26c8ab62 Mon Sep 17 00:00:00 2001 From: Chau Vu / CPF-FAMILY Date: Mon, 12 Oct 2026 11:05:48 +0700 Subject: [PATCH] fix(openai): match reasoning series markers on normalized model name rather than raw path --- litellm/llms/openai/chat/gpt_5_transformation.py | 2 +- tests/unit/llms/openai/test_is_model_gpt_5_model.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/llms/openai/chat/gpt_5_transformation.py b/litellm/llms/openai/chat/gpt_5_transformation.py index 94c5c5d016d..b6217316662 100644 --- a/litellm/llms/openai/chat/gpt_5_transformation.py +++ b/litellm/llms/openai/chat/gpt_5_transformation.py @@ -71,7 +71,7 @@ GPT_REASONING_SERIES_MARKERS: Final = ("gpt-5", "gpt-6") def is_gpt_reasoning_series_name(model: str) -> bool: normalized: Final = model.split("/")[-1] - return any(marker in model for marker in GPT_REASONING_SERIES_MARKERS) and "gpt-5-chat" not in normalized + return any(marker in normalized for marker in GPT_REASONING_SERIES_MARKERS) and "gpt-5-chat" not in normalized class OpenAIGPT5Config(OpenAIGPTConfig): diff --git a/tests/unit/llms/openai/test_is_model_gpt_5_model.py b/tests/unit/llms/openai/test_is_model_gpt_5_model.py index f6fef92fc6a..4f953e9f7f2 100644 --- a/tests/unit/llms/openai/test_is_model_gpt_5_model.py +++ b/tests/unit/llms/openai/test_is_model_gpt_5_model.py @@ -87,6 +87,10 @@ NON_GPT5_MODELS = [ "o1", "o3", "o3-mini", + "gpt-5-gateway/claude-3-5-sonnet", + "gpt-5-team/llama-3.3-70b", + "gpt-6-proxy/mistral-large", + "my-gpt-5-org/gemini-2.0-flash", ]