diff --git a/litellm/main.py b/litellm/main.py index 53b63de1e9e..1eb46410733 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -23,7 +23,7 @@ from collections.abc import AsyncIterator, Callable, Coroutine, Iterable, Mappin from concurrent import futures from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait from copy import deepcopy -from functools import lru_cache, partial +from functools import partial from types import MappingProxyType from typing import TYPE_CHECKING, Any, Final, Literal, Optional, Protocol, Union, cast, get_args @@ -8248,23 +8248,6 @@ async def atranscription( ) -@lru_cache(maxsize=1) -def _bundled_transcription_response_formats() -> Mapping[str, tuple[str, ...]]: - from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap - - catalog: Final = TypeAdapter(dict[str, dict[str, object]]).validate_python( - GetModelCostMap.load_local_model_cost_map() - ) - formats_adapter: Final = TypeAdapter(tuple[str, ...]) - return MappingProxyType( - { - model: formats_adapter.validate_python(entry["supported_transcription_response_formats"]) - for model, entry in catalog.items() - if "supported_transcription_response_formats" in entry - } - ) - - def _validate_gpt_transcription_request( model: str, custom_llm_provider: str, @@ -8275,9 +8258,6 @@ def _validate_gpt_transcription_request( ) -> str | None: model_info: Final = get_model_info(model=model) if model in litellm.model_cost else {} supported_endpoints: Final = model_info.get("supported_endpoints") - supported_formats: Final = model_info.get("supported_transcription_response_formats") or ( - _bundled_transcription_response_formats().get(model) - ) if language is not None and languages is not None: raise litellm.UnsupportedParamsError( message="language and languages cannot be used together", @@ -8290,13 +8270,13 @@ def _validate_gpt_transcription_request( model=model, llm_provider=custom_llm_provider, ) - if supported_formats is not None and response_format is not None and response_format not in supported_formats: + if model == "gpt-transcribe" and response_format not in (None, "json"): raise litellm.UnsupportedParamsError( - message=f"{model} only supports response_format={', '.join(repr(fmt) for fmt in supported_formats)}", + message="gpt-transcribe only supports response_format='json'", model=model, llm_provider=custom_llm_provider, ) - if custom_llm_provider == "azure" and supported_formats is not None: + if custom_llm_provider == "azure" and model == "gpt-transcribe": if api_version in (None, "v1", "latest", "preview"): return litellm.AZURE_DEFAULT_API_VERSION return api_version diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index b2f8636877c..48c83fb891e 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -214,9 +214,6 @@ "/v1/realtime", "/v1/realtime/transcription_sessions" ], - "supported_transcription_response_formats": [ - "json" - ], "supported_modalities": [ "audio", "text" @@ -63374,9 +63371,6 @@ "/v1/audio/transcriptions", "/v1/realtime/transcription_sessions" ], - "supported_transcription_response_formats": [ - "json" - ], "supported_modalities": [ "text", "audio" diff --git a/litellm/types/utils.py b/litellm/types/utils.py index b259c07f63a..a9ef1f04a8e 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -465,7 +465,6 @@ class ModelInfoBase(ProviderSpecificModelInfo, total=False): ] ] supported_endpoints: list[str] | None - supported_transcription_response_formats: ReadOnly[Sequence[str] | None] use_openai_responses_path: bool | None tpm: int | None rpm: int | None diff --git a/litellm/utils.py b/litellm/utils.py index cc6ce19e953..4dfd59540de 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6940,9 +6940,6 @@ def get_model_info_helper( litellm_provider=_model_info.get("litellm_provider", custom_llm_provider), mode=_model_info.get("mode"), supported_endpoints=_model_info.get("supported_endpoints", None), - supported_transcription_response_formats=_model_info.get( - "supported_transcription_response_formats", None - ), supports_system_messages=_model_info.get("supports_system_messages", None), supports_response_schema=_model_info.get("supports_response_schema", None), supports_vision=_model_info.get("supports_vision", None), diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index b2f8636877c..48c83fb891e 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -214,9 +214,6 @@ "/v1/realtime", "/v1/realtime/transcription_sessions" ], - "supported_transcription_response_formats": [ - "json" - ], "supported_modalities": [ "audio", "text" @@ -63374,9 +63371,6 @@ "/v1/audio/transcriptions", "/v1/realtime/transcription_sessions" ], - "supported_transcription_response_formats": [ - "json" - ], "supported_modalities": [ "text", "audio"