dify
dify copied to clipboard
system default model saved error in backend but show success in the webapp
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.6.7
Cloud or Self Hosted
Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
- install an ollama local model wangshenzhi/llama3-8b-chinese-chat-ollama-fp16:latest
- save this model as system reasoning model
✔️ Expected Behavior
the saving should succeed.
❌ Actual Behavior
saving failed The model_name = db.Column(db.String(255), nullable=False) in ProviderModel is 255 length while in TenantDefaultModel it's model_name = db.Column(db.String(40), nullable=False). The inconsistency lead to this bug.
The issue you're experiencing seems to stem from a discrepancy in the model_name
field length between ProviderModel
and TenantDefaultModel
. In ProviderModel
, the model_name
field is set to allow up to 255 characters, whereas in TenantDefaultModel
, it's limited to just 40 characters. This inconsistency is likely causing the error when you attempt to save the model as a system reasoning model, especially if the model_name
of your local model exceeds 40 characters.
To resolve this issue, you might need to adjust the model_name
length in either of the models to ensure consistency. If the model name does not necessarily need to be longer than 40 characters, consider renaming your model to comply with the shorter length requirement. However, if longer names are essential for your use case, you may need to modify the TenantDefaultModel
to accommodate longer names, ensuring that any changes made do not affect other parts of your application adversely.
It's also important to ensure that both the frontend and backend versions of your application are consistent and up-to-date to prevent any unexpected errors. Additionally, verify that your model configurations, including max_tokens
and input data, adhere to the limits and formats supported by your model to avoid "maximal size error," "Null value error," and "text-encoding value error."
Lastly, if your application interacts with external APIs or models, make sure you haven't exceeded any rate limits or quotas, as this could also lead to errors when saving or processing data in the backend.
Details
Sources
- en/user-guide/creating-dify-apps/llms-use-faq.md
- api/models/provider.py
- api/controllers/console/error.py
- api/core/app/app_config/easy_ui_based_app/model_config/converter.py
- api/models/model.py
- en/tutorials/model-configuration/README.md
- web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx
- api/core/provider_manager.py
- api/migrations/versions/16fa53d9faec_add_provider_model_support.py
- api/core/model_runtime/model_providers/nvidia/text_embedding/text_embedding.py
- en/tutorials/model-configuration/localai.md
- en/getting-started/install-self-hosted/install-faq.md
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.