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)
This commit is contained in:
Yongteng Lei
2025-09-08 19:00:52 +08:00
committed by GitHub
parent 2616f651c9
commit 936f27e9e5
4 changed files with 65 additions and 1 deletions

View File

@ -755,6 +755,20 @@
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "kimi-k2-0905-preview",
"tags": "LLM,CHAT,256k",
"max_tokens": 262144,
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "kimi-k2-turbo-preview",
"tags": "LLM,CHAT,256k",
"max_tokens": 262144,
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "kimi-latest",
"tags": "LLM,CHAT,8k,32k,128k",
@ -2794,6 +2808,20 @@
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "Pro/deepseek-ai/DeepSeek-V3.1",
"tags": "LLM,CHAT,160k",
"max_tokens": 160000,
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "deepseek-ai/DeepSeek-V3.1",
"tags": "LLM,CHAT,160",
"max_tokens": 160000,
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
"tags": "LLM,CHAT,32k",
@ -4448,6 +4476,21 @@
"is_tools": false
}
]
},
{
"name": "Meituan",
"logo": "",
"tags": "LLM",
"status": "1",
"llm": [
{
"llm_name": "LongCat-Flash-Chat",
"tags": "LLM,CHAT,8000",
"max_tokens": 8000,
"model_type": "chat",
"is_tools": true
}
]
}
]
}

View File

