-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Add reasoning parameter handling to completion extras transformation #13695
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?
Add reasoning parameter handling to completion extras transformation #13695
Conversation
- Add _handle_reasoning_parameters() method to LiteLLMResponsesTransformationHandler: * Promotes reasoning_effort from extra_body to top-level parameter * Sets default reasoning_effort="medium" for reasoning-capable models * Uses supports_reasoning() to detect reasoning-capable models - Enhance transform_request() to call reasoning parameter handler - Add auto-routing logic in main.py for reasoning-capable models - Add comprehensive test suite for reasoning routing and transformation - Enable reasoning summaries by default for reasoning models
- Rename test_gpt5_reasoning_routing.py -> test_reasoning_routing.py - Move from tests/ to tests/llm_translation/ for better organization - Update class names to be more descriptive: * TestGPT5ReasoningRouting -> TestReasoningRouting * TestTransformationLayerReasoningHandling -> TestReasoningParameterTransformation - Keep all test functionality intact, just better organized
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hi @oabdellatif can you help me understand - what is the issue you are trying to solve here? |
Hi @krrishdholakia, the main goal is to enable reasoning summaries by default for OpenAI models through tools like Aider. There’s no way to configure this currently:
The rationale is that reasoning-capable models should show reasoning summaries by default, and the auto-routing is one way to accomplish that. I can create an issue for further discussion. |
Created #13780 for clarification |
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.
move mock tests inside test_litellm/
to ensure they run on this PR
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.
bump on this? @oabdellatif
Title
Add reasoning parameter handling to completion extras transformation
Relevant issues
N/A
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
Changes
Enhanced
/chat/completions
→litellm.responses()
transformation:_handle_reasoning_parameters()
method toLiteLLMResponsesTransformationHandler
extra_body.reasoning_effort
to top-levelreasoning_effort="medium"
for reasoning-capable models when not providedmain.py
Key benefits:
reasoning_effort
required)