When the workspace sets the system model to gpt-4o and the default model set in the code (i.e. model_template.py) has the same name, when creating an application, the model will select the default model in the code instead of the system model #4624

Closed
opened 2026-02-21 18:07:17 -05:00 by yindo · 1 comment
Owner

Originally created by @FamousMai on GitHub (Jul 16, 2024).

Originally assigned to: @takatost on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.14

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Set up the gpt4-o model of azure-openai and set it as the system model
image
  1. When creating an application, the model still selects the openai provider's gpt4-o by default.
image

✔️ Expected Behavior

Create an application, and select the gpt4-o model of azure-openai by default

Actual Behavior

Create an application, and select the OpenAI gpt4-o model by default

Originally created by @FamousMai on GitHub (Jul 16, 2024). Originally assigned to: @takatost on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.14 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1. Set up the gpt4-o model of azure-openai and set it as the system model <img width="400" alt="image" src="https://github.com/user-attachments/assets/c6a1c495-0850-470b-8747-9eb639fdcf97"> 2. When creating an application, the model still selects the openai provider's gpt4-o by default. <img width="328" alt="image" src="https://github.com/user-attachments/assets/6394d0f6-04c6-4c47-91c7-27c129f9779d"> ### ✔️ Expected Behavior Create an application, and select the gpt4-o model of azure-openai by default ### ❌ Actual Behavior Create an application, and select the OpenAI gpt4-o model by default
yindo added the 🐞 bug label 2026-02-21 18:07:17 -05:00
yindo closed this issue 2026-02-21 18:07:17 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 16, 2024):

@FamousMai Hello! I'm here to help you with your bug report and answer any questions you may have. Let's take a look at the issue you've encountered.

To ensure that the application creation process selects the "gpt-4o" model of Azure OpenAI by default instead of the OpenAI "gpt-4o" model when the system model is set to "gpt-4o", you need to configure the AzureBaseModel for "gpt-4o" in the model provider settings.

From the provided document, the AzureBaseModel for "gpt-4o" is already defined. You need to ensure that this model is selected by default when the system model is set to "gpt-4o". This can be done by setting the base_model_name to "gpt-4o" in the application creation logic.

Here is the relevant configuration for the "gpt-4o" model:

provider: azure_openai
label:
  en_US: Azure OpenAI Service Model
icon_small:
  en_US: icon_s_en.svg
icon_large:
  en_US: icon_l_en.png
background: "#E3F0FF"
help:
  title:
    en_US: Get your API key from Azure
    zh_Hans: 从 Azure 获取 API Key
  url:
    en_US: https://azure.microsoft.com/en-us/products/ai-services/openai-service
supported_model_types:
  - llm
  - text-embedding
  - speech2text
  - tts
configurate_methods:
  - customizable-model
model_credential_schema:
  model:
    label:
      en_US: Deployment Name
      zh_Hans: 部署名称
    placeholder:
      en_US: Enter your Deployment Name here, matching the Azure deployment name.
      zh_Hans: 在此输入您的部署名称,与 Azure 部署名称匹配。
  credential_form_schemas:
    - variable: openai_api_base
      label:
        en_US: API Endpoint URL
        zh_Hans: API 域名
      type: text-input
      required: true
      placeholder:
        zh_Hans: '在此输入您的 API 域名,如:https://example.com/xxx'
        en_US: 'Enter your API Endpoint, eg: https://example.com/xxx'
    - variable: openai_api_key
      label:
        en_US: API Key
        zh_Hans: API Key
      type: secret-input
      required: true
      placeholder:
        zh_Hans: 在此输入您的 API Key
        en_US: Enter your API key here
    - variable: openai_api_version
      label:
        zh_Hans: API 版本
        en_US: API Version
      type: select
      required: true
      options:
        - label:
            en_US: 2024-05-01-preview
          value: 2024-05-01-preview
        - label:
            en_US: 2024-04-01-preview
          value: 2024-04-01-preview
        - label:
            en_US: 2024-03-01-preview
          value: 2024-03-01-preview
        - label:
            en_US: 2024-02-15-preview
          value: 2024-02-15-preview
        - label:
            en_US: 2023-12-01-preview
          value: 2023-12-01-preview
        - label:
            en_US: '2024-02-01'
          value: '2024-02-01'
      placeholder:
        zh_Hans: 在此选择您的 API 版本
        en_US: Select your API Version here
    - variable: base_model_name
      label:
        en_US: Base Model
        zh_Hans: 基础模型
      type: select
      required: true
      options:
        - label:
            en_US: gpt-35-turbo
          value: gpt-35-turbo
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-35-turbo-0125
          value: gpt-35-turbo-0125
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-35-turbo-16k
          value: gpt-35-turbo-16k
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4
          value: gpt-4
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-32k
          value: gpt-4-32k
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4o
          value: gpt-4o
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4o-2024-05-13
          value: gpt-4o-2024-05-13
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-turbo
          value: gpt-4-turbo
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-turbo-2024-04-09
          value: gpt-4-turbo-2024-04-09
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-0125-preview
          value: gpt-4-0125-preview
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-1106-preview
          value: gpt-4-1106-preview
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-4-vision-preview
          value: gpt-4-vision-preview
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: gpt-35-turbo-instruct
          value: gpt-35-turbo-instruct
          show_on:
            - variable: __model_type
              value: llm
        - label:
            en_US: text-embedding-ada-002
          value: text-embedding-ada-002
          show_on:
            - variable: __model_type
              value: text-embedding
        - label:
            en_US: text-embedding-3-small
          value: text-embedding-3-small
          show_on:
            - variable: __model_type
              value: text-embedding
        - label:
            en_US: text-embedding-3-large
          value: text-embedding-3-large
          show_on:
            - variable: __model_type
              value: text-embedding
        - label:
            en_US: whisper-1
          value: whisper-1
          show_on:
            - variable: __model_type
              value: speech2text
        - label:
            en_US: tts-1
          value: tts-1
          show_on:
            - variable: __model_type
              value: tts
        - label:
            en_US: tts-1-hd
          value: tts-1-hd
          show_on:
            - variable: __model_type
              value: tts
      placeholder:
        zh_Hans: 在此输入您的模型版本
        en_US: Enter your model version

