Skip to content

Removed stop param from unsupported azure models - #15229

Merged
ishaan-jaff merged 3 commits into
mainfrom
litellm_azure_grok_stop_param_removal
Oct 7, 2025
Merged

ishaan-jaff merged 3 commits into
mainfrom
litellm_azure_grok_stop_param_removal

Conversation

@Sameerlite

@Sameerlite Sameerlite commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

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

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 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.

image

@vercel

vercel Bot commented Oct 6, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Oct 7, 2025 2:54am

@Sameerlite Sameerlite changed the title Removed stop param from unsupported model Removed stop param from unsupported azure models Oct 6, 2025

@ishaan-jaff ishaan-jaff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed


return supported_params

def _supports_stop_reason(self, model: str) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not re-use this logic / function in xai/transformation.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Sameerlite
Sameerlite requested a review from ishaan-jaff October 6, 2025 23:40
Check if the model supports stop tokens.
Grok models don't support stop tokens.
"""
if "grok-3-mini" in model:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if "grok" in model, if it is then re-use Xai method

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. makes sense. Updating it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the code as requested

"""
if "grok" in model:
# Reuse Xai method for Grok models
from litellm.llms.xai.chat.transformation import XAIChatConfig

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please import at the top

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup fixed

@ishaan-jaff ishaan-jaff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ishaan-jaff
ishaan-jaff merged commit 8d7f397 into main Oct 7, 2025
11 of 42 checks passed
@ishaan-berri
ishaan-berri deleted the litellm_azure_grok_stop_param_removal branch March 26, 2026 21:51
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

1 active deployment
Preview — d793fd8a Deployed Oct 7, 2025 by vercel[bot]
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