Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I modified the key for silicon-based flow, and as a result, an error occurred. #11844

Closed
5 tasks done
wurenxiaozu opened this issue Dec 19, 2024 · 8 comments
Closed
5 tasks done
Labels
🐞 bug Something isn't working

Comments

@wurenxiaozu
Copy link

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.14.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

nginx log:
101.47.14.176 - - [19/Dec/2024:11:24:55 +0000] "POST /console/api/workspaces/current/model-providers/siliconflow HTTP/1.1" 400 106 "https://aitrain.uat.bloomage.com/apps" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" "-"

I removed the original key and intended to replace it with a new one. The removal was successful, but I am unable to add the new key.

✔️ Expected Behavior

To resolve this issue.

❌ Actual Behavior

I removed the original key and intended to replace it with a new one. The removal was successful, but I am unable to add the new key.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 19, 2024
Copy link

dosubot bot commented Dec 19, 2024

To resolve the "Credentials validation failed with status code 403" error when adding a new API key for SiliconFlow in your self-hosted Dify version 0.14.1 setup, ensure the following:

  1. Correct API Key: Double-check that the API key you are entering is correct and has not expired.

  2. Necessary Permissions: Verify that the API key has the necessary permissions to access the SiliconFlow API. This might involve checking with the provider of the API key to ensure it is configured correctly.

  3. Network Access: Ensure there are no network issues or restrictions that might be preventing access to the SiliconFlow API endpoint. This includes checking firewall settings or any proxy configurations that might be in place.

The error indicates that the API key might be invalid or lacks the required access rights. The validation process involves sending a GET request to https://api.siliconflow.cn/v1/models with the API key included in the authorization header. A status code other than 200 will trigger a ToolProviderCredentialValidationError [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@wurenxiaozu
Copy link
Author

I am certain that the key is not at fault and it can be used normally.

curl --request POST \

--url https://api.siliconflow.cn/v1/chat/completions
--header 'Authorization: Bearer sk-uihjunjsldlgvcjdvhacktatqqrlt*****************'
--header 'Content-Type: application/json'
--data '{
"model": "deepseek-ai/deepseek-vl2",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.png",
"detail": "auto"
}
}
]
}
],
"stream": false,
"max_tokens": 512,
"stop": [
"null"
],
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1,
"response_format": {
"type": "text"
}
}'
{"id":"0193deb5e39125e3350779d69fed3195","object":"chat.completion","created":1734608282,"model":"deepseek-ai/deepseek-vl2","choices":[{"index":0,"message":{"role":"assistant","content":"What breed of dog is this?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":2024,"completion_tokens":7,"total_tokens":2031},"system_fingerprint":""}

@wurenxiaozu
Copy link
Author

image
image
I tried adding the models one by one manually, and it worked unexpectedly. However, setting the key for the entire setup still fails.

yihong0618 added a commit to yihong0618/dify that referenced this issue Dec 19, 2024
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618
Copy link
Contributor

yihong0618 commented Dec 19, 2024

fixed
#11847

jiangbo721 pushed a commit to jiangbo721/dify that referenced this issue Dec 20, 2024
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@JiXia830
Copy link

JiXia830 commented Jan 9, 2025

have you ever solved it?
i have the same problem

@yihong0618
Copy link
Contributor

have you ever solved it? i have the same problem

yes update your version is fine

@JiXia830
Copy link

JiXia830 commented Jan 9, 2025

have you ever solved it? i have the same problem

yes update your version is fine

佬,是更新dify版本就可以了吗?我是docker部署的dify,硅基流动模型供应商的apikey设置报错和您一样,但是我添加硅基流动部分模型又比较顺利

@yihong0618
Copy link
Contributor

have you ever solved it? i have the same problem

yes update your version is fine

佬,是更新dify版本就可以了吗?我是docker部署的dify,硅基流动模型供应商的apikey设置报错和您一样,但是我添加硅基流动部分模型又比较顺利

just update the code from that commit and restart docker is also fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants