Skip to content

Commit 936f27e

Browse files
authored
Feat: add LongCat-Flash-Chat (#9973)
### What problem does this PR solve? Add LongCat-Flash-Chat from Meituan, deepseek v3.1 from SiliconFlow, kimi-k2-09-05-preview and kimi-k2-turbo-preview from Moonshot. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
1 parent 2616f65 commit 936f27e

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

conf/llm_factories.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,20 @@
755755
"model_type": "chat",
756756
"is_tools": true
757757
},
758+
{
759+
"llm_name": "kimi-k2-0905-preview",
760+
"tags": "LLM,CHAT,256k",
761+
"max_tokens": 262144,
762+
"model_type": "chat",
763+
"is_tools": true
764+
},
765+
{
766+
"llm_name": "kimi-k2-turbo-preview",
767+
"tags": "LLM,CHAT,256k",
768+
"max_tokens": 262144,
769+
"model_type": "chat",
770+
"is_tools": true
771+
},
758772
{
759773
"llm_name": "kimi-latest",
760774
"tags": "LLM,CHAT,8k,32k,128k",
@@ -2794,6 +2808,20 @@
27942808
"model_type": "chat",
27952809
"is_tools": true
27962810
},
2811+
{
2812+
"llm_name": "Pro/deepseek-ai/DeepSeek-V3.1",
2813+
"tags": "LLM,CHAT,160k",
2814+
"max_tokens": 160000,
2815+
"model_type": "chat",
2816+
"is_tools": true
2817+
},
2818+
{
2819+
"llm_name": "deepseek-ai/DeepSeek-V3.1",
2820+
"tags": "LLM,CHAT,160",
2821+
"max_tokens": 160000,
2822+
"model_type": "chat",
2823+
"is_tools": true
2824+
},
27972825
{
27982826
"llm_name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
27992827
"tags": "LLM,CHAT,32k",
@@ -4448,6 +4476,21 @@
44484476
"is_tools": false
44494477
}
44504478
]
4479+
},
4480+
{
4481+
"name": "Meituan",
4482+
"logo": "",
4483+
"tags": "LLM",
4484+
"status": "1",
4485+
"llm": [
4486+
{
4487+
"llm_name": "LongCat-Flash-Chat",
4488+
"tags": "LLM,CHAT,8000",
4489+
"max_tokens": 8000,
4490+
"model_type": "chat",
4491+
"is_tools": true
4492+
}
4493+
]
44514494
}
44524495
]
44534496
}

rag/llm/chat_model.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ def _chat(self, history, gen_conf, **kwargs):
155155
def _chat_streamly(self, history, gen_conf, **kwargs):
156156
logging.info("[HISTORY STREAMLY]" + json.dumps(history, ensure_ascii=False, indent=4))
157157
reasoning_start = False
158-
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf, stop=kwargs.get("stop"))
158+
if kwargs.get("stop") or "stop" in gen_conf:
159+
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf, stop=kwargs.get("stop"))
160+
else:
161+
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf)
159162
for resp in response:
160163
if not resp.choices:
161164
continue
@@ -1353,6 +1356,15 @@ def __init__(self, key, model_name, base_url="https://api.302.ai/v1", **kwargs):
13531356
super().__init__(key, model_name, base_url, **kwargs)
13541357

13551358

1359+
class MeituanChat(Base):
1360+
_FACTORY_NAME = "Meituan"
1361+
1362+
def __init__(self, key, model_name, base_url="https://api.longcat.chat/openai", **kwargs):
1363+
if not base_url:
1364+
base_url = "https://api.longcat.chat/openai"
1365+
super().__init__(key, model_name, base_url, **kwargs)
1366+
1367+
13561368
class LiteLLMBase(ABC):
13571369
_FACTORY_NAME = ["Tongyi-Qianwen", "Bedrock", "Moonshot", "xAI", "DeepInfra", "Groq", "Cohere", "Gemini", "DeepSeek", "NVIDIA", "TogetherAI", "Anthropic", "Ollama"]
13581370

web/src/assets/svg/llm/longcat.svg

Lines changed: 7 additions & 0 deletions
Loading

web/src/constants/llm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export enum LLMFactory {
5454
DeepInfra = 'DeepInfra',
5555
Grok = 'Grok',
5656
XAI = 'xAI',
57+
Meituan = 'Meituan',
5758
}
5859

5960
// Please lowercase the file name
@@ -113,4 +114,5 @@ export const IconMap = {
113114
[LLMFactory.DeepInfra]: 'deepinfra',
114115
[LLMFactory.Grok]: 'grok',
115116
[LLMFactory.XAI]: 'xai',
117+
[LLMFactory.Meituan]: 'longcat',
116118
};

0 commit comments

Comments
 (0)