From 0883607cb347dc94dcdaff6363e9d6e4a644a1b5 Mon Sep 17 00:00:00 2001 From: Emerson Gomes Date: Wed, 23 Sep 2026 05:34:20 -0500 Subject: [PATCH] test(gemini): run TTS regressions in CI shards --- .../test_transformation.py | 2 ++ .../llms/gemini/test_gemini_tts.py | 4 ++-- .../text_to_speech/test_transformation.py | 2 ++ .../test_gemini_3_1_flash_tts_metadata.py | 21 +++---------------- .../speech_to_completion_bridge/__init__.py | 0 .../llms/vertex_ai/text_to_speech/__init__.py | 0 6 files changed, 9 insertions(+), 20 deletions(-) rename tests/{unit => test_litellm}/endpoints/speech/speech_to_completion_bridge/test_transformation.py (98%) rename tests/{unit => test_litellm}/llms/vertex_ai/text_to_speech/test_transformation.py (99%) delete mode 100644 tests/unit/endpoints/speech/speech_to_completion_bridge/__init__.py delete mode 100644 tests/unit/llms/vertex_ai/text_to_speech/__init__.py diff --git a/tests/unit/endpoints/speech/speech_to_completion_bridge/test_transformation.py b/tests/test_litellm/endpoints/speech/speech_to_completion_bridge/test_transformation.py similarity index 98% rename from tests/unit/endpoints/speech/speech_to_completion_bridge/test_transformation.py rename to tests/test_litellm/endpoints/speech/speech_to_completion_bridge/test_transformation.py index f33c8868266..6b01df20024 100644 --- a/tests/unit/endpoints/speech/speech_to_completion_bridge/test_transformation.py +++ b/tests/test_litellm/endpoints/speech/speech_to_completion_bridge/test_transformation.py @@ -11,6 +11,8 @@ from litellm.endpoints.speech.speech_to_completion_bridge.transformation import ) from litellm.types.utils import ChatCompletionAudioResponse, Choices, Message, ModelResponse +pytestmark = pytest.mark.usefixtures("local_model_cost_map") + GEMINI_TTS_MODEL: Final = "gemini-3.1-flash-tts-preview" PCM_BYTES: Final = b"\x01\x02\x03\x04" * 6 diff --git a/tests/test_litellm/llms/gemini/test_gemini_tts.py b/tests/test_litellm/llms/gemini/test_gemini_tts.py index 2a6c0367e99..b625d6dfe29 100644 --- a/tests/test_litellm/llms/gemini/test_gemini_tts.py +++ b/tests/test_litellm/llms/gemini/test_gemini_tts.py @@ -12,6 +12,8 @@ from litellm.endpoints.speech.speech_to_completion_bridge.transformation import from litellm.llms.gemini.chat.transformation import GoogleAIStudioGeminiConfig from litellm.utils import get_supported_openai_params +pytestmark = pytest.mark.usefixtures("local_model_cost_map") + GEMINI_3_1_FLASH_TTS_MODEL = "gemini-3.1-flash-tts-preview" MULTI_SPEAKER_SPEECH_CONFIG = { @@ -187,7 +189,6 @@ class TestGeminiTTSTransformation: assert result["speechConfig"] == NORMALIZED_MULTI_SPEAKER_SPEECH_CONFIG assert result["responseModalities"] == ["AUDIO"] - assert "temperature" not in result def test_gemini_tts_audio_parameter_with_existing_modalities(self): """Test audio parameter mapping when modalities already exist""" @@ -488,7 +489,6 @@ class TestGeminiTTSSpeechConfigInRequestBody: generation_config = request_body["generationConfig"] assert generation_config["speechConfig"] == NORMALIZED_MULTI_SPEAKER_SPEECH_CONFIG assert generation_config["responseModalities"] == ["AUDIO"] - assert "temperature" not in generation_config @pytest.mark.parametrize( "model,custom_llm_provider", diff --git a/tests/unit/llms/vertex_ai/text_to_speech/test_transformation.py b/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py similarity index 99% rename from tests/unit/llms/vertex_ai/text_to_speech/test_transformation.py rename to tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py index 9c31a8a67d2..50a73e39c12 100644 --- a/tests/unit/llms/vertex_ai/text_to_speech/test_transformation.py +++ b/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py @@ -13,6 +13,8 @@ from litellm.llms.vertex_ai.text_to_speech.transformation import ( from litellm.types.utils import LlmProviders from litellm.utils import ProviderConfigManager +pytestmark = pytest.mark.usefixtures("local_model_cost_map") + class TestVertexAITextToSpeechConfig: """Tests for VertexAITextToSpeechConfig transformation""" diff --git a/tests/test_litellm/test_gemini_3_1_flash_tts_metadata.py b/tests/test_litellm/test_gemini_3_1_flash_tts_metadata.py index 1ebe727ad5d..6420b5b9dc3 100644 --- a/tests/test_litellm/test_gemini_3_1_flash_tts_metadata.py +++ b/tests/test_litellm/test_gemini_3_1_flash_tts_metadata.py @@ -6,6 +6,8 @@ import pytest import litellm from litellm.utils import _invalidate_model_cost_lowercase_map, is_gemini_tts_model +pytestmark = pytest.mark.usefixtures("local_model_cost_map") + EXPECTED_MODELS = { "gemini-3.1-flash-tts-preview": "gemini", "gemini/gemini-3.1-flash-tts-preview": "gemini", @@ -27,24 +29,7 @@ def test_gemini_3_1_flash_tts_model_metadata(model, provider): assert info["litellm_provider"] == provider assert info["mode"] == "audio_speech" - assert info["input_cost_per_token"] == 1e-06 - assert info["output_cost_per_token"] == 2e-05 - assert info["max_input_tokens"] == 8192 - assert info["max_output_tokens"] == 16384 - assert info["max_tokens"] == 16384 - assert info["supported_endpoints"] == ["/v1/audio/speech"] - - if model == "gemini/gemini-3.1-flash-tts-preview": - assert info["rpm"] == 10 - assert info["tpm"] == 4000000 - else: - assert info["output_cost_per_audio_token"] == 2e-05 - assert info["supported_modalities"] == ["text"] - assert info["supported_output_modalities"] == ["audio"] - assert info["supports_audio_input"] is False - assert info["supports_audio_output"] is True - assert info["supports_function_calling"] is False - assert info["supports_prompt_caching"] is False + assert "/v1/audio/speech" in info["supported_endpoints"] def test_gemini_3_1_flash_tts_backup_matches_main(): diff --git a/tests/unit/endpoints/speech/speech_to_completion_bridge/__init__.py b/tests/unit/endpoints/speech/speech_to_completion_bridge/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/unit/llms/vertex_ai/text_to_speech/__init__.py b/tests/unit/llms/vertex_ai/text_to_speech/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000