litellm/tests/llm_translation
devin-ai-integration[bot] 6c2ede00ac
test: remove 130 legacy tests owned by stronger unit proofs (#44157)
* test: remove 130 legacy tests owned by stronger unit proofs

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: list router _embedding and _aembedding as covered via public embedding calls

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-02 10:18:50 -07:00
..
fixtures
interactions test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
realtime test(e2e): move live-provider legacy tests into tests/e2e (#44120) 2026-10-02 00:02:18 -07:00
reasoning_effort_grid
test-skill
test_llm_response_utils
test_skills_data
base_audio_transcription_unit_tests.py
base_embedding_unit_tests.py test: stop CI tests from downloading tokenizer files and images (#43257) 2026-09-25 19:27:48 -07:00
base_llm_unit_tests.py
base_rerank_unit_tests.py
conftest.py test(vcr): guard leaked cassette patches and make injected-transport embedding tests immune (#42542) 2026-09-22 14:20:18 -07:00
databricks_config.template.txt test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
dog.wav
duck.png
gettysburg.wav
guinea.png
log.xt
Readme.md fix(tests): stop VCR recording and replaying a test's own localhost upstream (#43346) 2026-09-26 15:49:39 -07:00
test_a2a.py
test_anthropic_completion.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_aws_base_llm.py
test_azure_agents.py
test_azure_ai.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_azure_o_series.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_azure_openai.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_agentcore.py
test_bedrock_agents.py
test_bedrock_anthropic_regression.py
test_bedrock_common_utils.py
test_bedrock_completion.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_dynamic_auth_params_unit_tests.py test(bedrock): point unit tests at model ids still in the cost map (#42606) 2026-09-22 16:04:44 -07:00
test_bedrock_embedding.py
test_bedrock_govcloud.py
test_bedrock_gpt_oss.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_invoke_tests.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_llama.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_mantle.py
test_bedrock_moonshot.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_bedrock_nova_embedding.py
test_bedrock_nova_json.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_cloudflare.py
test_cohere.py
test_cometapi_chat_transformation.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_compression.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_convert_dict_to_image.py
test_crusoe.py
test_databricks.py
test_databricks_e2e.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_deepgram.py
test_deepseek_completion.py
test_elevenlabs.py
test_evals_api.py
test_fireworks_ai_translation.py test: point CircleCI-only suites at models still in the cost map (#42617) 2026-09-22 17:28:34 -07:00
test_gemini.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_gemini_image_usage.py test: point CircleCI-only suites at models still in the cost map (#42617) 2026-09-22 17:28:34 -07:00
test_gigachat.py
test_gpt4o_audio.py
test_groq.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_hosted_vllm_embedding_e2e.py
test_huggingface_chat_completion.py
test_hyperbolic.py
test_infinity.py
test_jina_ai.py
test_json_providers.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_lambda_ai.py test: keep the pinning-test removal free of unrelated reformatting 2026-09-18 04:27:28 +00:00
test_langgraph.py
test_litellm_proxy_provider.py fix(logging): pass provider response headers to callbacks on every endpoint (#42824) 2026-09-24 13:01:12 -07:00
test_minimax_tts.py
test_mistral_api.py test(e2e): move live-provider legacy tests into tests/e2e (#44120) 2026-10-02 00:02:18 -07:00
test_mistral_audio_transcription_transformation.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_model_cost_map_resilience.py
test_morph.py
test_nvidia_nim.py test(vcr): guard leaked cassette patches and make injected-transport embedding tests immune (#42542) 2026-09-22 14:20:18 -07:00
test_openai.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_openai_o1.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_openai_record_replay_proxy.py
test_openrouter.py
test_optional_params.py test: point CircleCI-only suites at models still in the cost map (#42617) 2026-09-22 17:28:34 -07:00
test_ovhcloud_audio_transcription_transformation.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_ovhcloud_chat_transformation.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_perplexity_reasoning.py test: keep the pinning-test removal free of unrelated reformatting 2026-09-18 04:27:28 +00:00
test_prompt_caching.py
test_prompt_factory.py
test_replicate.py
test_rerank.py
test_router_llm_translation_tests.py
test_sambanova_chat_transformation.py
test_skills_api.py test: move tests/test_litellm root and small trees into tests/unit (#43186) 2026-09-25 11:30:43 -07:00
test_snowflake.py
test_text_completion.py
test_text_completion_unit_tests.py
test_together_ai.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_triton.py
test_unit_test_bedrock_invoke.py
test_v0.py
test_vcr_classification.py
test_vcr_conftest_common_banner.py
test_vcr_filters.py
test_vcr_leak_guard.py test(vcr): guard leaked cassette patches and make injected-transport embedding tests immune (#42542) 2026-09-22 14:20:18 -07:00
test_vcr_redis_persister.py
test_vertex_ai_image_generation_transformation.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00
test_voyage_ai.py
test_watsonx.py
test_ws_vcr.py
test_xai.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
test_xiaomi_mimo.py test: finish the non-proxy half of tests/test_litellm (#43281) 2026-09-25 22:43:41 -07:00

Unit tests for individual LLM providers.

Name of the test file is the name of the LLM provider - e.g. test_openai.py is for OpenAI.

Redis-backed VCR cache

Every test in this directory is auto-decorated with @pytest.mark.vcr (via conftest.py). The first time a test runs we hit the live provider and record the HTTP exchange into Redis under litellm:vcr:cassette:<test_id>. Every subsequent run within 24h replays from Redis without touching the network. The 24h TTL means each new day's first run records again, so upstream API drift surfaces within a day.

The persister, header scrubbing, and 2xx-only filtering are defined in tests/_vcr_redis_persister.py. Files that already use respx (which patches the same httpx transport vcrpy does) are excluded from the auto-marker — see _RESPX_CONFLICTING_FILES in conftest.py.

Requests to localhost, 127.0.0.1, or 0.0.0.0 are never recorded or replayed (ignore_localhost in vcr_config_dict()): a server the test process starts itself on an ephemeral port is not a provider, and a cassette entry for it would replay against whichever later test lands on that port

The same VCR cache is used by other test directories that exercise live provider APIs. The reusable conftest plumbing lives in tests/_vcr_conftest_common.py and is wired into:

  • tests/llm_translation/
  • tests/llm_responses_api_testing/
  • tests/audio_tests/
  • tests/batches_tests/
  • tests/guardrails_tests/
  • tests/image_gen_tests/
  • tests/litellm_utils_tests/
  • tests/local_testing/ (covers local_testing_part1, local_testing_part2, litellm_router_testing, litellm_assistants_api_testing, langfuse_logging_unit_tests)
  • tests/logging_callback_tests/
  • tests/pass_through_unit_tests/
  • tests/router_unit_tests/
  • tests/unified_google_tests/

Test directories that run LiteLLM proxy in Docker (e.g. build_and_test, proxy_logging_guardrails_model_info_tests, proxy_store_model_in_db_tests) are intentionally not included: VCR.py patches the in-process httpx transport, so it cannot intercept the LLM calls that originate inside the Docker container.

Required environment

CASSETTE_REDIS_URL — separate Redis instance from the application Redis (REDIS_URL/REDIS_HOST) so test cassettes are not flushed by proxy tests. Provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, AWS_*, etc.) are needed only on cache-miss (the daily re-record), not on replay.

Flushing the cache

When you want the next run to re-record immediately instead of waiting for the 24h TTL:

make test-llm-translation-flush-vcr-cache

Disabling VCR

Skip the cache entirely (every call goes live, no recording):

LITELLM_VCR_DISABLE=1 uv run pytest tests/llm_translation/test_<file>.py