[GH-ISSUE #35] 使用最新分支时deepseek使用AiHubMix供应商无法获取推理内容 #24

Open
opened 2026-02-27 01:55:52 +03:00 by kerem · 19 comments
Owner

Originally created by @wydyydlhb1990 on GitHub (Feb 17, 2025).
Original GitHub issue: https://github.com/ErlichLiu/DeepClaude/issues/35

Image

将下面env 参数设成false也没有返回推理内容

IS_ORIGIN_REASONING=false

我是用的Cherry Studio, 配置一切都OK没有报错

Originally created by @wydyydlhb1990 on GitHub (Feb 17, 2025). Original GitHub issue: https://github.com/ErlichLiu/DeepClaude/issues/35 <img width="551" alt="Image" src="https://github.com/user-attachments/assets/3eeb2106-e3e7-42f8-8355-4539a021a3a8" /> 将下面env 参数设成false也没有返回推理内容 IS_ORIGIN_REASONING=false 我是用的Cherry Studio, 配置一切都OK没有报错
Author
Owner

@GowayLee commented on GitHub (Feb 17, 2025):

有可能是模型本身就没有思考.

尝试抓包一下响应流看看是不是:

<think></think>
xxxxxxxx(Answer)
<!-- gh-comment-id:2661773302 --> @GowayLee commented on GitHub (Feb 17, 2025): 有可能是模型本身就没有思考. 尝试抓包一下响应流看看是不是: ``` <think></think> xxxxxxxx(Answer) ```
Author
Owner

@wydyydlhb1990 commented on GitHub (Feb 17, 2025):

我把抓包内容丢给了Claude,回答如下
Based on the packet capture, here's what's happening:

Your request to the server is successful and being processed (200 OK response)
The server is streaming back a response in chunks
There's an error message in Chinese: "获取推理内容失败" (Failed to get reasoning content)
Despite the error, Claude still manages to provide a fallback response about testing

The issue seems to be with the server's reasoning/inference system rather than the network connection or protocol implementation. The server is functioning and communicating properly, but there appears to be an internal error when trying to generate the content.
To fix this, you should:

Check your server's model initialization and inference pipeline
Verify any required model files or resources are properly loaded
Look at your server logs for more detailed error messages
Make sure you have sufficient memory/resources for model inference

我试着在Cherry Studio里调用aihubmix-DeepSeek-R1,回应没有任何问题,所以我在想是不是deepclaude现有的env setup 不适用处理别的非官方DS

<!-- gh-comment-id:2663917038 --> @wydyydlhb1990 commented on GitHub (Feb 17, 2025): 我把抓包内容丢给了Claude,回答如下 Based on the packet capture, here's what's happening: Your request to the server is successful and being processed (200 OK response) The server is streaming back a response in chunks There's an error message in Chinese: "获取推理内容失败" (Failed to get reasoning content) Despite the error, Claude still manages to provide a fallback response about testing The issue seems to be with the server's reasoning/inference system rather than the network connection or protocol implementation. The server is functioning and communicating properly, but there appears to be an internal error when trying to generate the content. To fix this, you should: Check your server's model initialization and inference pipeline Verify any required model files or resources are properly loaded Look at your server logs for more detailed error messages Make sure you have sufficient memory/resources for model inference 我试着在Cherry Studio里调用aihubmix-DeepSeek-R1,回应没有任何问题,所以我在想是不是deepclaude现有的env setup 不适用处理别的非官方DS
Author
Owner

@ErlichLiu commented on GitHub (Feb 18, 2025):

@wydyydlhb1990 补充一点细节呢,你两段都用的 aihubmix 的嘛?然后模型名称里也是按照 aihubmix 的要求来填写的嘛。放一点你的 .env 的配置(不要放真实的 apikey)以及 aihubmax 的的文档看看。

<!-- gh-comment-id:2664465480 --> @ErlichLiu commented on GitHub (Feb 18, 2025): @wydyydlhb1990 补充一点细节呢,你两段都用的 aihubmix 的嘛?然后模型名称里也是按照 aihubmix 的要求来填写的嘛。放一点你的 .env 的配置(不要放真实的 apikey)以及 aihubmax 的的文档看看。
Author
Owner

@wydyydlhb1990 commented on GitHub (Feb 18, 2025):

@wydyydlhb1990 补充一点细节呢,你两段都用的 aihubmix 的嘛?然后模型名称里也是按照 aihubmix 的要求来填写的嘛。放一点你的 .env 的配置(不要放真实的 apikey)以及 aihubmax 的的文档看看。

是的,配置应该是没有问题
env.txt

aihubmax 文档 -》 https://doc.aihubmix.com/coding/如何调用本站非OpenAI模型

<!-- gh-comment-id:2664539626 --> @wydyydlhb1990 commented on GitHub (Feb 18, 2025): > [@wydyydlhb1990](https://github.com/wydyydlhb1990) 补充一点细节呢,你两段都用的 aihubmix 的嘛?然后模型名称里也是按照 aihubmix 的要求来填写的嘛。放一点你的 .env 的配置(不要放真实的 apikey)以及 aihubmax 的的文档看看。 是的,配置应该是没有问题 [env.txt](https://github.com/user-attachments/files/18838673/env.txt) aihubmax 文档 -》 https://doc.aihubmix.com/coding/如何调用本站非OpenAI模型
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

加一 我也是一样的问题
如果是在dify中,它不会验证通过

Image
<!-- gh-comment-id:2664551085 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): 加一 我也是一样的问题 如果是在dify中,它不会验证通过 <img width="969" alt="Image" src="https://github.com/user-attachments/assets/9e83b706-4b4c-476d-89ef-55ecd9b84e4d" />
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

有时也会报DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误

Image 但是在apifox api调试工具是正常的 可以获取到正确的content的内容
<!-- gh-comment-id:2664569928 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): 有时也会报DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误 <img width="1024" alt="Image" src="https://github.com/user-attachments/assets/ca4180d4-8f2d-45d4-8827-d1a42d3d25de" /> 但是在apifox api调试工具是正常的 可以获取到正确的content的内容
Author
Owner

