mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-17 14:48:44 +00:00
fix(translation): azure family detection uses v1's truthiness base_model-or-model (critic-azure M1, verifier-azure S1)
detection_model kept an empty-string base_model, so base_model: '' in a deployment's litellm_params disabled the o-series/gpt-5 family and response_format gates (fail-open: v2 served max_tokens where v1 routes AzureOpenAIO1Config and emits max_completion_tokens). One-token fix to 'deps.base_model or model'; the docstring's 'exactly like v1' claim is now true. Pinning corpus row uses base_model='' with the non-prefix family substring deployment name prod-o3-mini per verifier-azure (the shared openai prefix gate cannot catch it); row fails without the fix.
This commit is contained in:
@@ -30,7 +30,10 @@ _RESPONSE_FORMAT_SUPPORTED_MONTH = 8
|
||||
|
||||
|
||||
def detection_model(model: str, deps: TranslationDeps) -> str:
|
||||
return deps.base_model if deps.base_model is not None else model
|
||||
# v1 is truthiness, not None-ness (azure.py:246 `base_model or model`):
|
||||
# base_model: "" in a config must fall to the deployment name, or the
|
||||
# family/response_format gates fail OPEN (verifier-azure S1).
|
||||
return deps.base_model or model
|
||||
|
||||
|
||||
def unsupported_model_family(model: str, deps: TranslationDeps) -> str | None:
|
||||
|
||||
@@ -285,6 +285,23 @@ EXPECTED_FALLBACKS = {
|
||||
"o1-mini",
|
||||
"AzureOpenAIO1Config",
|
||||
),
|
||||
"o_series_empty_base_model_falls_to_deployment": (
|
||||
# base_model: "" (a one-character YAML slip) must behave like v1's
|
||||
# `base_model or model`: detection falls to the deployment name,
|
||||
# whose NON-PREFIX o3 substring only azure's substring predicate
|
||||
# catches (the shared openai prefix gate misses it). Proven divergent
|
||||
# before the fix: v2 served max_tokens while v1 routed
|
||||
# AzureOpenAIO1Config and emitted max_completion_tokens
|
||||
# (verifier-azure S1).
|
||||
{
|
||||
"model": "prod-o3-mini",
|
||||
"max_tokens": 100,
|
||||
"messages": [{"role": "user", "content": "hi"}],
|
||||
},
|
||||
DEFAULT_API_VERSION,
|
||||
"",
|
||||
"AzureOpenAIO1Config",
|
||||
),
|
||||
"gpt5_model": (
|
||||
{"model": "gpt-5", "messages": [{"role": "user", "content": "hi"}]},
|
||||
DEFAULT_API_VERSION,
|
||||
|
||||
Reference in New Issue
Block a user