Skip to content

support reasoning_content field in reasoning model api like deepseek-r1#150

Closed
runningmaverick wants to merge 2 commits intomadox2:mainfrom
runningmaverick:main
Closed

support reasoning_content field in reasoning model api like deepseek-r1#150
runningmaverick wants to merge 2 commits intomadox2:mainfrom
runningmaverick:main

Conversation

@runningmaverick
Copy link
Contributor

No description provided.

@juodumas
Copy link
Contributor

juodumas commented Mar 6, 2025

One issue with this is that it would send the reasoning content back to the model which is undesirable.
I think one option is to ignore the reasoning content, but then the user does not see any activity until the model stops thinking. Another option is to add a <<< thinking section which is not sent back to the model on the next turn.

I am testing a <<< thinking section here juodumas-forks@b51b6a3

I didn't create a PR yet because I am not sure how many API providers use the reasoning_content field?

@runningmaverick
Copy link
Contributor Author

One issue with this is that it would send the reasoning content back to the model which is undesirable. I think one option is to ignore the reasoning content, but then the user does not see any activity until the model stops thinking. Another option is to add a <<< thinking section which is not sent back to the model on the next turn.

I am testing a <<< thinking section here juodumas-forks@b51b6a3

I didn't create a PR yet because I am not sure how many API providers use the reasoning_content field?

👍 Your solution is better. As to the API providers' support, I think we can not wait for OAI to provide it.

@juodumas
Copy link
Contributor

juodumas commented Mar 7, 2025

Agree that there is no need to wait for OAI, but so far I have not found any other provider besides deepseek using the reasoning_content field.

For example with Qwen/QwQ-32B, togetherai & groq simply return <think>...</think> in the content field.

So as the first step maybe you could slightly modify your PR to ignore reasoning_content but keep support for content: null because it is valid according to OAI and that's what is breaking deepseek-r1 with vim-ai. Of course I am not the maintainer, just thinking out loud :)

@juodumas
Copy link
Contributor

juodumas commented Mar 7, 2025

I've found that sglang, vllm, llama.cpp all use the same reasoning_content field and opened the PR for vim-ai: #151

@runningmaverick
Copy link
Contributor Author

I've found that sglang, vllm, llama.cpp all use the same reasoning_content field and opened the PR for vim-ai: #151

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants