From ec068b93217aec32a1192f909e82fd72fcad3c6d Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Fri, 26 Jan 2024 12:48:57 +0800 Subject: [PATCH 1/2] add openai gpt-4-0125-preview --- .../model_providers/openai/llm/_position.yaml | 1 + .../openai/llm/gpt-4-0125-preview.yaml | 58 +++++++++++++++++++ .../openai/llm/gpt-4-1106-preview.yaml | 2 +- .../openai/llm/gpt-4-vision-preview.yaml | 2 +- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml diff --git a/api/core/model_runtime/model_providers/openai/llm/_position.yaml b/api/core/model_runtime/model_providers/openai/llm/_position.yaml index 1457101197b7f..4740f55fbc4fa 100644 --- a/api/core/model_runtime/model_providers/openai/llm/_position.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/_position.yaml @@ -1,6 +1,7 @@ - gpt-4 - gpt-4-32k - gpt-4-1106-preview +- gpt-4-0125-preview - gpt-4-vision-preview - gpt-3.5-turbo - gpt-3.5-turbo-16k diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml new file mode 100644 index 0000000000000..d2893780218e3 --- /dev/null +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml @@ -0,0 +1,58 @@ +model: gpt-4-0125-preview +label: + zh_Hans: gpt-4-0125-preview + en_US: gpt-4-0125-preview +model_type: llm +features: + - multi-tool-call + - agent-thought +model_properties: + mode: chat + context_size: 128000 +parameter_rules: + - name: temperature + use_template: temperature + - name: top_p + use_template: top_p + - name: presence_penalty + use_template: presence_penalty + - name: frequency_penalty + use_template: frequency_penalty + - name: max_tokens + use_template: max_tokens + default: 512 + min: 1 + max: 128000 + - name: seed + label: + zh_Hans: 种子 + en_US: Seed + type: int + help: + zh_Hans: 如果指定,模型将尽最大努力进行确定性采样,使得重复的具有相同种子和参数的请求应该返回相同的结果。不能保证确定性,您应该参考 system_fingerprint + 响应参数来监视变化。 + en_US: If specified, model will make a best effort to sample deterministically, + such that repeated requests with the same seed and parameters should return + the same result. Determinism is not guaranteed, and you should refer to the + system_fingerprint response parameter to monitor changes in the backend. + required: false + precision: 2 + min: 0 + max: 1 + - name: response_format + label: + zh_Hans: 回复格式 + en_US: response_format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '0.01' + output: '0.03' + unit: '0.001' + currency: USD diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml index 73258fedae5ed..8adc77c380278 100644 --- a/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml @@ -22,7 +22,7 @@ parameter_rules: use_template: max_tokens default: 512 min: 1 - max: 4096 + max: 128000 - name: seed label: zh_Hans: 种子 diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml index b7044d20666ef..13aec8ef53235 100644 --- a/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml @@ -21,7 +21,7 @@ parameter_rules: use_template: max_tokens default: 512 min: 1 - max: 4096 + max: 128000 - name: seed label: zh_Hans: 种子 From 74b36b57fed5078c613ea4104980836e5427a73e Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Fri, 26 Jan 2024 13:21:18 +0800 Subject: [PATCH 2/2] add gpt4 turbo --- .../model_providers/openai/llm/_position.yaml | 1 + .../openai/llm/gpt-4-0125-preview.yaml | 2 +- .../openai/llm/gpt-4-1106-preview.yaml | 2 +- .../openai/llm/gpt-4-turbo-preview.yaml | 58 +++++++++++++++++++ .../openai/llm/gpt-4-vision-preview.yaml | 2 +- 5 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 api/core/model_runtime/model_providers/openai/llm/gpt-4-turbo-preview.yaml diff --git a/api/core/model_runtime/model_providers/openai/llm/_position.yaml b/api/core/model_runtime/model_providers/openai/llm/_position.yaml index 4740f55fbc4fa..3c32708417226 100644 --- a/api/core/model_runtime/model_providers/openai/llm/_position.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/_position.yaml @@ -1,4 +1,5 @@ - gpt-4 +- gpt-4-turbo-preview - gpt-4-32k - gpt-4-1106-preview - gpt-4-0125-preview diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml index d2893780218e3..d70395c566a09 100644 --- a/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-0125-preview.yaml @@ -22,7 +22,7 @@ parameter_rules: use_template: max_tokens default: 512 min: 1 - max: 128000 + max: 4096 - name: seed label: zh_Hans: 种子 diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml index 8adc77c380278..73258fedae5ed 100644 --- a/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-1106-preview.yaml @@ -22,7 +22,7 @@ parameter_rules: use_template: max_tokens default: 512 min: 1 - max: 128000 + max: 4096 - name: seed label: zh_Hans: 种子 diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-turbo-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-turbo-preview.yaml new file mode 100644 index 0000000000000..c651a4e0e9188 --- /dev/null +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-turbo-preview.yaml @@ -0,0 +1,58 @@ +model: gpt-4-turbo-preview +label: + zh_Hans: gpt-4-turbo-preview + en_US: gpt-4-turbo-preview +model_type: llm +features: + - multi-tool-call + - agent-thought +model_properties: + mode: chat + context_size: 128000 +parameter_rules: + - name: temperature + use_template: temperature + - name: top_p + use_template: top_p + - name: presence_penalty + use_template: presence_penalty + - name: frequency_penalty + use_template: frequency_penalty + - name: max_tokens + use_template: max_tokens + default: 512 + min: 1 + max: 4096 + - name: seed + label: + zh_Hans: 种子 + en_US: Seed + type: int + help: + zh_Hans: 如果指定,模型将尽最大努力进行确定性采样,使得重复的具有相同种子和参数的请求应该返回相同的结果。不能保证确定性,您应该参考 system_fingerprint + 响应参数来监视变化。 + en_US: If specified, model will make a best effort to sample deterministically, + such that repeated requests with the same seed and parameters should return + the same result. Determinism is not guaranteed, and you should refer to the + system_fingerprint response parameter to monitor changes in the backend. + required: false + precision: 2 + min: 0 + max: 1 + - name: response_format + label: + zh_Hans: 回复格式 + en_US: response_format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '0.01' + output: '0.03' + unit: '0.001' + currency: USD diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml index 13aec8ef53235..b7044d20666ef 100644 --- a/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml +++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4-vision-preview.yaml @@ -21,7 +21,7 @@ parameter_rules: use_template: max_tokens default: 512 min: 1 - max: 128000 + max: 4096 - name: seed label: zh_Hans: 种子