Feat: add kimi-k2-thinking and moonshot-v1-vision-preview (#11110)

### What problem does this PR solve?

Add kimi-k2-thinking and moonshot-v1-vision-preview.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Yongteng Lei
2025-11-07 19:52:57 +08:00
committed by GitHub
parent 98e9d68c75
commit 9fcc4946e2
2 changed files with 51 additions and 7 deletions

View File

@ -892,7 +892,7 @@
{ {
"name": "Moonshot", "name": "Moonshot",
"logo": "", "logo": "",
"tags": "LLM,TEXT EMBEDDING", "tags": "LLM,TEXT EMBEDDING,IMAGE2TEXT",
"status": "1", "status": "1",
"llm": [ "llm": [
{ {
@ -916,6 +916,20 @@
"model_type": "chat", "model_type": "chat",
"is_tools": true "is_tools": true
}, },
{
"llm_name": "kimi-k2-thinking",
"tags": "LLM,CHAT,256k",
"max_tokens": 262144,
"model_type": "chat",
"is_tools": true
},
{
"llm_name": "kimi-k2-thinking-turbo",
"tags": "LLM,CHAT,256k",
"max_tokens": 262144,
"model_type": "chat",
"is_tools": true
},
{ {
"llm_name": "kimi-k2-turbo-preview", "llm_name": "kimi-k2-turbo-preview",
"tags": "LLM,CHAT,256k", "tags": "LLM,CHAT,256k",
@ -932,25 +946,46 @@
}, },
{ {
"llm_name": "moonshot-v1-8k", "llm_name": "moonshot-v1-8k",
"tags": "LLM,CHAT,", "tags": "LLM,CHAT,8k",
"max_tokens": 7900, "max_tokens": 8192,
"model_type": "chat", "model_type": "chat",
"is_tools": true "is_tools": true
}, },
{ {
"llm_name": "moonshot-v1-32k", "llm_name": "moonshot-v1-32k",
"tags": "LLM,CHAT,", "tags": "LLM,CHAT,32k",
"max_tokens": 32768, "max_tokens": 32768,
"model_type": "chat", "model_type": "chat",
"is_tools": true "is_tools": true
}, },
{ {
"llm_name": "moonshot-v1-128k", "llm_name": "moonshot-v1-128k",
"tags": "LLM,CHAT", "tags": "LLM,CHAT,128k",
"max_tokens": 128000, "max_tokens": 131072,
"model_type": "chat", "model_type": "chat",
"is_tools": true "is_tools": true
}, },
{
"llm_name": "moonshot-v1-8k-vision-preview",
"tags": "LLM,IMAGE2TEXT,8k",
"max_tokens": 8192,
"model_type": "image2text",
"is_tools": true
},
{
"llm_name": "moonshot-v1-32k-vision-preview",
"tags": "LLM,IMAGE2TEXT,32k",
"max_tokens": 32768,
"model_type": "image2text",
"is_tools": true
},
{
"llm_name": "moonshot-v1-128k-vision-preview",
"tags": "LLM,IMAGE2TEXT,128k",
"max_tokens": 131072,
"model_type": "image2text",
"is_tools": true
},
{ {
"llm_name": "moonshot-v1-auto", "llm_name": "moonshot-v1-auto",
"tags": "LLM,CHAT,", "tags": "LLM,CHAT,",

View File

@ -464,7 +464,7 @@ class GPUStackCV(GptV4):
class LocalCV(Base): class LocalCV(Base):
_FACTORY_NAME = "Moonshot" _FACTORY_NAME = "Local"
def __init__(self, key, model_name="glm-4v", lang="Chinese", **kwargs): def __init__(self, key, model_name="glm-4v", lang="Chinese", **kwargs):
pass pass
@ -975,3 +975,12 @@ class GoogleCV(AnthropicCV, GeminiCV):
else: else:
for ans in GeminiCV.chat_streamly(self, system, history, gen_conf, images): for ans in GeminiCV.chat_streamly(self, system, history, gen_conf, images):
yield ans yield ans
class MoonshotCV(GptV4):
_FACTORY_NAME = "Moonshot"
def __init__(self, key, model_name="moonshot-v1-8k-vision-preview", lang="Chinese", base_url="https://api.moonshot.cn/v1", **kwargs):
if not base_url:
base_url = "https://api.moonshot.cn/v1"
super().__init__(key, model_name, lang=lang, base_url=base_url, **kwargs)