Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Add Jamba and Llama3.2 model support (#8878)

longzhihune4ed916baadb
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml b/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
index 86c8061deef..47e2b020fd0 100644
--- a/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
+++ b/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
@@ -6,6 +6,8 @@
- anthropic.claude-v2:1
- anthropic.claude-3-sonnet-v1:0
- anthropic.claude-3-haiku-v1:0
+- ai21.jamba-1-5-large-v1:0
+- ai21.jamba-1-5-mini-v1:0
- cohere.command-light-text-v14
- cohere.command-text-v14
- cohere.command-r-plus-v1.0
@@ -15,6 +17,10 @@
- meta.llama3-1-405b-instruct-v1:0
- meta.llama3-8b-instruct-v1:0
- meta.llama3-70b-instruct-v1:0
+- us.meta.llama3-2-1b-instruct-v1:0
+- us.meta.llama3-2-3b-instruct-v1:0
+- us.meta.llama3-2-11b-instruct-v1:0
+- us.meta.llama3-2-90b-instruct-v1:0
- meta.llama2-13b-chat-v1
- meta.llama2-70b-chat-v1
- mistral.mistral-large-2407-v1:0
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-large-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-large-v1.0.yaml
new file mode 100644
index 00000000000..276c7312cee
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-large-v1.0.yaml
@@ -0,0 +1,26 @@
+model: ai21.jamba-1-5-large-v1:0
+label:
+ en_US: Jamba 1.5 Large
+model_type: llm
+model_properties:
+ mode: completion
+ context_size: 256000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 1
+ min: 0.0
+ max: 2.0
+ - name: top_p
+ use_template: top_p
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 4096
+ min: 1
+ max: 4096
+pricing:
+ input: '0.002'
+ output: '0.008'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-mini-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-mini-v1.0.yaml
new file mode 100644
index 00000000000..3461d8ab713
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/ai21.jamba-1-5-mini-v1.0.yaml
@@ -0,0 +1,26 @@
+model: ai21.jamba-1-5-mini-v1:0
+label:
+ en_US: Jamba 1.5 Mini
+model_type: llm
+model_properties:
+ mode: completion
+ context_size: 256000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 1
+ min: 0.0
+ max: 2.0
+ - name: top_p
+ use_template: top_p
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 4096
+ min: 1
+ max: 4096
+pricing:
+ input: '0.0002'
+ output: '0.0004'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/llm.py b/api/core/model_runtime/model_providers/bedrock/llm/llm.py
index 77bab0c2945..d1961784f2e 100644
--- a/api/core/model_runtime/model_providers/bedrock/llm/llm.py
+++ b/api/core/model_runtime/model_providers/bedrock/llm/llm.py
@@ -63,6 +63,7 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
{"prefix": "us.anthropic.claude-3", "support_system_prompts": True, "support_tool_use": True},
{"prefix": "eu.anthropic.claude-3", "support_system_prompts": True, "support_tool_use": True},
{"prefix": "anthropic.claude-3", "support_system_prompts": True, "support_tool_use": True},
+ {"prefix": "us.meta.llama3-2", "support_system_prompts": True, "support_tool_use": True},
{"prefix": "meta.llama", "support_system_prompts": True, "support_tool_use": False},
{"prefix": "mistral.mistral-7b-instruct", "support_system_prompts": False, "support_tool_use": False},
{"prefix": "mistral.mixtral-8x7b-instruct", "support_system_prompts": False, "support_tool_use": False},
@@ -70,6 +71,7 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
{"prefix": "mistral.mistral-small", "support_system_prompts": True, "support_tool_use": True},
{"prefix": "cohere.command-r", "support_system_prompts": True, "support_tool_use": True},
{"prefix": "amazon.titan", "support_system_prompts": False, "support_tool_use": False},
+ {"prefix": "ai21.jamba-1-5", "support_system_prompts": True, "support_tool_use": False},
]
@staticmethod
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-11b-instruct-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-11b-instruct-v1.0.yaml
new file mode 100644
index 00000000000..029f428776e
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-11b-instruct-v1.0.yaml
@@ -0,0 +1,29 @@
+model: us.meta.llama3-2-11b-instruct-v1:0
+label:
+ en_US: US Meta Llama 3.2 11B Instruct
+model_type: llm
+features:
+ - vision
+ - tool-call
+model_properties:
+ mode: completion
+ context_size: 128000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 0.5
+ min: 0.0
+ max: 1
+ - name: top_p
+ use_template: top_p
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 512
+ min: 1
+ max: 2048
+pricing:
+ input: '0.00035'
+ output: '0.00035'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-1b-instruct-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-1b-instruct-v1.0.yaml
new file mode 100644
index 00000000000..51c8474e548
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-1b-instruct-v1.0.yaml
@@ -0,0 +1,26 @@
+model: us.meta.llama3-2-1b-instruct-v1:0
+label:
+ en_US: US Meta Llama 3.2 1B Instruct
+model_type: llm
+model_properties:
+ mode: completion
+ context_size: 128000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 0.5
+ min: 0.0
+ max: 1
+ - name: top_p
+ use_template: top_p
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 512
+ min: 1
+ max: 2048
+pricing:
+ input: '0.0001'
+ output: '0.0001'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-3b-instruct-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-3b-instruct-v1.0.yaml
new file mode 100644
index 00000000000..472cc7403e2
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-3b-instruct-v1.0.yaml
@@ -0,0 +1,26 @@
+model: us.meta.llama3-2-3b-instruct-v1:0
+label:
+ en_US: US Meta Llama 3.2 3B Instruct
+model_type: llm
+model_properties:
+ mode: completion
+ context_size: 128000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 0.5
+ min: 0.0
+ max: 1
+ - name: top_p
+ use_template: top_p
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 512
+ min: 1
+ max: 2048
+pricing:
+ input: '0.00015'
+ output: '0.00015'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-90b-instruct-v1.0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-90b-instruct-v1.0.yaml
new file mode 100644
index 00000000000..cecd0236ca9
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/us.meta.llama3-2-90b-instruct-v1.0.yaml
@@ -0,0 +1,31 @@
+model: us.meta.llama3-2-90b-instruct-v1:0
+label:
+ en_US: US Meta Llama 3.2 90B Instruct
+model_type: llm
+features:
+ - tool-call
+model_properties:
+ mode: completion
+ context_size: 128000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ default: 0.5
+ min: 0.0
+ max: 1
+ - name: top_p
+ use_template: top_p
+ default: 0.9
+ min: 0
+ max: 1
+ - name: max_gen_len
+ use_template: max_tokens
+ required: true
+ default: 512
+ min: 1
+ max: 2048
+pricing:
+ input: '0.002'
+ output: '0.002'
+ unit: '0.001'
+ currency: USD