@ErlichLiu commented on GitHub (Feb 18, 2025):

@wydyydlhb1990 @DeepLifeStudio 两位加一下我的微信,我远程看看呢。微信:geekthings

<!-- gh-comment-id:2664589711 --> @ErlichLiu commented on GitHub (Feb 18, 2025): @wydyydlhb1990 @DeepLifeStudio 两位加一下我的微信,我远程看看呢。微信:geekthings
Author
Owner

@GowayLee commented on GitHub (Feb 18, 2025):

Since I haven't installed Chinese input method on my Linux laptop. So, I have to comment in English. fei chang bao qian.

I have collected response examples of different types of Deepseek R1 model in AiHubMix

Image

Problem Reasoning

1. deepseek-reasoner DeepSeek-R1

Using original reasoning format (field reasoning_content and field content), can output reasoning content stably. Should work well with DeepCalude

Image

2. aihubmix-DeepSeek-R1 deepseek-ai/DeepSeek-R1

Using old, unoriginal reasoning format (<think></think> tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning"
Image

The sick output looks like this, there has no content between <think> and </think>
Image

This causes uncaught reasoning content problem in DeepClaude.

Solution

1. Change to use original models like deepseek-reasoner DeepSeek-R1

2. Add extra prompts in DeepClaude side to force the model to perform reasoning, like what is said in official doc. And use an environment variable FORCE_REASONING to control whether enable this feature or not. However, due to randomness, this method may still fail.

Personally, I am for the second solution, this feature can make more R1 models perform well on DeepClaude.

<!-- gh-comment-id:2664753653 --> @GowayLee commented on GitHub (Feb 18, 2025): > _**Since I haven't installed Chinese input method on my Linux laptop. So, I have to comment in English. fei chang bao qian.**_ I have collected response examples of different types of `Deepseek R1` model in `AiHubMix` ![Image](https://github.com/user-attachments/assets/841318ba-ce0f-4ed4-8239-0e153728cd36) ## Problem Reasoning ### 1. `deepseek-reasoner` `DeepSeek-R1` Using original reasoning format (field `reasoning_content` and field `content`), can output reasoning content stably. Should work well with DeepCalude ![Image](https://github.com/user-attachments/assets/fb6eb456-6e50-4fea-91a0-bf3da0b687e8) ### 2. `aihubmix-DeepSeek-R1` `deepseek-ai/DeepSeek-R1` Using old, unoriginal reasoning format (`<think></think>` tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning" ![Image](https://github.com/user-attachments/assets/6a16336d-e95d-4e9f-9b66-78f77c73b60c) The sick output looks like this, there has no content between `<think>` and `</think>` ![Image](https://github.com/user-attachments/assets/a77ccf1b-bbc8-4fb4-9d0d-505b1d55dede) This causes uncaught reasoning content problem in DeepClaude. ## Solution #### 1. Change to use original models like `deepseek-reasoner` `DeepSeek-R1` #### 2. Add extra prompts in DeepClaude side to force the model to perform reasoning, like what is said in official doc. And use an environment variable `FORCE_REASONING` to control whether enable this feature or not. However, due to randomness, this method may still fail. Personally, I am for the second solution, this feature can make more R1 models perform well on DeepClaude.
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

我使用的模型是DeepSeek-R1,用的就是原始格式,DeepClaude在API调试工具是可以正常输出结果的,但是如果用在CherryStudio偶尔是不能正常输出content内容的,哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误,对于Dify更是无法验证通过会报如下错误:Credentials validation failed: JSON decode error

<!-- gh-comment-id:2664826800 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): 我使用的模型是DeepSeek-R1,用的就是原始格式,DeepClaude在API调试工具是可以正常输出结果的,但是如果用在CherryStudio偶尔是不能正常输出content内容的,哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误,对于Dify更是无法验证通过会报如下错误:Credentials validation failed: JSON decode error
Author
Owner

