From 8604c4f57c1f5b1432cdf35044c0f7bddf71a82a Mon Sep 17 00:00:00 2001 From: Yongteng Lei Date: Thu, 27 Nov 2025 17:59:17 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20add=20GPT-5.1,=20GPT=E2=80=915.1=20Inst?= =?UTF-8?q?ant=20and=20Claude-Opus-4.5=20(#11559)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What problem does this PR solve? Add GPT-5.1, GPT‑5.1 Instant and Claude-Opus-4.5. #11548 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- conf/llm_factories.json | 21 +++++++++++++++++++++ rag/llm/chat_model.py | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/conf/llm_factories.json b/conf/llm_factories.json index 71f47be2e..90602c65f 100644 --- a/conf/llm_factories.json +++ b/conf/llm_factories.json @@ -7,6 +7,20 @@ "status": "1", "rank": "999", "llm": [ + { + "llm_name": "gpt-5.1", + "tags": "LLM,CHAT,400k,IMAGE2TEXT", + "max_tokens": 400000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gpt-5.1-chat-latest", + "tags": "LLM,CHAT,400k,IMAGE2TEXT", + "max_tokens": 400000, + "model_type": "chat", + "is_tools": true + }, { "llm_name": "gpt-5", "tags": "LLM,CHAT,400k,IMAGE2TEXT", @@ -3218,6 +3232,13 @@ "status": "1", "rank": "990", "llm": [ + { + "llm_name": "claude-opus-4-5-20251101", + "tags": "LLM,CHAT,IMAGE2TEXT,200k", + "max_tokens": 204800, + "model_type": "chat", + "is_tools": true + }, { "llm_name": "claude-opus-4-1-20250805", "tags": "LLM,CHAT,IMAGE2TEXT,200k", diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index cce5b2454..9fbc88348 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -132,6 +132,11 @@ class Base(ABC): gen_conf = {k: v for k, v in gen_conf.items() if k in allowed_conf} + model_name_lower = (self.model_name or "").lower() + # gpt-5 and gpt-5.1 endpoints have inconsistent parameter support, clear custom generation params to prevent unexpected issues + if "gpt-5" in model_name_lower: + gen_conf = {} + return gen_conf def _chat(self, history, gen_conf, **kwargs):