Ensure that this configuration is used in your application creation logic to set the default model to "gpt-4o" for Azure OpenAI [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 16, 2024): <!-- Greeting --> @FamousMai Hello! I'm here to help you with your bug report and answer any questions you may have. Let's take a look at the issue you've encountered. <!-- Answer --> To ensure that the application creation process selects the "gpt-4o" model of Azure OpenAI by default instead of the OpenAI "gpt-4o" model when the system model is set to "gpt-4o", you need to configure the `AzureBaseModel` for "gpt-4o" in the model provider settings. From the provided document, the `AzureBaseModel` for "gpt-4o" is already defined. You need to ensure that this model is selected by default when the system model is set to "gpt-4o". This can be done by setting the `base_model_name` to "gpt-4o" in the application creation logic. Here is the relevant configuration for the "gpt-4o" model: ```yaml provider: azure_openai label: en_US: Azure OpenAI Service Model icon_small: en_US: icon_s_en.svg icon_large: en_US: icon_l_en.png background: "#E3F0FF" help: title: en_US: Get your API key from Azure zh_Hans: 从 Azure 获取 API Key url: en_US: https://azure.microsoft.com/en-us/products/ai-services/openai-service supported_model_types: - llm - text-embedding - speech2text - tts configurate_methods: - customizable-model model_credential_schema: model: label: en_US: Deployment Name zh_Hans: 部署名称 placeholder: en_US: Enter your Deployment Name here, matching the Azure deployment name. zh_Hans: 在此输入您的部署名称,与 Azure 部署名称匹配。 credential_form_schemas: - variable: openai_api_base label: en_US: API Endpoint URL zh_Hans: API 域名 type: text-input required: true placeholder: zh_Hans: '在此输入您的 API 域名,如:https://example.com/xxx' en_US: 'Enter your API Endpoint, eg: https://example.com/xxx' - variable: openai_api_key label: en_US: API Key zh_Hans: API Key type: secret-input required: true placeholder: zh_Hans: 在此输入您的 API Key en_US: Enter your API key here - variable: openai_api_version label: zh_Hans: API 版本 en_US: API Version type: select required: true options: - label: en_US: 2024-05-01-preview value: 2024-05-01-preview - label: en_US: 2024-04-01-preview value: 2024-04-01-preview - label: en_US: 2024-03-01-preview value: 2024-03-01-preview - label: en_US: 2024-02-15-preview value: 2024-02-15-preview - label: en_US: 2023-12-01-preview value: 2023-12-01-preview - label: en_US: '2024-02-01' value: '2024-02-01' placeholder: zh_Hans: 在此选择您的 API 版本 en_US: Select your API Version here - variable: base_model_name label: en_US: Base Model zh_Hans: 基础模型 type: select required: true options: - label: en_US: gpt-35-turbo value: gpt-35-turbo show_on: - variable: __model_type value: llm - label: en_US: gpt-35-turbo-0125 value: gpt-35-turbo-0125 show_on: - variable: __model_type value: llm - label: en_US: gpt-35-turbo-16k value: gpt-35-turbo-16k show_on: - variable: __model_type value: llm - label: en_US: gpt-4 value: gpt-4 show_on: - variable: __model_type value: llm - label: en_US: gpt-4-32k value: gpt-4-32k show_on: - variable: __model_type value: llm - label: en_US: gpt-4o value: gpt-4o show_on: - variable: __model_type value: llm - label: en_US: gpt-4o-2024-05-13 value: gpt-4o-2024-05-13 show_on: - variable: __model_type value: llm - label: en_US: gpt-4-turbo value: gpt-4-turbo show_on: - variable: __model_type value: llm - label: en_US: gpt-4-turbo-2024-04-09 value: gpt-4-turbo-2024-04-09 show_on: - variable: __model_type value: llm - label: en_US: gpt-4-0125-preview value: gpt-4-0125-preview show_on: - variable: __model_type value: llm - label: en_US: gpt-4-1106-preview value: gpt-4-1106-preview show_on: - variable: __model_type value: llm - label: en_US: gpt-4-vision-preview value: gpt-4-vision-preview show_on: - variable: __model_type value: llm - label: en_US: gpt-35-turbo-instruct value: gpt-35-turbo-instruct show_on: - variable: __model_type value: llm - label: en_US: text-embedding-ada-002 value: text-embedding-ada-002 show_on: - variable: __model_type value: text-embedding - label: en_US: text-embedding-3-small value: text-embedding-3-small show_on: - variable: __model_type value: text-embedding - label: en_US: text-embedding-3-large value: text-embedding-3-large show_on: - variable: __model_type value: text-embedding - label: en_US: whisper-1 value: whisper-1 show_on: - variable: __model_type value: speech2text - label: en_US: tts-1 value: tts-1 show_on: - variable: __model_type value: tts - label: en_US: tts-1-hd value: tts-1-hd show_on: - variable: __model_type value: tts placeholder: zh_Hans: 在此输入您的模型版本 en_US: Enter your model version ``` Ensure that this configuration is used in your application creation logic to set the default model to "gpt-4o" for Azure OpenAI <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4624