@GowayLee commented on GitHub (Feb 18, 2025):

I tested DeepSeek-R1 model on AiHubMix, it works well in DeepClaude

Image

Image

Image


哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误

As for this issue, I will do further check.

<!-- gh-comment-id:2664895386 --> @GowayLee commented on GitHub (Feb 18, 2025): I tested `DeepSeek-R1` model on `AiHubMix`, it works well in DeepClaude ![Image](https://github.com/user-attachments/assets/97d0d03b-b316-41f7-bd5a-e96c896ce483) ![Image](https://github.com/user-attachments/assets/9244d9c2-a264-4a74-915c-aaa30e3b5556) ![Image](https://github.com/user-attachments/assets/19b3cfea-d6ab-4566-9795-4f833bfd7549) --- > 哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误 As for this issue, I will do further check.
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

请问你是否能在dify的设置里面也测试一下?

Image 我用的是docker-compose版,可能是这个版本并非是最新版的原因?
<!-- gh-comment-id:2664917503 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): 请问你是否能在dify的设置里面也测试一下? <img width="1512" alt="Image" src="https://github.com/user-attachments/assets/07f0cce1-9907-4311-859e-1a8382a6b502" /> 我用的是docker-compose版,可能是这个版本并非是最新版的原因?
Author
Owner

@GowayLee commented on GitHub (Feb 18, 2025):

请问你是否能在dify的设置里面也测试一下?

可以提供dify中出现错误的详情吗,前面的讨论记录有些混乱,不好确定问题😢

<!-- gh-comment-id:2664979740 --> @GowayLee commented on GitHub (Feb 18, 2025): > 请问你是否能在dify的设置里面也测试一下? 可以提供dify中出现错误的详情吗,前面的讨论记录有些混乱,不好确定问题😢
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

dify的问题出现在验证过程中,报错为Credentials validation failed: JSON decode error

<!-- gh-comment-id:2664985024 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): dify的问题出现在验证过程中,报错为Credentials validation failed: JSON decode error
Author
Owner

@akakenle commented on GitHub (Feb 18, 2025):

Aihubmix对claude模型支持Claude原始api接口,推荐这样设置;本地实测共可以完美运行

Image
<!-- gh-comment-id:2665624591 --> @akakenle commented on GitHub (Feb 18, 2025): Aihubmix对claude模型支持Claude原始api接口,推荐这样设置;本地实测共可以完美运行 <img width="1083" alt="Image" src="https://github.com/user-attachments/assets/55b8c6d1-6930-416b-b55b-d6f1cc671813" />
Author
Owner