@ -155,7 +155,10 @@ class Base(ABC):
def _chat_streamly(self, history, gen_conf, **kwargs):
logging.info("[HISTORY STREAMLY]" + json.dumps(history, ensure_ascii=False, indent=4))
reasoning_start = False
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf, stop=kwargs.get("stop"))
if kwargs.get("stop") or "stop" in gen_conf:
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf, stop=kwargs.get("stop"))
else:
response = self.client.chat.completions.create(model=self.model_name, messages=history, stream=True, **gen_conf)
for resp in response:
if not resp.choices:
continue
@ -1353,6 +1356,15 @@ class Ai302Chat(Base):
super().__init__(key, model_name, base_url, **kwargs)
class MeituanChat(Base):
_FACTORY_NAME = "Meituan"
def __init__(self, key, model_name, base_url="https://api.longcat.chat/openai", **kwargs):
if not base_url:
base_url = "https://api.longcat.chat/openai"
super().__init__(key, model_name, base_url, **kwargs)
class LiteLLMBase(ABC):
_FACTORY_NAME = ["Tongyi-Qianwen", "Bedrock", "Moonshot", "xAI", "DeepInfra", "Groq", "Cohere", "Gemini", "DeepSeek", "NVIDIA", "TogetherAI", "Anthropic", "Ollama"]

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
<path d="M0 0 C66 0 132 0 200 0 C200 66 200 132 200 200 C134 200 68 200 0 200 C0 134 0 68 0 0 Z " fill="#FEFEFE" transform="translate(0,0)"/>
<path d="M0 0 C2.39453125 1.14453125 2.39453125 1.14453125 4.8125 2.8125 C5.75738281 3.44800781 6.70226562 4.08351563 7.67578125 4.73828125 C8.19865723 5.09615723 8.7215332 5.4540332 9.26025391 5.82275391 C13.36191523 8.59825361 17.54956498 11.24621033 21.71533203 13.92407227 C24.9487779 16.00737354 28.16762901 18.09844886 31.32421875 20.296875 C32.74154297 21.26367188 32.74154297 21.26367188 34.1875 22.25 C34.98542969 22.81203125 35.78335938 23.3740625 36.60546875 23.953125 C40.02234807 25.44696457 41.42547679 25.15782554 45 24 C48.42901527 22.04876439 51.64079366 19.81837726 54.875 17.5625 C56.74772639 16.28893482 58.62143497 15.01681278 60.49609375 13.74609375 C61.42276855 13.11429199 62.34944336 12.48249023 63.30419922 11.83154297 C67.15319175 9.21651472 71.024932 6.64382662 74.9375 4.125 C75.56833496 3.7029126 76.19916992 3.2808252 76.84912109 2.84594727 C80.69057438 0.39471936 83.44464046 -0.73870695 88 0 C90.63825077 2.11084554 91.56855734 4.03836878 92.5 7.24609375 C92.74572754 8.07737793 92.99145508 8.90866211 93.24462891 9.76513672 C93.49390137 10.6470166 93.74317383 11.52889648 94 12.4375 C94.39517822 13.79512451 94.39517822 13.79512451 94.79833984 15.18017578 C96.40537717 20.7505079 97.90130769 26.33936261 99.24584961 31.97924805 C100.02006027 35.08035146 100.88550777 38.14165289 101.77734375 41.2109375 C104.26417513 49.86388766 106.60157415 58.55531387 108.9375 67.25 C109.5691163 69.59948589 110.20107941 71.94887564 110.83413696 74.29797363 C111.25284122 75.85317822 111.67015085 77.40875899 112.08602905 78.96472168 C113.16723782 82.99279371 114.28613741 87.0052878 115.46533203 91.00585938 C115.70192032 91.81972107 115.93850861 92.63358276 116.18226624 93.47210693 C116.6346324 95.02228962 117.09591729 96.56990767 117.56761169 98.11431885 C118.82718955 102.45952922 118.9222718 104.388641 118 109 C105.79 109 93.58 109 81 109 C83.31 104.38 85.62 99.76 88 95 C89.40365551 90.78903348 89.26447125 86.78724127 89.3125 82.375 C89.34150391 81.51003906 89.37050781 80.64507812 89.40039062 79.75390625 C89.48768877 70.79577373 86.17425574 64.13690446 81 57 C80.67 56.67 80.34 56.34 80 56 C79.66923795 54.42436986 79.38669942 52.83856139 79.125 51.25 C78.00132777 44.77185934 76.52477508 38.39389016 75 32 C69.3212598 32.97811077 65.83453902 35.5234875 61.41796875 39.078125 C60.47566406 39.81546875 59.53335938 40.5528125 58.5625 41.3125 C57.23412109 42.38951172 57.23412109 42.38951172 55.87890625 43.48828125 C52.08591214 45.47998915 50.1672323 44.78190208 46 44 C44.52591059 44.0330709 43.05235766 44.10841633 41.58203125 44.21875 C33.06908878 44.76725748 27.04476719 45.01018891 20.0625 39.6875 C18.34756469 38.15516212 16.65623266 36.59560518 15 35 C13.10956661 33.11039348 13.10956661 33.11039348 11 32 C8.40433962 32.39037028 8.40433962 32.39037028 6 33 C5.81207886 34.08885498 5.81207886 34.08885498 5.62036133 35.19970703 C5.03729887 38.51192489 4.42521919 41.8181454 3.8125 45.125 C3.61591797 46.26710937 3.41933594 47.40921875 3.21679688 48.5859375 C1.95587995 55.25909786 0.76122004 59.1634442 -4 64 C-8.6447071 72.51751445 -9.42049497 82.17344862 -7.45703125 91.609375 C-6.07241923 96.0462533 -4.04327606 100.17429394 -1.8671875 104.2734375 C-1 106 -1 106 0 109 C-5.10863896 109.0246501 -10.21724359 109.04283607 -15.32592773 109.05493164 C-17.06519168 109.05997204 -18.80445136 109.0668043 -20.54370117 109.07543945 C-23.03825937 109.08751792 -25.53276173 109.09323108 -28.02734375 109.09765625 C-28.80963852 109.10281754 -29.59193329 109.10797882 -30.39793396 109.11329651 C-32.26567114 109.11349226 -34.13329204 109.06199694 -36 109 C-36.33 108.67 -36.66 108.34 -37 108 C-36.6691145 101.49258523 -35.15776262 95.68688958 -33.30078125 89.4609375 C-31.60460125 83.73515116 -30.09924894 77.95763523 -28.5625 72.1875 C-26.4733134 64.37300626 -24.32774597 56.58848741 -21.98681641 48.84594727 C-19.4138662 40.2171001 -17.1927551 31.48599768 -14.94165039 22.76855469 C-10.8136506 7.00766372 -10.8136506 7.00766372 -8 1 C-5.18797299 -0.4060135 -3.12018031 -0.23410947 0 0 Z " fill="#2BE155" transform="translate(59,42)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9 7.59 9 15.18 9 23 C5.7 23 2.4 23 -1 23 C-1.1094017 15.24463474 -0.91988309 7.70402087 0 0 Z " fill="#141414" transform="translate(83,109)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9.33 7.59 9.66 15.18 10 23 C6.7 23 3.4 23 0 23 C0 15.41 0 7.82 0 0 Z " fill="#101010" transform="translate(108,109)"/>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -54,6 +54,7 @@ export enum LLMFactory {
DeepInfra = 'DeepInfra',
Grok = 'Grok',
XAI = 'xAI',
Meituan = 'Meituan',
}
// Please lowercase the file name
@ -113,4 +114,5 @@ export const IconMap = {
[LLMFactory.DeepInfra]: 'deepinfra',
[LLMFactory.Grok]: 'grok',
[LLMFactory.XAI]: 'xai',
[LLMFactory.Meituan]: 'longcat',
};