Merge pull request #22895 from BerriAI/litellm_o-series-generalize-detection

fix(o-series): generalize is_model_o_series_model to match any o+digit prefix
This commit is contained in:
Sameer Kankute 2026-03-06 09:14:57 +05:30 committed by GitHub
commit bc481f49d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,7 +131,10 @@ class OpenAIOSeriesConfig(OpenAIGPTConfig):
def is_model_o_series_model(self, model: str) -> bool:
model = model.split("/")[-1] # could be "openai/o3" or "o3"
return model.startswith(("o1", "o3", "o4")) and model in litellm.open_ai_chat_completion_models
return (
len(model) > 1 and model[0] == "o" and model[1].isdigit()
and model in litellm.open_ai_chat_completion_models
)
@overload
def _transform_messages(