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
49.57k stars 7.09k forks source link

GLM-4-Long context supports 1M, why is dify set to 4096? #9904

Open jaxonister opened 3 hours ago

jaxonister commented 3 hours ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

✔️ Expected Behavior

context supports 1M

❌ Actual Behavior

context 4096

dosubot[bot] commented 3 hours ago

The context size in Dify is set to 4096 for certain models due to specific limitations or configurations. However, the Dify documentation mentions that for the gpt-3.5-turbo model, there is a token limit of 4097 tokens, which might be a reason for setting the context size to 4096 to avoid errors [1].

If you are using a model like GLM-4-Long that supports a larger context size, you might need to adjust the configuration files or settings to utilize the full context size supported by the model. The context size for models in Dify can be configured in files such as rerank-1.yaml and rerank-2.yaml, where context sizes are set to 8000 and 16000 respectively [2][3]. You may need to check these configurations or similar ones for your specific model setup.

To continue talking to Dosu, mention @dosu.

ox01024 commented 2 hours ago
image

In fact, it is 1M. Have you encountered any problems in using it? Do you have any evidence?