API Call Error: 'invalid_param' in Chat Flow with Ollama LLM Deployment #6696

Closed
opened 2026-02-21 18:16:53 -05:00 by yindo · 3 comments
Owner

Originally created by @ghost on GitHub (Nov 12, 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I defined a simple chat flow, where the LLM used is deployed by Ollama. It runs normally during testing in Dify, but when calling the API, an error 'invalid_param' occurs at the LLM node.
At the same time, the API for the workflow with the same configuration can be called normally.

✔️ Expected Behavior

No response

Actual Behavior

Snipaste_2024-11-12_14-35-40
Snipaste_2024-11-12_14-36-39

Originally created by @ghost on GitHub (Nov 12, 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I defined a simple chat flow, where the LLM used is deployed by Ollama. It runs normally during testing in Dify, but when calling the API, an error 'invalid_param' occurs at the LLM node. At the same time, the API for the workflow with the same configuration can be called normally. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior ![Snipaste_2024-11-12_14-35-40](https://github.com/user-attachments/assets/7d6dde82-d701-42f6-b87f-5161c8000a9f) ![Snipaste_2024-11-12_14-36-39](https://github.com/user-attachments/assets/ebb9424c-0f3a-464a-9f8f-0378b117dc6a)
yindo added the 🐞 bug🌚 invalid labels 2026-02-21 18:16:53 -05:00
yindo closed this issue 2026-02-21 18:16:53 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 12, 2024):

@aqdmdpsl1996 Hello! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together!

I found a similar closed issue that might be relevant to your problem. The issue titled "400 invalid_param keyword is required in input form" was resolved by redeploying the workflow, as something seemed to have changed after the initial deployment [1].

Additionally, ensure that you are using the correct parameters for the Ollama LLM deployment. The specific parameters required include:

  • Model Name: llava
  • Base URL: http://<your-ollama-endpoint-domain>:11434 (e.g., http://localhost:11434 for local deployment)
  • Model Type: 对话 (Chat)
  • Model Context Size: 4096
  • Upper Bound for Max Tokens: 4096
  • Vision Support: (Yes, if the model supports image understanding, like llava) [2].

Make sure these parameters are correctly configured in your setup. If the issue persists, consider redeploying the workflow as it might resolve the error.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 12, 2024): <!-- Greeting --> @aqdmdpsl1996 Hello! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together! <!-- Answer --> I found a similar closed issue that might be relevant to your problem. The issue titled "[400 invalid_param keyword is required in input form](https://github.com/langgenius/dify/issues/6008)" was resolved by redeploying the workflow, as something seemed to have changed after the initial deployment <sup>[[1]](https://github.com/langgenius/dify/issues/6008)</sup>. Additionally, ensure that you are using the correct parameters for the Ollama LLM deployment. The specific parameters required include: - **Model Name**: `llava` - **Base URL**: `http://<your-ollama-endpoint-domain>:11434` (e.g., `http://localhost:11434` for local deployment) - **Model Type**: `对话` (Chat) - **Model Context Size**: `4096` - **Upper Bound for Max Tokens**: `4096` - **Vision Support**: `是` (Yes, if the model supports image understanding, like `llava`) <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/development/models-integration/ollama.md)</sup>. Make sure these parameters are correctly configured in your setup. If the issue persists, consider redeploying the workflow as it might resolve the error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Nov 12, 2024):

The message is truncated, please provide full logs of the conversation.

@crazywoola commented on GitHub (Nov 12, 2024): The message is truncated, please provide full logs of the conversation.
Author
Owner

@ghost commented on GitHub (Nov 12, 2024):

The message is truncated, please provide full logs of the conversation.

the dify log is

[ollama] Error: API request failed with status code 500: <html> <head><title>500 Internal Server Error</title></head> <body> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx/1.18.0 (Ubuntu)</center> </body> </html>

and the ollama log is seems to be working fine.

Nov 12 14:48:47 ecs--ai ollama[971307]: time=2024-11-12T14:48:47.027+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model"
Nov 12 14:48:53 ecs--ai ollama[971307]: time=2024-11-12T14:48:53.496+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server not responding"
Nov 12 14:48:53 ecs--ai ollama[971307]: time=2024-11-12T14:48:53.884+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model"
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_ctx      = 8192
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_batch    = 512
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_ubatch   = 512
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: flash_attn = 0
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: freq_base  = 1000000.0
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: freq_scale = 1
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_kv_cache_init:      CUDA0 KV buffer size =  2560.00 MiB
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: KV self size  = 2560.00 MiB, K (f16): 1280.00 MiB, V (f16): 1280.00 MiB
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model:  CUDA_Host  output buffer size =     2.45 MiB
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model:      CUDA0 compute buffer size =  1104.00 MiB
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model:  CUDA_Host compute buffer size =    32.01 MiB
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: graph nodes  = 2806
Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: graph splits = 2
Nov 12 14:48:54 ecs--ai ollama[2300820]: INFO [main] model loaded | tid="139823888588800" timestamp=1731394134
Nov 12 14:48:54 ecs--ai ollama[971307]: time=2024-11-12T14:48:54.888+08:00 level=INFO source=server.go:637 msg="llama runner started in 10.72 seconds"
Nov 12 14:48:58 ecs--ai ollama[971307]: [GIN] 2024/11/12 - 14:48:58 | 200 | 14.818108238s |    192.168.2.46 | POST     "/api/chat"

Snipaste_2024-11-12_14-53-40

@ghost commented on GitHub (Nov 12, 2024): > The message is truncated, please provide full logs of the conversation. the dify log is ``` [ollama] Error: API request failed with status code 500: <html> <head><title>500 Internal Server Error</title></head> <body> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx/1.18.0 (Ubuntu)</center> </body> </html> ``` and the ollama log is seems to be working fine. ``` Nov 12 14:48:47 ecs--ai ollama[971307]: time=2024-11-12T14:48:47.027+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model" Nov 12 14:48:53 ecs--ai ollama[971307]: time=2024-11-12T14:48:53.496+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server not responding" Nov 12 14:48:53 ecs--ai ollama[971307]: time=2024-11-12T14:48:53.884+08:00 level=INFO source=server.go:632 msg="waiting for server to become available" status="llm server loading model" Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_ctx = 8192 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_batch = 512 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: n_ubatch = 512 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: flash_attn = 0 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: freq_base = 1000000.0 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: freq_scale = 1 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_kv_cache_init: CUDA0 KV buffer size = 2560.00 MiB Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: KV self size = 2560.00 MiB, K (f16): 1280.00 MiB, V (f16): 1280.00 MiB Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: CUDA_Host output buffer size = 2.45 MiB Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: CUDA0 compute buffer size = 1104.00 MiB Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: CUDA_Host compute buffer size = 32.01 MiB Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: graph nodes = 2806 Nov 12 14:48:53 ecs--ai ollama[971307]: llama_new_context_with_model: graph splits = 2 Nov 12 14:48:54 ecs--ai ollama[2300820]: INFO [main] model loaded | tid="139823888588800" timestamp=1731394134 Nov 12 14:48:54 ecs--ai ollama[971307]: time=2024-11-12T14:48:54.888+08:00 level=INFO source=server.go:637 msg="llama runner started in 10.72 seconds" Nov 12 14:48:58 ecs--ai ollama[971307]: [GIN] 2024/11/12 - 14:48:58 | 200 | 14.818108238s | 192.168.2.46 | POST "/api/chat" ``` ![Snipaste_2024-11-12_14-53-40](https://github.com/user-attachments/assets/ad8159ed-5090-4f04-85a1-f37883d890bf)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6696