Skip to content

Commit af0ff73

Browse files
authored
feat(huaweicloud_maas): add glm-5.2, deepseek-v4-pro, openpangu-2.0-flash models (#3436)
* feat: add glm-5.2 deepseek-v4-pro openpangu-2.0-flash * doc: update model list
1 parent 1f99c42 commit af0ff73

13 files changed

Lines changed: 165 additions & 32 deletions

models/huaweicloud_maas/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Huawei Cloud MaaS provides access to various models (LLMs), configurable via mod
44

55
## Features
66
- Provides llm, text-embedding, rerank models in Dify.
7-
- Includes predefined llm models such as qwen2.5-vl-72b, deepseek-r1, longcat-flash-chat.
7+
- Includes predefined llm models such as GLM/DeepSeek/Qwen series.
88
- Includes predefined text embedding models such as bge-m3.
99
- Includes predefined rerank models such as bge-reranker-v2-m3.
1010
- Supports predefined model and customizable model configuration.

models/huaweicloud_maas/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ resource:
2626
enabled: true
2727
llm: true
2828
type: plugin
29-
version: 0.0.22
29+
version: 0.0.23
3030
created_at: 2025-06-04T12:32:17.824356+08:00

models/huaweicloud_maas/models/llm/_position.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
- openpangu-2.0-flash
2+
- deepseek-v4-flash
3+
- deepseek-v4-pro
14
- deepseek-v3.2
25
- deepseek-v3.2-exp
36
- deepseek-v3.1-terminus
4-
- deepseek-v4-flash
57
- DeepSeek-V3
68
- deepseek-r1-250528
79
- DeepSeek-R1

models/huaweicloud_maas/models/llm/deepseek-r1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ pricing:
3535
output: "16"
3636
unit: "0.000001"
3737
currency: RMB
38+
deprecated: true

models/huaweicloud_maas/models/llm/deepseek-v3.2-Exp.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ pricing:
4747
output: "12"
4848
unit: "0.000001"
4949
currency: RMB
50+
deprecated: true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
model: deepseek-v4-pro
2+
label:
3+
en_US: DeepSeek-V4-Pro
4+
model_type: llm
5+
features:
6+
- agent-thought
7+
- tool-call
8+
- multi-tool-call
9+
- stream-tool-call
10+
model_properties:
11+
mode: chat
12+
context_size: 1000000
13+
parameter_rules:
14+
- name: temperature
15+
use_template: temperature
16+
default: 0.6
17+
- name: top_p
18+
use_template: top_p
19+
default: 0.95
20+
- name: max_tokens
21+
use_template: max_tokens
22+
min: 1
23+
max: 128000
24+
default: 16384
25+
- name: frequency_penalty
26+
use_template: frequency_penalty
27+
min: -2
28+
max: 2
29+
default: 0
30+
- name: presence_penalty
31+
use_template: presence_penalty
32+
min: -2
33+
max: 2
34+
default: 0
35+
- name: enable_thinking
36+
required: false
37+
type: boolean
38+
default: false
39+
label:
40+
zh_Hans: 思考模式
41+
en_US: Thinking mode
42+
help:
43+
zh_Hans: 是否开启思考模式。
44+
en_US: Whether to enable thinking mode.
45+
pricing:
46+
input: '12'
47+
output: '24'
48+
unit: '0.000001'
49+
currency: RMB
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
model: glm-5.2
2+
label:
3+
en_US: GLM-5.2
4+
model_type: llm
5+
features:
6+
- agent-thought
7+
- tool-call
8+
- multi-tool-call
9+
- stream-tool-call
10+
model_properties:
11+
mode: chat
12+
context_size: 198000
13+
parameter_rules:
14+
- name: temperature
15+
use_template: temperature
16+
default: 0.6
17+
- name: top_p
18+
use_template: top_p
19+
default: 0.95
20+
- name: max_tokens
21+
use_template: max_tokens
22+
min: 1
23+
max: 128000
24+
default: 16384
25+
- name: frequency_penalty
26+
use_template: frequency_penalty
27+
min: -2
28+
max: 2
29+
default: 0
30+
- name: presence_penalty
31+
use_template: presence_penalty
32+
min: -2
33+
max: 2
34+
default: 0
35+
- name: enable_thinking
36+
required: false
37+
type: boolean
38+
default: false
39+
label:
40+
zh_Hans: 思考模式
41+
en_US: Thinking mode
42+
help:
43+
zh_Hans: 是否开启思考模式。
44+
en_US: Whether to enable thinking mode.
45+
pricing:
46+
input: '8'
47+
output: '28'
48+
unit: '0.000001'
49+
currency: RMB

models/huaweicloud_maas/models/llm/kimi-k2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ pricing:
3838
output: "16"
3939
unit: "0.000001"
4040
currency: RMB
41+
deprecated: true

models/huaweicloud_maas/models/llm/llm.py

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,24 @@
77

88

99
class HuaweiCloudMaasLargeLanguageModel(OAICompatLargeLanguageModel):
10-
_BASE_URL_V1 = "https://api.modelarts-maas.com/v1"
1110
_BASE_URL_V2 = "https://api.modelarts-maas.com/v2"
1211
_THINKING_PATH_XDS = "thinking.type.enabled"
1312
_THINKING_PATH_VLLM = "chat_template_kwargs.enable_thinking.true"
1413

15-
endpoint_mapping = {
16-
"deepseek-v3.2": _BASE_URL_V2,
17-
"deepseek-v3.2-exp": _BASE_URL_V2,
18-
"deepseek-v3.1-terminus": _BASE_URL_V2,
19-
"DeepSeek-V3": _BASE_URL_V2,
20-
"deepseek-r1-250528": _BASE_URL_V2,
21-
"DeepSeek-R1": _BASE_URL_V2,
22-
"Kimi-K2": _BASE_URL_V2,
23-
"longcat-flash-chat": _BASE_URL_V2,
24-
"glm-5": _BASE_URL_V2,
25-
"glm-5.1": _BASE_URL_V2,
26-
"kimi-k2.6": _BASE_URL_V2,
27-
"deepseek-v4-flash": _BASE_URL_V2,
28-
"qwen3-235b-a22b": _BASE_URL_V2,
29-
"qwen3-30b-a3b": _BASE_URL_V2,
30-
"qwen3-32b": _BASE_URL_V2,
31-
"qwen3-coder-480b-a35b-instruct": _BASE_URL_V2,
32-
"qwen2.5-vl-72b": _BASE_URL_V2,
33-
}
34-
3514
thinking_mapping = {
3615
"deepseek-v3.2": _THINKING_PATH_XDS,
3716
"deepseek-v3.2-exp": _THINKING_PATH_XDS,
3817
"deepseek-v3.1-terminus": _THINKING_PATH_XDS,
3918
"qwen3-235b-a22b": _THINKING_PATH_VLLM,
4019
"qwen3-32b": _THINKING_PATH_VLLM,
4120
"qwen3-30b-a3b": _THINKING_PATH_VLLM,
42-
"glm-5": _THINKING_PATH_VLLM,
43-
"glm-5.1": _THINKING_PATH_VLLM,
21+
"glm-5": _THINKING_PATH_XDS,
22+
"glm-5.1": _THINKING_PATH_XDS,
23+
"glm-5.2": _THINKING_PATH_XDS,
4424
"kimi-k2.6": _THINKING_PATH_XDS,
4525
"deepseek-v4-flash": _THINKING_PATH_XDS,
26+
"deepseek-v4-pro": _THINKING_PATH_XDS,
27+
"openpangu-2.0-flash": _THINKING_PATH_XDS,
4628
}
4729

4830
def _invoke(
@@ -82,10 +64,7 @@ def validate_credentials(self, model: str, credentials: dict) -> None:
8264

8365
def _add_custom_parameters(self, model: str, credentials: dict) -> None:
8466
credentials["mode"] = "chat"
85-
endpoint_url = HuaweiCloudMaasLargeLanguageModel.endpoint_mapping.get(
86-
model, HuaweiCloudMaasLargeLanguageModel._BASE_URL_V1
87-
)
88-
credentials["endpoint_url"] = str(credentials.get("endpoint_url", endpoint_url))
67+
credentials["endpoint_url"] = str(credentials.get("endpoint_url", self._BASE_URL_V2))
8968

9069
def _add_function_call(self, model: str, credentials: dict) -> None:
9170
model_schema = self.get_model_schema(model, credentials)

models/huaweicloud_maas/models/llm/longcat-flash-chat.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ pricing:
3636
output: '8'
3737
unit: '0.000001'
3838
currency: RMB
39+
deprecated: true

0 commit comments

Comments
 (0)