litellm - 💡(How to fix) Fix fix(openai_gpt_5): support custom deployment names with prefixes in is_model_gpt_5_4_plus_model [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

When using customized deployment names for OpenAI/Azure GPT-5 models (such as azure/something-something-gpt-5.5 or my-prefix-gpt-5.4), LiteLLM fails to route requests through the Responses API Bridge. This results in a validation error from OpenAI/Azure completions endpoints when utilizing tools with reasoning_effort enabled (e.g., high, medium, low):

Root Cause

Root Cause

In litellm/llms/openai/chat/gpt_5_transformation.py, the is_model_gpt_5_4_plus_model helper is used to identify whether a model is GPT-5.4 or newer to decide if bridging is necessary. However, it strictly enforces that the model name starts with "gpt-5.":

Fix Action

Fixed

Code Example

@classmethod
    def is_model_gpt_5_4_plus_model(cls, model: str) -> bool:
        """Check if the model is gpt-5.4 or newer (5.4, 5.5, 5.6, etc., including pro)."""
        model_name = model.split("/")[-1]
        if not model_name.startswith("gpt-5."): # <--- Fails for customized prefixes like "something-something-gpt-5.5"
            return False
        # ... version checks

---

@classmethod
    def is_model_gpt_5_4_plus_model(cls, model: str) -> bool:
        """Check if the model is gpt-5.4 or newer (5.4, 5.5, 5.6, etc., including pro)."""
        model_name = model.split("/")[-1]
        
        # Extract the model version if it is preceded by a custom deployment prefix
        if "gpt-5." in model_name and not model_name.startswith("gpt-5."):
            idx = model_name.find("gpt-5.")
            model_name = model_name[idx:]
            
        if not model_name.startswith("gpt-5."):
            return False
        try:
            version_str = model_name.replace("gpt-5.", "").split("-")[0]
            major = version_str.split(".")[0]
            return int(major) >= 4
        except (ValueError, IndexError):
            return False
RAW_BUFFERClick to expand / collapse

Description:

Problem

When using customized deployment names for OpenAI/Azure GPT-5 models (such as azure/something-something-gpt-5.5 or my-prefix-gpt-5.4), LiteLLM fails to route requests through the Responses API Bridge. This results in a validation error from OpenAI/Azure completions endpoints when utilizing tools with reasoning_effort enabled (e.g., high, medium, low):

Function tools with reasoning_effort are not supported for something-something-gpt-5.5 in /v1/chat/completion

Root Cause

In litellm/llms/openai/chat/gpt_5_transformation.py, the is_model_gpt_5_4_plus_model helper is used to identify whether a model is GPT-5.4 or newer to decide if bridging is necessary. However, it strictly enforces that the model name starts with "gpt-5.":

    @classmethod
    def is_model_gpt_5_4_plus_model(cls, model: str) -> bool:
        """Check if the model is gpt-5.4 or newer (5.4, 5.5, 5.6, etc., including pro)."""
        model_name = model.split("/")[-1]
        if not model_name.startswith("gpt-5."): # <--- Fails for customized prefixes like "something-something-gpt-5.5"
            return False
        # ... version checks

Since customized Azure deployment names often have prefixes, this check returns False even if the underlying model is indeed gpt-5.5 or gpt-5.4.

Suggested Fix

Enhance is_model_gpt_5_4_plus_model to search for "gpt-5." inside the model name. If found, it should strip any custom prefix to isolate the base model name before running the starts-with and major-version validation checks.

    @classmethod
    def is_model_gpt_5_4_plus_model(cls, model: str) -> bool:
        """Check if the model is gpt-5.4 or newer (5.4, 5.5, 5.6, etc., including pro)."""
        model_name = model.split("/")[-1]
        
        # Extract the model version if it is preceded by a custom deployment prefix
        if "gpt-5." in model_name and not model_name.startswith("gpt-5."):
            idx = model_name.find("gpt-5.")
            model_name = model_name[idx:]
            
        if not model_name.startswith("gpt-5."):
            return False
        try:
            version_str = model_name.replace("gpt-5.", "").split("-")[0]
            major = version_str.split(".")[0]
            return int(major) >= 4
        except (ValueError, IndexError):
            return False

This ensures that any prefixed deployment containing gpt-5.4+ or gpt-5.5+ is correctly recognized and seamlessly routed through the Responses API Bridge.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING