diff --git a/litellm/__init__.py b/litellm/__init__.py index d21234d2a81..7ac8e2c2746 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -1922,9 +1922,6 @@ if TYPE_CHECKING: from .llms.fireworks_ai.completion.transformation import ( FireworksAITextCompletionConfig as FireworksAITextCompletionConfig, ) - from .llms.fireworks_ai.audio_transcription.transformation import ( - FireworksAIAudioTranscriptionConfig as FireworksAIAudioTranscriptionConfig, - ) from .llms.fireworks_ai.embed.fireworks_ai_transformation import ( FireworksAIEmbeddingConfig as FireworksAIEmbeddingConfig, ) diff --git a/litellm/_lazy_imports_registry.py b/litellm/_lazy_imports_registry.py index e653b40fd04..4f131354d2e 100644 --- a/litellm/_lazy_imports_registry.py +++ b/litellm/_lazy_imports_registry.py @@ -260,7 +260,6 @@ LLM_CONFIG_NAMES = ( "SambaNovaEmbeddingConfig", "FireworksAIConfig", "FireworksAITextCompletionConfig", - "FireworksAIAudioTranscriptionConfig", "FireworksAIEmbeddingConfig", "FriendliaiChatConfig", "JinaAIEmbeddingConfig", @@ -1027,10 +1026,6 @@ _LLM_CONFIGS_IMPORT_MAP = { ".llms.fireworks_ai.completion.transformation", "FireworksAITextCompletionConfig", ), - "FireworksAIAudioTranscriptionConfig": ( - ".llms.fireworks_ai.audio_transcription.transformation", - "FireworksAIAudioTranscriptionConfig", - ), "FireworksAIEmbeddingConfig": ( ".llms.fireworks_ai.embed.fireworks_ai_transformation", "FireworksAIEmbeddingConfig", diff --git a/litellm/litellm_core_utils/get_supported_openai_params.py b/litellm/litellm_core_utils/get_supported_openai_params.py index e87042b9101..923407fbedf 100644 --- a/litellm/litellm_core_utils/get_supported_openai_params.py +++ b/litellm/litellm_core_utils/get_supported_openai_params.py @@ -85,10 +85,6 @@ def get_supported_openai_params( return litellm.FireworksAIEmbeddingConfig().get_supported_openai_params( model=model ) - elif request_type == "transcription": - return litellm.FireworksAIAudioTranscriptionConfig().get_supported_openai_params( - model=model - ) else: return litellm.FireworksAIConfig().get_supported_openai_params(model=model) elif custom_llm_provider == "nvidia_nim": diff --git a/litellm/llms/fireworks_ai/audio_transcription/transformation.py b/litellm/llms/fireworks_ai/audio_transcription/transformation.py deleted file mode 100644 index 00bb5f26797..00000000000 --- a/litellm/llms/fireworks_ai/audio_transcription/transformation.py +++ /dev/null @@ -1,17 +0,0 @@ -from typing import List - -from litellm.types.llms.openai import OpenAIAudioTranscriptionOptionalParams - -from ...openai.transcriptions.whisper_transformation import ( - OpenAIWhisperAudioTranscriptionConfig, -) -from ..common_utils import FireworksAIMixin - - -class FireworksAIAudioTranscriptionConfig( - FireworksAIMixin, OpenAIWhisperAudioTranscriptionConfig -): - def get_supported_openai_params( - self, model: str - ) -> List[OpenAIAudioTranscriptionOptionalParams]: - return ["language", "prompt", "response_format", "timestamp_granularities"] diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index f373673e21c..e0c351fc906 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -39908,24 +39908,6 @@ "litellm_provider": "fireworks_ai", "mode": "chat" }, - "fireworks_ai/accounts/fireworks/models/whisper-v3": { - "max_tokens": 4096, - "max_input_tokens": 4096, - "max_output_tokens": 4096, - "input_cost_per_token": 0.0, - "output_cost_per_token": 0.0, - "litellm_provider": "fireworks_ai", - "mode": "audio_transcription" - }, - "fireworks_ai/accounts/fireworks/models/whisper-v3-turbo": { - "max_tokens": 4096, - "max_input_tokens": 4096, - "max_output_tokens": 4096, - "input_cost_per_token": 0.0, - "output_cost_per_token": 0.0, - "litellm_provider": "fireworks_ai", - "mode": "audio_transcription" - }, "fireworks_ai/accounts/fireworks/models/yi-34b": { "max_tokens": 4096, "max_input_tokens": 4096, diff --git a/litellm/utils.py b/litellm/utils.py index 29f703104da..a842e9e058d 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3191,7 +3191,7 @@ def get_optional_params_transcription( model=model, drop_params=drop_params if drop_params is not None else False, ) - elif provider_config is not None: # handles fireworks ai, and any future providers + elif provider_config is not None: # custom audio transcription config supported_params = provider_config.get_supported_openai_params(model=model) _check_valid_arg(supported_params=supported_params) optional_params = provider_config.map_openai_params( @@ -8915,8 +8915,6 @@ class ProviderConfigManager: ) return AzureSpeechAudioTranscriptionConfig() - if litellm.LlmProviders.FIREWORKS_AI == provider: - return litellm.FireworksAIAudioTranscriptionConfig() elif litellm.LlmProviders.DEEPGRAM == provider: return litellm.DeepgramAudioTranscriptionConfig() elif litellm.LlmProviders.ELEVENLABS == provider: diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 95f6fc85f8d..53b7b24f042 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -39946,24 +39946,6 @@ "litellm_provider": "fireworks_ai", "mode": "chat" }, - "fireworks_ai/accounts/fireworks/models/whisper-v3": { - "max_tokens": 4096, - "max_input_tokens": 4096, - "max_output_tokens": 4096, - "input_cost_per_token": 0.0, - "output_cost_per_token": 0.0, - "litellm_provider": "fireworks_ai", - "mode": "audio_transcription" - }, - "fireworks_ai/accounts/fireworks/models/whisper-v3-turbo": { - "max_tokens": 4096, - "max_input_tokens": 4096, - "max_output_tokens": 4096, - "input_cost_per_token": 0.0, - "output_cost_per_token": 0.0, - "litellm_provider": "fireworks_ai", - "mode": "audio_transcription" - }, "fireworks_ai/accounts/fireworks/models/yi-34b": { "max_tokens": 4096, "max_input_tokens": 4096, diff --git a/tests/llm_translation/test_fireworks_ai_translation.py b/tests/llm_translation/test_fireworks_ai_translation.py index 204f4d9e31b..bff6e696b80 100644 --- a/tests/llm_translation/test_fireworks_ai_translation.py +++ b/tests/llm_translation/test_fireworks_ai_translation.py @@ -7,9 +7,7 @@ sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path import litellm -from litellm import transcription from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig -from base_audio_transcription_unit_tests import BaseLLMAudioTranscriptionTest fireworks = FireworksAIConfig() @@ -69,76 +67,6 @@ def test_map_response_format(): assert result == {"response_format": response_format} -_AUDIO_FILE_PATH = os.path.join( - os.path.dirname(os.path.realpath(__file__)), "gettysburg.wav" -) - - -class TestFireworksAIAudioTranscription(BaseLLMAudioTranscriptionTest): - def get_base_audio_transcription_call_args(self) -> dict: - return { - "model": "fireworks_ai/whisper-v3", - "api_base": "https://audio-prod.api.fireworks.ai/v1", - } - - def get_custom_llm_provider(self) -> litellm.LlmProviders: - return litellm.LlmProviders.FIREWORKS_AI - - def test_audio_transcription(self): - from unittest.mock import MagicMock - - from openai.types.audio import Transcription - - audio_file = open(_AUDIO_FILE_PATH, "rb") - mock_client = MagicMock() - mock_client.audio.transcriptions.create.return_value = Transcription( - text="four score and seven years ago" - ) - - transcript = transcription( - **self.get_base_audio_transcription_call_args(), - file=audio_file, - api_key="fw-test-key", - client=mock_client, - ) - - assert transcript.text == "four score and seven years ago" - sent = mock_client.audio.transcriptions.create.call_args.kwargs - assert sent["model"] == "whisper-v3" - assert sent["file"] is audio_file - - @pytest.mark.asyncio - async def test_audio_transcription_async(self): - from unittest.mock import AsyncMock, MagicMock - - from openai.types.audio import Transcription - - audio_file = open(_AUDIO_FILE_PATH, "rb") - raw_response = MagicMock() - raw_response.headers = {} - raw_response.parse.return_value = Transcription( - text="four score and seven years ago" - ) - mock_client = MagicMock() - mock_client.audio.transcriptions.with_raw_response.create = AsyncMock( - return_value=raw_response - ) - - transcript = await litellm.atranscription( - **self.get_base_audio_transcription_call_args(), - file=audio_file, - api_key="fw-test-key", - client=mock_client, - ) - - assert transcript.text == "four score and seven years ago" - sent = ( - mock_client.audio.transcriptions.with_raw_response.create.call_args.kwargs - ) - assert sent["model"] == "whisper-v3" - assert sent["file"] is audio_file - - @pytest.mark.parametrize( "disable_add_transform_inline_image_block", [True, False],