@DeepLifeStudio commented on GitHub (Feb 18, 2025):

已解决 对于aihubmix
API URL要用anthropic格式,而不是兼容openai的格式,尽管它同样也支持openai格式,但是在deepclaude是例外。
尽管如此它还是不能通过dify的验证,考虑下是否是deepclaude的API格式问题

<!-- gh-comment-id:2665680433 --> @DeepLifeStudio commented on GitHub (Feb 18, 2025): 已解决 对于aihubmix API URL要用anthropic格式,而不是兼容openai的格式,尽管它同样也支持openai格式,但是在deepclaude是例外。 尽管如此它还是不能通过dify的验证,考虑下是否是deepclaude的API格式问题
Author
Owner

@wydyydlhb1990 commented on GitHub (Feb 18, 2025):

I tested DeepSeek-R1 model on AiHubMix, it works well in DeepClaude

Image

Image

Image

哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误

As for this issue, I will do further check.

我把env 改成和你一样

Image

但还是有问题

Image
<!-- gh-comment-id:2667121517 --> @wydyydlhb1990 commented on GitHub (Feb 18, 2025): > I tested `DeepSeek-R1` model on `AiHubMix`, it works well in DeepClaude > > ![Image](https://github.com/user-attachments/assets/97d0d03b-b316-41f7-bd5a-e96c896ce483) > > ![Image](https://github.com/user-attachments/assets/9244d9c2-a264-4a74-915c-aaa30e3b5556) > > ![Image](https://github.com/user-attachments/assets/19b3cfea-d6ab-4566-9795-4f833bfd7549) > > > 哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误 > > As for this issue, I will do further check. 我把env 改成和你一样 <img width="1034" alt="Image" src="https://github.com/user-attachments/assets/c1498f53-e2e9-4dcb-9a74-88c48f5d99ad" /> 但还是有问题 <img width="551" alt="Image" src="https://github.com/user-attachments/assets/b73cea27-63ac-4427-b368-d7c0f0fcd5fa" />
Author
Owner

@akakenle commented on GitHub (Feb 19, 2025):

I tested DeepSeek-R1 model on AiHubMix, it works well in DeepClaude
Image
Image
Image

哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误

As for this issue, I will do further check.

我把env 改成和你一样

Image 但还是有问题 Image

你这个日志显示已经成功了,只是没有获取到deepseek模型返回到推理内容了;这个是因为现在deepseek模型的api很不稳定;能单独返回推理字段的在aihubmix上有这两个:deepseek-ai/DeepSeek-R1 和deepseek-reasoner ;但是都不是很稳定;

<!-- gh-comment-id:2667347191 --> @akakenle commented on GitHub (Feb 19, 2025): > > I tested `DeepSeek-R1` model on `AiHubMix`, it works well in DeepClaude > > ![Image](https://github.com/user-attachments/assets/97d0d03b-b316-41f7-bd5a-e96c896ce483) > > ![Image](https://github.com/user-attachments/assets/9244d9c2-a264-4a74-915c-aaa30e3b5556) > > ![Image](https://github.com/user-attachments/assets/19b3cfea-d6ab-4566-9795-4f833bfd7549) > > > 哪怕是正常输出内容也会报2025-02-18 07:33:15 - DeepClaude - ERROR - 处理 Claude 流时发生错误: list index out of range错误 > > > > > > As for this issue, I will do further check. > > 我把env 改成和你一样 > > <img alt="Image" width="1034" src="https://private-user-images.githubusercontent.com/96454449/414481589-c1498f53-e2e9-4dcb-9a74-88c48f5d99ad.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzEzOTYsIm5iZiI6MTczOTkzMTA5NiwicGF0aCI6Ii85NjQ1NDQ0OS80MTQ0ODE1ODktYzE0OThmNTMtZTJlOS00ZGNiLTlhNzQtODhjNDhmNWQ5OWFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyMTEzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5ZTE1NWY0NzFlYWNhZTczZDlmYTFhNzQyY2JkYWI5Yzg4YjdkMTVkODY3MGM3Y2MyMjEzZWQwZGI5ZjVhYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Ag3GR5x7xvx3pr6Kmm9Tg3s7KSYCb6vHzKFAexFqQ_o"> > 但还是有问题 > > <img alt="Image" width="551" src="https://private-user-images.githubusercontent.com/96454449/414480753-b73cea27-63ac-4427-b368-d7c0f0fcd5fa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzEzOTYsIm5iZiI6MTczOTkzMTA5NiwicGF0aCI6Ii85NjQ1NDQ0OS80MTQ0ODA3NTMtYjczY2VhMjctNjNhYy00NDI3LWIzNjgtZDdjMGYwZmNkNWZhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyMTEzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwZjZmNmYxYzNmODFiYTczN2ViYWQxMzI3MThkY2I1ZWM2MWFmNDZjNTEwYzAxYzY3NGQ4YmZlYjhkMjI4Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LeVmJtg9Mtaemx0uRX-LrHDbgvpX1-oP0u_tZ0KI6gg"> 你这个日志显示已经成功了,只是没有获取到deepseek模型返回到推理内容了;这个是因为现在deepseek模型的api很不稳定;能单独返回推理字段的在aihubmix上有这两个:deepseek-ai/DeepSeek-R1 和deepseek-reasoner ;但是都不是很稳定;
Author
Owner

@GowayLee commented on GitHub (Feb 19, 2025):

我把env 改成和你一样
但还是有问题

@wydyydlhb1990 日志显示你使用的仍然是非原生推理格式返回的aihubmix-DeepSeek-R1, 该模型对于一些prompt情景不会进行推理.

Image

2. aihubmix-DeepSeek-R1 deepseek-ai/DeepSeek-R1

Using old, unoriginal reasoning format (<think></think> tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning"

尝试重新设置env, 确保使用了正确的模型.

<!-- gh-comment-id:2667363050 --> @GowayLee commented on GitHub (Feb 19, 2025): > 我把env 改成和你一样 > 但还是有问题 @wydyydlhb1990 日志显示你使用的仍然是非原生推理格式返回的`aihubmix-DeepSeek-R1`, 该模型对于一些prompt情景不会进行推理. ![Image](https://github.com/user-attachments/assets/33f7bf5b-d6e0-4e1d-8642-54ed065fb713) > ### 2. `aihubmix-DeepSeek-R1` `deepseek-ai/DeepSeek-R1` > Using old, unoriginal reasoning format (`<think></think>` tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning" 尝试重新设置env, 确保使用了正确的模型.
Author
Owner

@wydyydlhb1990 commented on GitHub (Feb 20, 2025):

我把env 改成和你一样
但还是有问题

@wydyydlhb1990 日志显示你使用的仍然是非原生推理格式返回的aihubmix-DeepSeek-R1, 该模型对于一些prompt情景不会进行推理.

Image

2. aihubmix-DeepSeek-R1 deepseek-ai/DeepSeek-R1

Using old, unoriginal reasoning format (<think></think> tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning"

尝试重新设置env, 确保使用了正确的模型.

谢谢已解决,重新设置env还不够,得再重设程序。

<!-- gh-comment-id:2670233325 --> @wydyydlhb1990 commented on GitHub (Feb 20, 2025): > > 我把env 改成和你一样 > > 但还是有问题 > > [@wydyydlhb1990](https://github.com/wydyydlhb1990) 日志显示你使用的仍然是非原生推理格式返回的`aihubmix-DeepSeek-R1`, 该模型对于一些prompt情景不会进行推理. > > ![Image](https://github.com/user-attachments/assets/33f7bf5b-d6e0-4e1d-8642-54ed065fb713) > > > ### 2. `aihubmix-DeepSeek-R1` `deepseek-ai/DeepSeek-R1` > > Using old, unoriginal reasoning format (`<think></think>` tags). May skip reasoning for some prompts. The official doc also mentions this point: users may need to "ask the model to perform reasoning" > > 尝试重新设置env, 确保使用了正确的模型. 谢谢已解决,重新设置env还不够,得再重设程序。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DeepClaude#24
No description provided.