langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.13k stars 7.17k forks source link

GPT usage #8689

Closed SavioR0 closed 1 month ago

SavioR0 commented 1 month ago

Self Checks

Dify version

0.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am using blocks that utilize GPT models, selecting only the GPT-4o-mini.

✔️ Expected Behavior

Do not use the GPT-4 model.

❌ Actual Behavior

I am using a chaflow and, as part of the configuration, I disabled all available ChatGPT models, leaving only the GPT-4o-mini. image.png I am still experiencing a billing issue with my GPT-4 account. In none of the nodes am I using GPT-4, I am not using the API key in another project, yet it is consuming the largest portion of my expenses, as illustrated. Screen_Shot_2024-09-18_at_16.50.52.png

dosubot[bot] commented 1 month ago

I found two similar discussions that might be relevant to your issue:

  1. 高级模型(gpt-4)的潜在使用 (open) [1]
  2. GPT-4o-mini (open) [2]

You are experiencing a billing issue with your GPT-4 account despite only using the GPT-4o-mini model in your self-hosted Dify version 0.7.2 setup because:

Supporting Evidence:

  1. Embedding Model Usage: The embedding process and other dialog generation tasks like next question suggestions default to using OpenAI keys. This means OpenAI credits are still consumed even if you are using a different model for primary tasks [3].

  2. Quota and Restriction Configuration: The api/core/hosting_configuration.py file shows that various models, including gpt-4o-mini, are restricted under different quota types (e.g., trial, paid). This means that even if you are using the gpt-4o-mini model, it might still be consuming credits from your OpenAI quota if not properly configured [4].

Code/Configuration Check:

Ensure that your embedding model is not set to use OpenAI's GPT-4 key. You can check and configure this in Settings --> Model Providers.

{
  "model_providers": {
    "default_embedding_model": "your_preferred_model"
  }
}

Additionally, verify your quota and restriction settings in your configuration file to ensure that the gpt-4o-mini model is not inadvertently consuming OpenAI credits. You can do this by checking the HostingConfiguration class and its methods to ensure that the correct quotas and restrictions are applied [4].

To continue talking to Dosu, mention @dosu.

crazywoola commented 1 month ago

Duplicated questions, some parts of the workflow will use the system model for some tasks. You need to change that as well.

QQ_1727097805435