diff --git a/ci_cd/generate_model_prices_schema.py b/ci_cd/generate_model_prices_schema.py index 06971107200..8eec07dadda 100644 --- a/ci_cd/generate_model_prices_schema.py +++ b/ci_cd/generate_model_prices_schema.py @@ -116,11 +116,6 @@ ARRAY_KEYS: dict[str, JsonSchema] = { "description": "OpenAI-style API routes this model can be called through, e.g. /v1/chat/completions.", "items": STRING, }, - "supported_transcription_response_formats": { - "type": "array", - "description": "Response formats accepted by the model for file transcription.", - "items": STRING, - }, "supported_modalities": { "type": "array", "description": "Input modalities the model accepts.", diff --git a/litellm/main.py b/litellm/main.py index a9ba9fc2455..ad2ea8c5c77 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 from urllib.parse import urlsplit @@ -39,7 +39,7 @@ import httpx import openai from openai import AsyncStream, Stream from openai.types.audio import TranscriptionStreamEvent -from pydantic import BaseModel, TypeAdapter +from pydantic import BaseModel from typing_extensions import overload import litellm @@ -7871,23 +7871,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, @@ -7898,9 +7881,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", @@ -7913,13 +7893,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 5fa391fc23d..83525938f23 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" @@ -57558,9 +57555,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 0846209e749..6667e2ee400 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -396,7 +396,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 9b4a64eb3c4..ba00ae4c6d3 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6235,9 +6235,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 5fa391fc23d..83525938f23 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" @@ -57558,9 +57555,6 @@ "/v1/audio/transcriptions", "/v1/realtime/transcription_sessions" ], - "supported_transcription_response_formats": [ - "json" - ], "supported_modalities": [ "text", "audio" diff --git a/model_prices_and_context_window.schema.json b/model_prices_and_context_window.schema.json index cac91e189ab..737a9b7fa60 100644 --- a/model_prices_and_context_window.schema.json +++ b/model_prices_and_context_window.schema.json @@ -864,13 +864,6 @@ "type": "string" } }, - "supported_transcription_response_formats": { - "type": "array", - "description": "Response formats accepted by the model for file transcription.", - "items": { - "type": "string" - } - }, "supports_adaptive_thinking": { "type": "boolean" },