-
Notifications
You must be signed in to change notification settings - Fork 2k
Implement CoT no-op for reasoning models #8375
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
base: main
Are you sure you want to change the base?
Conversation
This is AMAZING. Thank you @FireMasterK !! I think we'll need to think (no pun intended) about reasoning models like Qwen3 that expose their reasoning in the string... What does LiteLLM do for that. I guess it says Also I guess we should still return a |
c8b1c4e
to
b4e570b
Compare
I don't think they support telling whether a model displays its CoT or not, which is unfortunate. It also seems like LiteLLM doesn't have enough mappings for reasoning models (eg. Qwen3 models are not there), which means we can't solely rely on LiteLLM telling if a model supports reasoning or not.
Yes, but some model providers providers summarize the CoT, what should we do about these? I have added the parsing of |
b4e570b
to
2181050
Compare
@@ -27,15 +28,42 @@ def __init__( | |||
""" | |||
super().__init__() | |||
signature = ensure_signature(signature) | |||
self.predict_reasoning = dspy.Predict(signature, **config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this field causes a few tests to fail, any idea on how I could fix these:
FAILED tests/teleprompt/test_copro_optimizer.py::test_signature_optimizer_optimization_process - dspy.utils.exceptions.AdapterParseError: LM response cannot be serialized to a JSON object.
FAILED tests/teleprompt/test_copro_optimizer.py::test_signature_optimizer_statistics_tracking - dspy.utils.exceptions.AdapterParseError: LM response cannot be serialized to a JSON object.
FAILED tests/teleprompt/test_copro_optimizer.py::test_optimization_and_output_verification - dspy.utils.exceptions.AdapterParseError: LM response cannot be serialized to a JSON object.
FAILED tests/teleprompt/test_copro_optimizer.py::test_statistics_tracking_during_optimization - dspy.utils.exceptions.AdapterParseError: LM response cannot be serialized to a JSON object.
2181050
to
a6fd573
Compare
litellm.supports_reasoning
.Additional context: https://x.com/DSPyOSS/status/1931886536221724848