No gpt-4o-mini listed in the self-hosted version #4742

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

Originally created by @hackensun on GitHub (Jul 23, 2024).

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 (Docker)

Steps to reproduce

I can't see the gpt-4o-mini in the OpenAI model list in the Self Hosted version. But I can see it in the Cloud version with the same API key and base URLimage

✔️ Expected Behavior

List all the OpenAI models including gpt-4o-mini in self-hosed version as the Cloud version

Actual Behavior

No gpt-4o-mini listed in the self-hosted version

Originally created by @hackensun on GitHub (Jul 23, 2024). ### 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 (Docker) ### Steps to reproduce I can't see the gpt-4o-mini in the OpenAI model list in the Self Hosted version. But I can see it in the Cloud version with the same API key and base URL<img width="1026" alt="image" src="https://github.com/user-attachments/assets/fe880d5a-22b6-4636-aca3-453629617295"> ### ✔️ Expected Behavior List all the OpenAI models including gpt-4o-mini in self-hosed version as the Cloud version ### ❌ Actual Behavior No gpt-4o-mini listed in the self-hosted version
yindo added the 🐞 bug label 2026-02-21 18:07:49 -05:00
yindo closed this issue 2026-02-21 18:07:49 -05:00
Author
Owner

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

@hackensun 你好!我是一个能帮助你解决问题、回答疑问并成为贡献者的机器人。在等待人类维护者时,我会尽力协助你。

To get the gpt-4o-mini model listed in the OpenAI model list in your self-hosted Dify version 0.6.14 with Docker, you need to add it to the _position.yaml file under the api/core/model_runtime/model_providers/openai/llm directory. Here is how you can do it:

  1. Open the _position.yaml file located at api/core/model_runtime/model_providers/openai/llm/.
  2. Add the gpt-4o-mini entry to the list.

The updated _position.yaml file should look like this:

- gpt-4
- gpt-4o
- gpt-4o-2024-05-13
- gpt-4-turbo
- gpt-4-turbo-2024-04-09
- gpt-4-turbo-preview
- gpt-4-32k
- gpt-4-1106-preview
- gpt-4-0125-preview
- gpt-4-vision-preview
- gpt-3.5-turbo
- gpt-3.5-turbo-16k
- gpt-3.5-turbo-16k-0613
- gpt-3.5-turbo-0125
- gpt-3.5-turbo-1106
- gpt-3.5-turbo-0613
- gpt-3.5-turbo-instruct
- text-davinci-003
- gpt-4o-mini

Additionally, you need to create a configuration file for the gpt-4o-mini model similar to the existing gpt-4.yaml file. Here is an example configuration based on the gpt-4.yaml file:

model: openai/gpt-4o-mini
label:
  en_US: gpt-4o-mini
model_type: llm
features:
  - multi-tool-call
  - agent-thought
  - stream-tool-call
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
  - 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: "5.00"
  output: "15.00"
  unit: "0.000001"
  currency: USD

After making these changes, restart your Dify instance to apply the update [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 23, 2024): <!-- Greeting --> @hackensun 你好!我是一个能帮助你解决问题、回答疑问并成为贡献者的机器人。在等待人类维护者时,我会尽力协助你。 <!-- Answer --> To get the `gpt-4o-mini` model listed in the OpenAI model list in your self-hosted Dify version 0.6.14 with Docker, you need to add it to the `_position.yaml` file under the `api/core/model_runtime/model_providers/openai/llm` directory. Here is how you can do it: 1. Open the `_position.yaml` file located at `api/core/model_runtime/model_providers/openai/llm/`. 2. Add the `gpt-4o-mini` entry to the list. The updated `_position.yaml` file should look like this: ```yaml - gpt-4 - gpt-4o - gpt-4o-2024-05-13 - gpt-4-turbo - gpt-4-turbo-2024-04-09 - gpt-4-turbo-preview - gpt-4-32k - gpt-4-1106-preview - gpt-4-0125-preview - gpt-4-vision-preview - gpt-3.5-turbo - gpt-3.5-turbo-16k - gpt-3.5-turbo-16k-0613 - gpt-3.5-turbo-0125 - gpt-3.5-turbo-1106 - gpt-3.5-turbo-0613 - gpt-3.5-turbo-instruct - text-davinci-003 - gpt-4o-mini ``` Additionally, you need to create a configuration file for the `gpt-4o-mini` model similar to the existing `gpt-4.yaml` file. Here is an example configuration based on the `gpt-4.yaml` file: ```yaml model: openai/gpt-4o-mini label: en_US: gpt-4o-mini model_type: llm features: - multi-tool-call - agent-thought - stream-tool-call 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 - 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: "5.00" output: "15.00" unit: "0.000001" currency: USD ``` After making these changes, restart your Dify instance to apply the update <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/openrouter/llm/_position.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/openrouter/llm/gpt-4o.yaml)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/openai/llm/_position.yaml)</sup><sup>[[4]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/openrouter/llm/gpt-4.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#4742