Skip to content

Commit 163e309

Browse files
committed
feat(moonshot): add kimi-k3 and kimi-k2.7-code model support
1 parent 6d0c844 commit 163e309

6 files changed

Lines changed: 119 additions & 5 deletions

File tree

models/moonshot/manifest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
author: langgenius
22
created_at: '2024-09-20T00:13:50.29298939-04:00'
33
description:
4-
en_US: Models provided by Moonshot, such as kimi-k2.6, kimi-k2.5, kimi-k2, moonshot-v1-8k, moonshot-v1-32k, and moonshot-v1-128k.
5-
zh_Hans: Moonshot 提供的模型,例如 kimi-k2.6, kimi-k2.5, kimi-k2, moonshot-v1-8k、moonshot-v1-32k 和 moonshot-v1-128k。
4+
en_US: Models provided by Moonshot, such as kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-k2.5, kimi-k2, moonshot-v1-8k, moonshot-v1-32k, and moonshot-v1-128k.
5+
zh_Hans: Moonshot 提供的模型,例如 kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-k2.5, kimi-k2, moonshot-v1-8k、moonshot-v1-32k 和 moonshot-v1-128k。
66
icon: icon_s_en.png
77
label:
88
en_US: Moonshot
@@ -34,4 +34,4 @@ resource:
3434
tool:
3535
enabled: true
3636
type: plugin
37-
version: 0.1.8
37+
version: 0.1.9

models/moonshot/models/llm/_position.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
- kimi-k2-thinking-turbo
99
- kimi-k2.5
1010
- kimi-k2.6
11+
- kimi-k2.7-code
12+
- kimi-k2.7-code-highspeed
13+
- kimi-k3
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
model: kimi-k2.7-code-highspeed
2+
label:
3+
zh_Hans: kimi-k2.7-code-highspeed
4+
en_US: kimi-k2.7-code-highspeed
5+
model_type: llm
6+
features:
7+
- vision
8+
- agent-thought
9+
- tool-call
10+
- multi-tool-call
11+
- stream-tool-call
12+
model_properties:
13+
mode: chat
14+
context_size: 262144
15+
parameter_rules:
16+
- name: max_tokens
17+
use_template: max_tokens
18+
default: 32768
19+
min: 1
20+
max: 262144
21+
- name: response_format
22+
label:
23+
zh_Hans: 回复格式
24+
en_US: Response Format
25+
type: string
26+
help:
27+
zh_Hans: 指定模型必须输出的格式
28+
en_US: specifying the format that the model must output
29+
required: false
30+
options:
31+
- text
32+
- json_object
33+
pricing:
34+
input: '13'
35+
output: '54'
36+
unit: '0.000001'
37+
currency: RMB
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
model: kimi-k2.7-code
2+
label:
3+
zh_Hans: kimi-k2.7-code
4+
en_US: kimi-k2.7-code
5+
model_type: llm
6+
features:
7+
- vision
8+
- agent-thought
9+
- tool-call
10+
- multi-tool-call
11+
- stream-tool-call
12+
model_properties:
13+
mode: chat
14+
context_size: 262144
15+
parameter_rules:
16+
- name: max_tokens
17+
use_template: max_tokens
18+
default: 32768
19+
min: 1
20+
max: 262144
21+
- name: response_format
22+
label:
23+
zh_Hans: 回复格式
24+
en_US: Response Format
25+
type: string
26+
help:
27+
zh_Hans: 指定模型必须输出的格式
28+
en_US: specifying the format that the model must output
29+
required: false
30+
options:
31+
- text
32+
- json_object
33+
pricing:
34+
input: '6.5'
35+
output: '27'
36+
unit: '0.000001'
37+
currency: RMB
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
model: kimi-k3
2+
label:
3+
zh_Hans: kimi-k3
4+
en_US: kimi-k3
5+
model_type: llm
6+
features:
7+
- vision
8+
- agent-thought
9+
- tool-call
10+
- multi-tool-call
11+
- stream-tool-call
12+
model_properties:
13+
mode: chat
14+
context_size: 1048576
15+
parameter_rules:
16+
- name: max_tokens
17+
use_template: max_tokens
18+
default: 131072
19+
min: 1
20+
max: 1048576
21+
- name: response_format
22+
label:
23+
zh_Hans: 回复格式
24+
en_US: Response Format
25+
type: string
26+
help:
27+
zh_Hans: 指定模型必须输出的格式
28+
en_US: specifying the format that the model must output
29+
required: false
30+
options:
31+
- text
32+
- json_object
33+
pricing:
34+
input: '20'
35+
output: '100'
36+
unit: '0.000001'
37+
currency: RMB

models/moonshot/models/llm/llm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ def _convert_prompt_message_to_dict(self, message: PromptMessage, credentials: O
156156
credentials = credentials or {}
157157
model_name = credentials.get("_current_model", "").lower()
158158

159-
# 判断是否为支持深度思考模式的模型(K2.5、K2.6 以及 K2-thinking 系列)
160-
is_thinking_model = any(x in model_name for x in ["k2.5", "k2.6", "k2-thinking"])
159+
# 判断是否为支持深度思考模式的模型(K2.5、K2.6、K2.7、K3 以及 K2-thinking 系列)
160+
is_thinking_model = any(x in model_name for x in ["k2.5", "k2.6", "k2.7", "k3", "k2-thinking"])
161161

162162
# Use base implementation for standard conversion
163163
message_dict = super()._convert_prompt_message_to_dict(message, credentials)

0 commit comments

Comments
 (0)