Removed stop param from unsupported azure models - #15229
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ishaan-jaff
suggested changes
Oct 6, 2025
|
|
||
| return supported_params | ||
|
|
||
| def _supports_stop_reason(self, model: str) -> bool: |
Contributor
There was a problem hiding this comment.
can you not re-use this logic / function in xai/transformation.py
Contributor
Author
There was a problem hiding this comment.
The method in xai/transformation.py will only check for xai models.. but here there might be azure models other than grok which doesn’t stop reason. Thought this might be a cleaner way
ishaan-jaff
reviewed
Oct 7, 2025
| Check if the model supports stop tokens. | ||
| Grok models don't support stop tokens. | ||
| """ | ||
| if "grok-3-mini" in model: |
Contributor
There was a problem hiding this comment.
check if "grok" in model, if it is then re-use Xai method
Contributor
Author
There was a problem hiding this comment.
Yes. makes sense. Updating it
Contributor
Author
There was a problem hiding this comment.
Updated the code as requested
ishaan-jaff
reviewed
Oct 7, 2025
| """ | ||
| if "grok" in model: | ||
| # Reuse Xai method for Grok models | ||
| from litellm.llms.xai.chat.transformation import XAIChatConfig |
Contributor
There was a problem hiding this comment.
please import at the top
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
* Removed stop param from unsupported model * Use better handling for stop method * Use better handling for stop method
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
Removed stop param from unsupported model
Fixes LIT-1187
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-unitType
🐛 Bug Fix
Changes
Added a function which checks if a following model doesn't support stop param, if it doesn't that param is removed from the call.