Skip to content

[Question]: When I want to use a deep thinking model, such as R1, how can I print the deep thinking process? #18488

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

Open
1 task done
tiebingice opened this issue Apr 20, 2025 · 1 comment
Labels
question Further information is requested

Comments

@tiebingice
Copy link

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

I make code for llama-index-llms-deepseek,When I want to use a deep thinking model R1, how can I print the deep thinking process?

@tiebingice tiebingice added the question Further information is requested label Apr 20, 2025
Copy link

dosubot bot commented Apr 20, 2025

Hello @tiebingice! I'm Dosu, here to help you solve bugs, answer questions, and navigate your way to becoming a contributor. While you're waiting for a human maintainer, feel free to ask me anything you need assistance with!

To print the deep thinking process when using the deep thinking model R1 in the llama-index-llms-deepseek codebase, you can use the SimpleLLMHandler class. This class includes a function called _print_llm_event that prints the prompt and completion or messages and response based on the payload provided. This function is called within the on_event_end method when the event type is CBEventType.LLM [1].

Additionally, you can configure the SimpleLLMHandler class to provide more detailed output by utilizing the thinking_dict parameter when initializing the model. This allows the model to generate a chain-of-thought response. You can also access the exact thinking process by accessing the thinking attribute in the response's additional_kwargs [2].

To continue talking to Dosu, mention @dosu.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant