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
43.07k stars 5.98k forks source link

Ollama Num GPU option not consistent with allowed values #4742

Closed rothnic closed 3 months ago

rothnic commented 3 months ago

Self Checks

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Setup:

Issue:

✔️ Expected Behavior

  1. I'd expect for the option to support the range of values that ollama allows. It currently is allowing values between 0 and 1. Ollama's code suggests it should only be allowed as integer values and should be the number of layers, which suggests any integer value up to the number of layers in the model (which might not be known, so should not be limited to any max integer value)
  2. The user interface should only support integers. The user interface in Dify seems to be configured to support that option as an integer, but the input component seems to not limit to only integer values.
image

❌ Actual Behavior

crazywoola commented 3 months ago

Will take a look at this tmr.

rothnic commented 3 months ago

Will take a look at this tmr.

Thanks! IMO, it might be worth mentioning in the tooltips any default behavior. In this case, you might not know that by not setting the value (i assume on a non-mac), then you enable all layers to use the gpu. I just imagine it would be confusing for most people to see a toogle option called "Use GPU" and not want to enable it, because it sounds like it toggles gpu use on.

It is a poorly named option from the ollama side of things, so another thought would be to change the option label in the Dify UI to "GPU Layers" and maybe have the tooltip reference the official parameter name.