The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015)
devin-ai-integration[bot]a76b59db9ff2
diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.ymlindex a05c26eef7d..c79614c049e 100644--- a/.github/workflows/test-unit.yml+++ b/.github/workflows/test-unit.yml@@ -199,17 +199,103 @@ jobs:tests/unit/proxy/db--ignore=tests/unit/proxy/db/db_transaction_queue/test_e2e_pod_lock_manager.py--ignore=tests/unit/proxy/db/test_update_daily_tag_spend.py- tests/test_litellm/proxy/middleware- tests/test_litellm/proxy/spend_tracking+ tests/unit/proxy/middleware+ --ignore=tests/unit/proxy/middleware/test_request_size_limit_middleware.py+ tests/unit/proxy/spend_tracking+ --ignore=tests/unit/proxy/spend_tracking/test_search_api_logging.py+ tests/unit/proxy/pass_through_endpointstests/test_litellm/proxy/pass_through_endpointstests/unit/proxy/_experimental--ignore=tests/unit/proxy/_experimental/mcp_server- tests/test_litellm/proxy/experimental- tests/test_litellm/proxy/common_utils- tests/test_litellm/proxy/enterprise_billing- tests/test_litellm/proxy/types_utils- tests/test_litellm/proxy/logging_endpoints- tests/test_litellm/proxy/test_*.py+ tests/unit/proxy/experimental+ tests/unit/proxy/common_utils+ --ignore=tests/unit/proxy/common_utils/test_cache_aware_routing.py+ --ignore=tests/unit/proxy/common_utils/test_check_batch_cost.py+ --ignore=tests/unit/proxy/common_utils/test_check_responses_cost.py+ --ignore=tests/unit/proxy/common_utils/test_proxy_encrypt_decrypt.py+ --ignore=tests/unit/proxy/common_utils/test_realtime_cache.py+ tests/unit/proxy/enterprise_billing+ tests/unit/proxy/types_utils+ tests/unit/proxy/logging_endpoints+ tests/unit/proxy/test__types.py+ tests/unit/proxy/test_aiohttp_cleanup_closed.py+ tests/unit/proxy/test_aiohttp_session_recovery.py+ tests/unit/proxy/test_api_key_masking_in_errors.py+ tests/unit/proxy/test_audio_speech_prometheus_hooks.py+ tests/unit/proxy/test_batch_expiry.py+ tests/unit/proxy/test_batch_metadata_none_fix.py+ tests/unit/proxy/test_batch_retrieve_bedrock.py+ tests/unit/proxy/test_batch_x_litellm_model_encoding.py+ tests/unit/proxy/test_blocked_response_usage.py+ tests/unit/proxy/test_body_snapshot_callback_params.py+ tests/unit/proxy/test_budget_reservation.py+ tests/unit/proxy/test_bug_report_config.py+ tests/unit/proxy/test_caching_routes.py+ tests/unit/proxy/test_chat_completion_metadata.py+ tests/unit/proxy/test_claude_code_marketplace.py+ tests/unit/proxy/test_collector.py+ tests/unit/proxy/test_common_request_processing.py+ tests/unit/proxy/test_component_allowlists.py+ tests/unit/proxy/test_conftest.py+ tests/unit/proxy/test_cors_config.py+ tests/unit/proxy/test_custom_proxy.py+ tests/unit/proxy/test_dynamic_mcp_route.py+ tests/unit/proxy/test_empty_model_list.py+ tests/unit/proxy/test_enforce_user_param.py+ tests/unit/proxy/test_fallback_management_endpoints.py+ tests/unit/proxy/test_fastapi_offline_routes.py+ tests/unit/proxy/test_filter_models_by_team_access_group.py+ tests/unit/proxy/test_health_check_functions.py+ tests/unit/proxy/test_health_check_max_tokens.py+ tests/unit/proxy/test_init_litellm_callbacks.py+ tests/unit/proxy/test_langfuse_passthrough_security.py+ tests/unit/proxy/test_lazy_openapi_snapshot.py+ tests/unit/proxy/test_litellm_pre_call_utils.py+ tests/unit/proxy/test_max_budget_env_var.py+ tests/unit/proxy/test_mcp_asgi_response.py+ tests/unit/proxy/test_model_based_routing_files_batches.py+ tests/unit/proxy/test_model_deprecations_endpoint.py+ tests/unit/proxy/test_model_dump_with_preserved_fields.py+ tests/unit/proxy/test_model_id_header_propagation.py+ tests/unit/proxy/test_model_info_default_limits.py+ tests/unit/proxy/test_model_level_guardrails.py+ tests/unit/proxy/test_model_list_aliases.py+ tests/unit/proxy/test_model_list_callback_filter.py+ tests/unit/proxy/test_model_list_discoverable.py+ tests/unit/proxy/test_model_list_healthy_only.py+ tests/unit/proxy/test_modify_response_streaming_passthrough.py+ tests/unit/proxy/test_native_compaction.py+ tests/unit/proxy/test_openai_ws_passthrough_routes.py+ tests/unit/proxy/test_openapi_schema_validation.py+ tests/unit/proxy/test_plugin_routes.py+ tests/unit/proxy/test_pointfive_dashboard_config.py+ tests/unit/proxy/test_pointfive_ui_callback.py+ tests/unit/proxy/test_pricing_field_strip.py+ tests/unit/proxy/test_prisma_engine_watchdog.py+ tests/unit/proxy/test_prisma_migration.py+ tests/unit/proxy/test_prometheus_cleanup.py+ tests/unit/proxy/test_prometheus_metrics_server.py+ tests/unit/proxy/test_provider_url_destination_guard.py+ tests/unit/proxy/test_proxy_cli.py+ tests/unit/proxy/test_proxy_logging_hook_detection.py+ tests/unit/proxy/test_proxy_types.py+ tests/unit/proxy/test_pyroscope.py+ tests/unit/proxy/test_read_model_list.py+ tests/unit/proxy/test_redis_auth_cache_flag.py+ tests/unit/proxy/test_response_model_sanitization.py+ tests/unit/proxy/test_route_a2a_models.py+ tests/unit/proxy/test_route_llm_request.py+ tests/unit/proxy/test_route_priority.py+ tests/unit/proxy/test_sensitive_route_auth.py+ tests/unit/proxy/test_shared_health_check.py+ tests/unit/proxy/test_spend_log_cleanup.py+ tests/unit/proxy/test_swagger_chat_completions.py+ tests/unit/proxy/test_team_member_update.py+ tests/unit/proxy/test_team_org_move.py+ tests/unit/proxy/test_tools_allowlist_enforcement.py+ tests/unit/proxy/test_tracing_endpoints.py+ tests/unit/proxy/test_update_llm_router_resilience.py+ tests/unit/proxy/test_zerobus_dashboard_config.pytests/unit/proxy/test_proxy_server_endpoints_and_startup.pytests/unit/proxy/test_proxy_utils_model_creation_and_error_logging.pyunit-flag: proxy-infradiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex a5ad6e97f3d..28538472a3f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -98,7 +98,7 @@ Add your tests to the [`tests/unit/` directory](https://github.com/BerriAI/litelThe `tests/unit/` directory follows the same structure as `litellm/`:-- `litellm/proxy/caching_routes.py` → `tests/test_litellm/proxy/test_caching_routes.py`+- `litellm/proxy/caching_routes.py` → `tests/unit/proxy/test_caching_routes.py`- `litellm/utils.py` → `tests/unit/test_utils.py`### Example Testdiff --git a/Makefile b/Makefileindex 421b811d8f3..def7c57a324 100644--- a/Makefile+++ b/Makefile@@ -326,8 +326,89 @@ test-unit-proxy-guardrails: install-test-depstest-unit-proxy-core: install-test-deps$(UV_RUN) pytest tests/unit/proxy/auth tests/unit/proxy/client tests/unit/proxy/db tests/unit/proxy/hooks tests/unit/proxy/policy_engine --ignore=tests/unit/proxy/db/db_transaction_queue/test_e2e_pod_lock_manager.py --ignore=tests/unit/proxy/db/test_update_daily_tag_spend.py --tb=short -vv -n 4 --durations=20+PROXY_INFRA_ROOT_TESTS := \+ tests/unit/proxy/test__types.py \+ tests/unit/proxy/test_aiohttp_cleanup_closed.py \+ tests/unit/proxy/test_aiohttp_session_recovery.py \+ tests/unit/proxy/test_api_key_masking_in_errors.py \+ tests/unit/proxy/test_audio_speech_prometheus_hooks.py \+ tests/unit/proxy/test_batch_expiry.py \+ tests/unit/proxy/test_batch_metadata_none_fix.py \+ tests/unit/proxy/test_batch_retrieve_bedrock.py \+ tests/unit/proxy/test_batch_x_litellm_model_encoding.py \+ tests/unit/proxy/test_blocked_response_usage.py \+ tests/unit/proxy/test_body_snapshot_callback_params.py \+ tests/unit/proxy/test_budget_reservation.py \+ tests/unit/proxy/test_bug_report_config.py \+ tests/unit/proxy/test_caching_routes.py \+ tests/unit/proxy/test_chat_completion_metadata.py \+ tests/unit/proxy/test_claude_code_marketplace.py \+ tests/unit/proxy/test_collector.py \+ tests/unit/proxy/test_common_request_processing.py \+ tests/unit/proxy/test_component_allowlists.py \+ tests/unit/proxy/test_conftest.py \+ tests/unit/proxy/test_cors_config.py \+ tests/unit/proxy/test_custom_proxy.py \+ tests/unit/proxy/test_dynamic_mcp_route.py \+ tests/unit/proxy/test_empty_model_list.py \+ tests/unit/proxy/test_enforce_user_param.py \+ tests/unit/proxy/test_fallback_management_endpoints.py \+ tests/unit/proxy/test_fastapi_offline_routes.py \+ tests/unit/proxy/test_filter_models_by_team_access_group.py \+ tests/unit/proxy/test_health_check_functions.py \+ tests/unit/proxy/test_health_check_max_tokens.py \+ tests/unit/proxy/test_init_litellm_callbacks.py \+ tests/unit/proxy/test_langfuse_passthrough_security.py \+ tests/unit/proxy/test_lazy_openapi_snapshot.py \+ tests/unit/proxy/test_litellm_pre_call_utils.py \+ tests/unit/proxy/test_max_budget_env_var.py \+ tests/unit/proxy/test_mcp_asgi_response.py \+ tests/unit/proxy/test_model_based_routing_files_batches.py \+ tests/unit/proxy/test_model_deprecations_endpoint.py \+ tests/unit/proxy/test_model_dump_with_preserved_fields.py \+ tests/unit/proxy/test_model_id_header_propagation.py \+ tests/unit/proxy/test_model_info_default_limits.py \+ tests/unit/proxy/test_model_level_guardrails.py \+ tests/unit/proxy/test_model_list_aliases.py \+ tests/unit/proxy/test_model_list_callback_filter.py \+ tests/unit/proxy/test_model_list_discoverable.py \+ tests/unit/proxy/test_model_list_healthy_only.py \+ tests/unit/proxy/test_modify_response_streaming_passthrough.py \+ tests/unit/proxy/test_native_compaction.py \+ tests/unit/proxy/test_openai_ws_passthrough_routes.py \+ tests/unit/proxy/test_openapi_schema_validation.py \+ tests/unit/proxy/test_plugin_routes.py \+ tests/unit/proxy/test_pointfive_dashboard_config.py \+ tests/unit/proxy/test_pointfive_ui_callback.py \+ tests/unit/proxy/test_pricing_field_strip.py \+ tests/unit/proxy/test_prisma_engine_watchdog.py \+ tests/unit/proxy/test_prisma_migration.py \+ tests/unit/proxy/test_prometheus_cleanup.py \+ tests/unit/proxy/test_prometheus_metrics_server.py \+ tests/unit/proxy/test_provider_url_destination_guard.py \+ tests/unit/proxy/test_proxy_cli.py \+ tests/unit/proxy/test_proxy_logging_hook_detection.py \+ tests/unit/proxy/test_proxy_types.py \+ tests/unit/proxy/test_pyroscope.py \+ tests/unit/proxy/test_read_model_list.py \+ tests/unit/proxy/test_redis_auth_cache_flag.py \+ tests/unit/proxy/test_response_model_sanitization.py \+ tests/unit/proxy/test_route_a2a_models.py \+ tests/unit/proxy/test_route_llm_request.py \+ tests/unit/proxy/test_route_priority.py \+ tests/unit/proxy/test_sensitive_route_auth.py \+ tests/unit/proxy/test_shared_health_check.py \+ tests/unit/proxy/test_spend_log_cleanup.py \+ tests/unit/proxy/test_swagger_chat_completions.py \+ tests/unit/proxy/test_team_member_update.py \+ tests/unit/proxy/test_team_org_move.py \+ tests/unit/proxy/test_tools_allowlist_enforcement.py \+ tests/unit/proxy/test_tracing_endpoints.py \+ tests/unit/proxy/test_update_llm_router_resilience.py \+ tests/unit/proxy/test_zerobus_dashboard_config.py+test-unit-proxy-misc: install-test-deps- $(UV_RUN) pytest tests/unit/proxy/agent_endpoints tests/unit/proxy/anthropic_endpoints tests/test_litellm/proxy/common_utils tests/unit/proxy/discovery_endpoints tests/test_litellm/proxy/experimental tests/unit/proxy/google_endpoints tests/unit/proxy/health_endpoints tests/unit/proxy/image_endpoints tests/test_litellm/proxy/middleware tests/unit/proxy/openai_files_endpoint tests/test_litellm/proxy/pass_through_endpoints tests/unit/proxy/prompts tests/unit/proxy/public_endpoints tests/unit/proxy/response_api_endpoints tests/unit/proxy/shutdown tests/test_litellm/proxy/spend_tracking tests/unit/proxy/ui_crud_endpoints tests/unit/proxy/vector_store_endpoints tests/test_litellm/proxy/test_*.py tests/unit/proxy/test_proxy_server_endpoints_and_startup.py tests/unit/proxy/test_proxy_utils_model_creation_and_error_logging.py tests/unit/proxy/_experimental/mcp_server/test_mcp_server_tool_calls_and_headers.py --ignore=tests/unit/proxy/google_endpoints/test_gemini_agents_endpoints.py --ignore=tests/unit/proxy/google_endpoints/test_google_endpoint_routing.py --ignore=tests/unit/proxy/google_endpoints/test_google_gemini_proxy_request.py --ignore=tests/unit/proxy/public_endpoints/test_blog_posts_endpoint.py --tb=short -vv -n 4 --durations=20+ $(UV_RUN) pytest tests/unit/proxy/agent_endpoints tests/unit/proxy/anthropic_endpoints tests/unit/proxy/common_utils --ignore=tests/unit/proxy/common_utils/test_cache_aware_routing.py --ignore=tests/unit/proxy/common_utils/test_check_batch_cost.py --ignore=tests/unit/proxy/common_utils/test_check_responses_cost.py --ignore=tests/unit/proxy/common_utils/test_proxy_encrypt_decrypt.py --ignore=tests/unit/proxy/common_utils/test_realtime_cache.py tests/unit/proxy/discovery_endpoints tests/unit/proxy/experimental tests/unit/proxy/google_endpoints tests/unit/proxy/health_endpoints tests/unit/proxy/image_endpoints tests/unit/proxy/middleware --ignore=tests/unit/proxy/middleware/test_request_size_limit_middleware.py tests/unit/proxy/openai_files_endpoint tests/unit/proxy/pass_through_endpoints tests/test_litellm/proxy/pass_through_endpoints tests/unit/proxy/prompts tests/unit/proxy/public_endpoints tests/unit/proxy/response_api_endpoints tests/unit/proxy/shutdown tests/unit/proxy/spend_tracking --ignore=tests/unit/proxy/spend_tracking/test_search_api_logging.py tests/unit/proxy/ui_crud_endpoints tests/unit/proxy/vector_store_endpoints $(PROXY_INFRA_ROOT_TESTS) tests/unit/proxy/test_proxy_server_endpoints_and_startup.py tests/unit/proxy/test_proxy_utils_model_creation_and_error_logging.py tests/unit/proxy/_experimental/mcp_server/test_mcp_server_tool_calls_and_headers.py --ignore=tests/unit/proxy/google_endpoints/test_gemini_agents_endpoints.py --ignore=tests/unit/proxy/google_endpoints/test_google_endpoint_routing.py --ignore=tests/unit/proxy/google_endpoints/test_google_gemini_proxy_request.py --ignore=tests/unit/proxy/public_endpoints/test_blog_posts_endpoint.py --tb=short -vv -n 4 --durations=20test-unit-integrations: install-test-deps$(UV_RUN) pytest tests/unit/integrations --tb=short -vv -n 4 --durations=20diff --git a/scripts/test_tool_allowlist_script.py b/scripts/test_tool_allowlist_script.pyindex f94aac60f80..607a8c39473 100644--- a/scripts/test_tool_allowlist_script.py+++ b/scripts/test_tool_allowlist_script.py@@ -6,7 +6,7 @@ Run from repo root:uv run python scripts/test_tool_allowlist_script.pyOr run the unit tests:- uv run pytest tests/test_litellm/proxy/test_tools_allowlist_enforcement.py -v+ uv run pytest tests/unit/proxy/test_tools_allowlist_enforcement.py -v"""import asyncio@@ -148,7 +148,7 @@ def main():asyncio.run(test_check_tools_allowlist())print("Done. For full unit tests run:")print(- " uv run pytest tests/test_litellm/proxy/test_tools_allowlist_enforcement.py -v"+ " uv run pytest tests/unit/proxy/test_tools_allowlist_enforcement.py -v")diff --git a/tests/e2e/quota_management/spend_tracking/SPEND_TRACKING_COVERAGE_MATRIX.md b/tests/e2e/quota_management/spend_tracking/SPEND_TRACKING_COVERAGE_MATRIX.mdindex 32dc0c47dda..d9380098891 100644--- a/tests/e2e/quota_management/spend_tracking/SPEND_TRACKING_COVERAGE_MATRIX.md+++ b/tests/e2e/quota_management/spend_tracking/SPEND_TRACKING_COVERAGE_MATRIX.md@@ -6,7 +6,7 @@ that would catch a regression.Companion: live suite `test_spend_tracking_e2e.py` + route breadth`test_spend_routes.py` (this directory). Offline regression suite:-`tests/test_litellm/proxy/spend_tracking/`. Reference PR: BerriAI/litellm#29956.+`tests/unit/proxy/spend_tracking/`. Reference PR: BerriAI/litellm#29956.Levels: `unit` mocked; `integration` real DB/cost-map; `live` real provider +proxy + SpendLogs rows. Status: `covered` / `partial` / `gap`.diff --git a/tests/test_spend_logs.py b/tests/test_spend_logs.pyindex c575fa07551..f0dda539352 100644--- a/tests/test_spend_logs.py+++ b/tests/test_spend_logs.py@@ -101,7 +101,7 @@ async def get_spend_logs(session, request_id=None, api_key=None):@pytest.mark.skip(- reason="Flaky in CI: /spend/logs?request_id=... returns 500 even after a 20s wait for the spend log to be written. Spend-log accuracy is covered by tests/test_litellm/proxy/spend_tracking/ and the proxy_spend_accuracy_tests CircleCI job."+ reason="Flaky in CI: /spend/logs?request_id=... returns 500 even after a 20s wait for the spend log to be written. Spend-log accuracy is covered by tests/unit/proxy/spend_tracking/ and the proxy_spend_accuracy_tests CircleCI job.")@pytest.mark.asyncioasync def test_spend_logs():@@ -159,7 +159,7 @@ async def generate_team(session: aiohttp.ClientSession, org_id: str) -> dict:@pytest.mark.skip(- reason="Flaky in CI: /spend/logs?request_id=... returns 500 even after a 20s wait for the spend log to be written. Same write-then-read race against the spend logs DB as test_spend_logs. Spend-log accuracy is covered by tests/test_litellm/proxy/spend_tracking/ and the proxy_spend_accuracy_tests CircleCI job."+ reason="Flaky in CI: /spend/logs?request_id=... returns 500 even after a 20s wait for the spend log to be written. Same write-then-read race against the spend logs DB as test_spend_logs. Spend-log accuracy is covered by tests/unit/proxy/spend_tracking/ and the proxy_spend_accuracy_tests CircleCI job.")@pytest.mark.asyncioasync def test_spend_logs_with_org_id():diff --git a/tests/test_litellm/proxy/logging_endpoints/__init__.py b/tests/unit/proxy/common_utils/html_forms/__init__.pysimilarity index 100%rename from tests/test_litellm/proxy/logging_endpoints/__init__.pyrename to tests/unit/proxy/common_utils/html_forms/__init__.pydiff --git a/tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.py b/tests/unit/proxy/common_utils/html_forms/test_native_client_consent.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.pyrename to tests/unit/proxy/common_utils/html_forms/test_native_client_consent.pydiff --git a/tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.py b/tests/unit/proxy/common_utils/html_forms/test_ui_login.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.pyrename to tests/unit/proxy/common_utils/html_forms/test_ui_login.pydiff --git a/tests/test_litellm/proxy/common_utils/test_admin_ui_utils.py b/tests/unit/proxy/common_utils/test_admin_ui_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_admin_ui_utils.pyrename to tests/unit/proxy/common_utils/test_admin_ui_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_auth_cache_invalidation_pubsub.py b/tests/unit/proxy/common_utils/test_auth_cache_invalidation_pubsub.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_auth_cache_invalidation_pubsub.pyrename to tests/unit/proxy/common_utils/test_auth_cache_invalidation_pubsub.pydiff --git a/tests/test_litellm/proxy/common_utils/test_cache_codec.py b/tests/unit/proxy/common_utils/test_cache_codec.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_cache_codec.pyrename to tests/unit/proxy/common_utils/test_cache_codec.pydiff --git a/tests/test_litellm/proxy/common_utils/test_callback_config_validation.py b/tests/unit/proxy/common_utils/test_callback_config_validation.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_callback_config_validation.pyrename to tests/unit/proxy/common_utils/test_callback_config_validation.pydiff --git a/tests/test_litellm/proxy/common_utils/test_callback_utils.py b/tests/unit/proxy/common_utils/test_callback_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_callback_utils.pyrename to tests/unit/proxy/common_utils/test_callback_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_config_sync_pubsub.py b/tests/unit/proxy/common_utils/test_config_sync_pubsub.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_config_sync_pubsub.pyrename to tests/unit/proxy/common_utils/test_config_sync_pubsub.pydiff --git a/tests/test_litellm/proxy/common_utils/test_custom_openapi_spec.py b/tests/unit/proxy/common_utils/test_custom_openapi_spec.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_custom_openapi_spec.pyrename to tests/unit/proxy/common_utils/test_custom_openapi_spec.pydiff --git a/tests/test_litellm/proxy/common_utils/test_debug_utils.py b/tests/unit/proxy/common_utils/test_debug_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_debug_utils.pyrename to tests/unit/proxy/common_utils/test_debug_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_discoverable_model_filter.py b/tests/unit/proxy/common_utils/test_discoverable_model_filter.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_discoverable_model_filter.pyrename to tests/unit/proxy/common_utils/test_discoverable_model_filter.pydiff --git a/tests/test_litellm/proxy/common_utils/test_encrypt_decrypt_utils.py b/tests/unit/proxy/common_utils/test_encrypt_decrypt_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_encrypt_decrypt_utils.pyrename to tests/unit/proxy/common_utils/test_encrypt_decrypt_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_error_body_call_id.py b/tests/unit/proxy/common_utils/test_error_body_call_id.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_error_body_call_id.pyrename to tests/unit/proxy/common_utils/test_error_body_call_id.pydiff --git a/tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.py b/tests/unit/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.pyrename to tests/unit/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.pydiff --git a/tests/test_litellm/proxy/common_utils/test_get_routes.py b/tests/unit/proxy/common_utils/test_get_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_get_routes.pyrename to tests/unit/proxy/common_utils/test_get_routes.pydiff --git a/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py b/tests/unit/proxy/common_utils/test_http_parsing_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_http_parsing_utils.pyrename to tests/unit/proxy/common_utils/test_http_parsing_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_json_merge_patch.py b/tests/unit/proxy/common_utils/test_json_merge_patch.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_json_merge_patch.pyrename to tests/unit/proxy/common_utils/test_json_merge_patch.pydiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.py b/tests/unit/proxy/common_utils/test_key_rotation_e2e.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.pyrename to tests/unit/proxy/common_utils/test_key_rotation_e2e.pydiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_integration.py b/tests/unit/proxy/common_utils/test_key_rotation_integration.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_key_rotation_integration.pyrename to tests/unit/proxy/common_utils/test_key_rotation_integration.pydiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_lock.py b/tests/unit/proxy/common_utils/test_key_rotation_lock.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_key_rotation_lock.pyrename to tests/unit/proxy/common_utils/test_key_rotation_lock.pydiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_manager.py b/tests/unit/proxy/common_utils/test_key_rotation_manager.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_key_rotation_manager.pyrename to tests/unit/proxy/common_utils/test_key_rotation_manager.pydiff --git a/tests/test_litellm/proxy/common_utils/test_load_config_utils.py b/tests/unit/proxy/common_utils/test_load_config_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_load_config_utils.pyrename to tests/unit/proxy/common_utils/test_load_config_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_model_deprecation.py b/tests/unit/proxy/common_utils/test_model_deprecation.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_model_deprecation.pyrename to tests/unit/proxy/common_utils/test_model_deprecation.pydiff --git a/tests/test_litellm/proxy/common_utils/test_model_listing_utils.py b/tests/unit/proxy/common_utils/test_model_listing_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_model_listing_utils.pyrename to tests/unit/proxy/common_utils/test_model_listing_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_openai_endpoint_utils.py b/tests/unit/proxy/common_utils/test_openai_endpoint_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_openai_endpoint_utils.pyrename to tests/unit/proxy/common_utils/test_openai_endpoint_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_openai_error_payload.py b/tests/unit/proxy/common_utils/test_openai_error_payload.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_openai_error_payload.pyrename to tests/unit/proxy/common_utils/test_openai_error_payload.pydiff --git a/tests/test_litellm/proxy/common_utils/test_path_utils.py b/tests/unit/proxy/common_utils/test_path_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_path_utils.pyrename to tests/unit/proxy/common_utils/test_path_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_periodic_reload_schedule.py b/tests/unit/proxy/common_utils/test_periodic_reload_schedule.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_periodic_reload_schedule.pyrename to tests/unit/proxy/common_utils/test_periodic_reload_schedule.pydiff --git a/tests/test_litellm/proxy/common_utils/test_prompt_cache_pricing.py b/tests/unit/proxy/common_utils/test_prompt_cache_pricing.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_prompt_cache_pricing.pyrename to tests/unit/proxy/common_utils/test_prompt_cache_pricing.pydiff --git a/tests/test_litellm/proxy/common_utils/test_rbac_utils.py b/tests/unit/proxy/common_utils/test_rbac_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_rbac_utils.pyrename to tests/unit/proxy/common_utils/test_rbac_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_registry_read_through.py b/tests/unit/proxy/common_utils/test_registry_read_through.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_registry_read_through.pyrename to tests/unit/proxy/common_utils/test_registry_read_through.pydiff --git a/tests/test_litellm/proxy/common_utils/test_reset_budget_job.py b/tests/unit/proxy/common_utils/test_reset_budget_job.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_reset_budget_job.pyrename to tests/unit/proxy/common_utils/test_reset_budget_job.pydiff --git a/tests/test_litellm/proxy/common_utils/test_scheduled_job_stagger.py b/tests/unit/proxy/common_utils/test_scheduled_job_stagger.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_scheduled_job_stagger.pyrename to tests/unit/proxy/common_utils/test_scheduled_job_stagger.pydiff --git a/tests/test_litellm/proxy/common_utils/test_sse_keepalive.py b/tests/unit/proxy/common_utils/test_sse_keepalive.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_sse_keepalive.pyrename to tests/unit/proxy/common_utils/test_sse_keepalive.pydiff --git a/tests/test_litellm/proxy/common_utils/test_static_asset_utils.py b/tests/unit/proxy/common_utils/test_static_asset_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_static_asset_utils.pyrename to tests/unit/proxy/common_utils/test_static_asset_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_swagger_utils.py b/tests/unit/proxy/common_utils/test_swagger_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_swagger_utils.pyrename to tests/unit/proxy/common_utils/test_swagger_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_timezone_utils.py b/tests/unit/proxy/common_utils/test_timezone_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_timezone_utils.pyrename to tests/unit/proxy/common_utils/test_timezone_utils.pydiff --git a/tests/test_litellm/proxy/common_utils/test_upsert_budget_membership.py b/tests/unit/proxy/common_utils/test_upsert_budget_membership.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_upsert_budget_membership.pyrename to tests/unit/proxy/common_utils/test_upsert_budget_membership.pydiff --git a/tests/test_litellm/proxy/common_utils/test_user_api_key_cache.py b/tests/unit/proxy/common_utils/test_user_api_key_cache.pysimilarity index 100%rename from tests/test_litellm/proxy/common_utils/test_user_api_key_cache.pyrename to tests/unit/proxy/common_utils/test_user_api_key_cache.pydiff --git a/tests/unit/proxy/conftest.py b/tests/unit/proxy/conftest.pyindex 23b4b6078f7..50c89387d80 100644--- a/tests/unit/proxy/conftest.py+++ b/tests/unit/proxy/conftest.py@@ -3,11 +3,15 @@import asyncioimport copyimport inspect+import os+import tempfileimport warningsfrom collections.abc import Iterator-from typing import Dict+from typing import Dict, Optionalimport pytest+import yaml+from fastapi.testclient import TestClientfrom prisma.errors import ClientNotConnectedError@@ -245,3 +249,168 @@ def _reset_graceful_shutdown_state():GracefulShutdownManager.reset()yieldGracefulShutdownManager.reset()+++def build_cache_config(enable_cache: bool = True) -> Optional[Dict]:+ """+ Build Redis cache configuration from environment variables.++ Args:+ enable_cache: Whether to enable cache (default: True)++ Returns:+ dict: Cache configuration dict with 'cache' and 'cache_params' keys, or None+ """+ if not enable_cache:+ return None++ redis_host = os.getenv("REDIS_HOST")+ if not redis_host:+ return None++ redis_port = os.getenv("REDIS_PORT", "6379")+ cache_params = {+ "type": "redis",+ "host": redis_host,+ "port": int(redis_port) if redis_port.isdigit() else redis_port,+ }++ redis_password = os.getenv("REDIS_PASSWORD")+ if redis_password:+ cache_params["password"] = redis_password++ return {"cache": True, "cache_params": cache_params}+++def build_minimal_proxy_config(+ database_url: Optional[str] = None, **init_options+) -> Dict:+ """+ Build a minimal proxy configuration YAML.++ Args:+ database_url: Optional database URL (falls back to DATABASE_URL env var)+ **init_options: Additional configuration options:+ - master_key: API key for authentication (default: "sk-1234")+ - enable_cache: Whether to enable Redis cache (default: True)+ - success_callback: Callback function for success events++ Returns:+ dict: Configuration dictionary ready to be written as YAML+ """+ config = {+ "general_settings": {"master_key": init_options.get("master_key", "sk-1234")},+ "litellm_settings": {},+ }++ db_url = database_url or os.getenv("DATABASE_URL")+ if db_url:+ config["general_settings"]["database_url"] = db_url++ enable_cache = init_options.get("enable_cache", True)+ cache_config = build_cache_config(enable_cache=enable_cache)+ if cache_config:+ config["litellm_settings"].update(cache_config)++ if init_options.get("success_callback") is not None:+ config["litellm_settings"]["success_callback"] = init_options[+ "success_callback"+ ]++ excluded_keys = {+ "master_key",+ "debug",+ "success_callback",+ "database_url",+ "enable_cache",+ }+ for key, value in init_options.items():+ if key not in excluded_keys and key not in config["litellm_settings"]:+ config["litellm_settings"][key] = value++ return config+++def set_proxy_environment_variables(+ monkeypatch, database_url: Optional[str] = None+) -> None:+ """+ Set environment variables for database and Redis.++ Args:+ monkeypatch: pytest monkeypatch fixture+ database_url: Optional database URL (falls back to DATABASE_URL env var)+ """+ db_url = database_url or os.getenv("DATABASE_URL")+ if db_url:+ monkeypatch.setenv("DATABASE_URL", db_url)++ redis_host = os.getenv("REDIS_HOST")+ if redis_host:+ monkeypatch.setenv("REDIS_HOST", redis_host)+ monkeypatch.setenv("REDIS_PORT", os.getenv("REDIS_PORT", "6379"))+ redis_password = os.getenv("REDIS_PASSWORD")+ if redis_password:+ monkeypatch.setenv("REDIS_PASSWORD", redis_password)+++def create_proxy_test_client(+ monkeypatch, database_url: Optional[str] = None, **init_options+) -> TestClient:+ """+ Create a proxy TestClient with optional database and Redis cache configuration.++ Args:+ monkeypatch: pytest monkeypatch fixture+ database_url: Optional database URL (falls back to DATABASE_URL env var)+ **init_options: Additional configuration options:+ - master_key: API key for authentication (default: "sk-1234")+ - enable_cache: Whether to enable Redis cache (default: True)+ - success_callback: Callback function for success events+ - debug: Enable debug mode++ Returns:+ TestClient: FastAPI test client for the proxy server+ """+ from litellm.proxy.proxy_server import (+ cleanup_router_config_variables,+ initialize,+ app,+ )++ cleanup_router_config_variables()++ filepath = os.path.dirname(os.path.abspath(__file__))+ default_config_fp = os.path.join(+ filepath, "test_configs", "test_config_hosted_vllm_embedding.yaml"+ )++ enable_cache = init_options.get("enable_cache", True)+ needs_redis = enable_cache and os.getenv("REDIS_HOST") is not None+ needs_db = (database_url or os.getenv("DATABASE_URL")) is not None++ if not os.path.exists(default_config_fp) or needs_redis or needs_db:+ minimal_config = build_minimal_proxy_config(+ database_url=database_url, **init_options+ )++ with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml", delete=False) as f:+ yaml.dump(minimal_config, f)+ config_fp = f.name+ else:+ config_fp = default_config_fp++ set_proxy_environment_variables(monkeypatch, database_url=database_url)+ monkeypatch.setenv("LITELLM_DANGEROUSLY_PERMIT_WEAK_OR_UNSET_MASTER_KEY", "true")++ asyncio.run(initialize(config=config_fp, debug=init_options.get("debug", False)))+ return TestClient(app)+++def fresh_agent_read_through(monkeypatch):+ from litellm.proxy.common_utils import registry_read_through++ read_through = registry_read_through.RegistryReadThrough(resync=registry_read_through._resync_agents)+ monkeypatch.setattr(registry_read_through, "agent_registry_read_through", read_through)+ return read_throughdiff --git a/tests/test_litellm/proxy/types_utils/__init__.py b/tests/unit/proxy/enterprise_billing/__init__.pysimilarity index 100%rename from tests/test_litellm/proxy/types_utils/__init__.pyrename to tests/unit/proxy/enterprise_billing/__init__.pydiff --git a/tests/test_litellm/proxy/enterprise_billing/test_billing_metrics.py b/tests/unit/proxy/enterprise_billing/test_billing_metrics.pysimilarity index 100%rename from tests/test_litellm/proxy/enterprise_billing/test_billing_metrics.pyrename to tests/unit/proxy/enterprise_billing/test_billing_metrics.pydiff --git a/tests/unit/proxy/experimental/__init__.py b/tests/unit/proxy/experimental/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/unit/proxy/experimental/mcp_server/__init__.py b/tests/unit/proxy/experimental/mcp_server/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.py b/tests/unit/proxy/experimental/mcp_server/test_tool_registry.pysimilarity index 95%rename from tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.pyrename to tests/unit/proxy/experimental/mcp_server/test_tool_registry.pyindex 9fc2e8744c1..c7df359aae2 100644--- a/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.py+++ b/tests/unit/proxy/experimental/mcp_server/test_tool_registry.py@@ -59,7 +59,7 @@ def test_load_tools_from_config():"name": "config_tool","description": "A tool from config","input_schema": {"type": "object"},- "handler": "test_tool_registry.example_handler",+ "handler": "tests.unit.proxy.experimental.mcp_server.test_tool_registry.example_handler",}]diff --git a/tests/unit/proxy/health_endpoints/test_health_endpoints.py b/tests/unit/proxy/health_endpoints/test_health_endpoints.pyindex 3ec5176159d..f40c33b1e91 100644--- a/tests/unit/proxy/health_endpoints/test_health_endpoints.py+++ b/tests/unit/proxy/health_endpoints/test_health_endpoints.py@@ -35,7 +35,7 @@ from litellm.proxy.health_endpoints._health_endpoints import ()# Import shared proxy test helpers from conftest-from tests.test_litellm.proxy.conftest import create_proxy_test_client+from tests.unit.proxy.conftest import create_proxy_test_client@pytest.mark.asynciodiff --git a/tests/unit/proxy/logging_endpoints/__init__.py b/tests/unit/proxy/logging_endpoints/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/test_litellm/proxy/logging_endpoints/test_callback_logs_endpoints.py b/tests/unit/proxy/logging_endpoints/test_callback_logs_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/logging_endpoints/test_callback_logs_endpoints.pyrename to tests/unit/proxy/logging_endpoints/test_callback_logs_endpoints.pydiff --git a/tests/test_litellm/proxy/middleware/test_admission_control_middleware.py b/tests/unit/proxy/middleware/test_admission_control_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_admission_control_middleware.pyrename to tests/unit/proxy/middleware/test_admission_control_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_billable_request_metrics_middleware.py b/tests/unit/proxy/middleware/test_billable_request_metrics_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_billable_request_metrics_middleware.pyrename to tests/unit/proxy/middleware/test_billable_request_metrics_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_budget_reservation_release_middleware.py b/tests/unit/proxy/middleware/test_budget_reservation_release_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_budget_reservation_release_middleware.pyrename to tests/unit/proxy/middleware/test_budget_reservation_release_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_in_flight_requests_middleware.py b/tests/unit/proxy/middleware/test_in_flight_requests_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_in_flight_requests_middleware.pyrename to tests/unit/proxy/middleware/test_in_flight_requests_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_per_request_root_path_middleware.py b/tests/unit/proxy/middleware/test_per_request_root_path_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_per_request_root_path_middleware.pyrename to tests/unit/proxy/middleware/test_per_request_root_path_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_prometheus_auth_middleware.py b/tests/unit/proxy/middleware/test_prometheus_auth_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_prometheus_auth_middleware.pyrename to tests/unit/proxy/middleware/test_prometheus_auth_middleware.pydiff --git a/tests/test_litellm/proxy/middleware/test_prometheus_auth_middleware_asgi.py b/tests/unit/proxy/middleware/test_prometheus_auth_middleware_asgi.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_prometheus_auth_middleware_asgi.pyrename to tests/unit/proxy/middleware/test_prometheus_auth_middleware_asgi.pydiff --git a/tests/test_litellm/proxy/middleware/test_security_headers_middleware.py b/tests/unit/proxy/middleware/test_security_headers_middleware.pysimilarity index 100%rename from tests/test_litellm/proxy/middleware/test_security_headers_middleware.pyrename to tests/unit/proxy/middleware/test_security_headers_middleware.pydiff --git a/tests/unit/proxy/pass_through_endpoints/__init__.py b/tests/unit/proxy/pass_through_endpoints/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/__init__.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_azure_speech_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_azure_speech_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_azure_speech_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_azure_speech_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_deepgram_listen_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_deepgram_listen_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_deepgram_listen_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_deepgram_listen_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_fal_ai_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_fal_ai_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_fal_ai_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_fal_ai_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_tinyfish_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_tinyfish_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_tinyfish_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_tinyfish_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_transcribe_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_transcribe_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_transcribe_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_transcribe_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_typesafe_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_typesafe_passthrough_logging_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_typesafe_passthrough_logging_handler.pyrename to tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_typesafe_passthrough_logging_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_carry_guardrail_logging_info.py b/tests/unit/proxy/pass_through_endpoints/test_carry_guardrail_logging_info.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_carry_guardrail_logging_info.pyrename to tests/unit/proxy/pass_through_endpoints/test_carry_guardrail_logging_info.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.py b/tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.pyrename to tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyrename to tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_managed_id_rewriter.py b/tests/unit/proxy/pass_through_endpoints/test_managed_id_rewriter.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_managed_id_rewriter.pyrename to tests/unit/proxy/pass_through_endpoints/test_managed_id_rewriter.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_method_specific_routing.py b/tests/unit/proxy/pass_through_endpoints/test_method_specific_routing.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_method_specific_routing.pyrename to tests/unit/proxy/pass_through_endpoints/test_method_specific_routing.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_auth_default.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoint_router.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoint_router.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrail_block_otel_span.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrail_block_otel_span.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrail_block_otel_span.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrail_block_otel_span.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrails.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrails.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_post_call_guardrails.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_post_call_guardrails.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_post_call_guardrails.pyrename to tests/unit/proxy/pass_through_endpoints/test_passthrough_post_call_guardrails.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_streaming_handler.py b/tests/unit/proxy/pass_through_endpoints/test_streaming_handler.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_streaming_handler.pyrename to tests/unit/proxy/pass_through_endpoints/test_streaming_handler.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_streaming_handler_interrupt.py b/tests/unit/proxy/pass_through_endpoints/test_streaming_handler_interrupt.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_streaming_handler_interrupt.pyrename to tests/unit/proxy/pass_through_endpoints/test_streaming_handler_interrupt.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.py b/tests/unit/proxy/pass_through_endpoints/test_upstream_usage_headers.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.pyrename to tests/unit/proxy/pass_through_endpoints/test_upstream_usage_headers.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_ai_batch_passthrough.py b/tests/unit/proxy/pass_through_endpoints/test_vertex_ai_batch_passthrough.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_vertex_ai_batch_passthrough.pyrename to tests/unit/proxy/pass_through_endpoints/test_vertex_ai_batch_passthrough.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.py b/tests/unit/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.pyrename to tests/unit/proxy/pass_through_endpoints/test_vertex_passthrough_load_balancing.pydiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.py b/tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.pysimilarity index 100%rename from tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.pyrename to tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_baseline_accounting.py b/tests/unit/proxy/spend_tracking/test_baseline_accounting.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_baseline_accounting.pyrename to tests/unit/proxy/spend_tracking/test_baseline_accounting.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_budget_reservation.py b/tests/unit/proxy/spend_tracking/test_budget_reservation.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_budget_reservation.pyrename to tests/unit/proxy/spend_tracking/test_budget_reservation.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_budget_reservation_redis_failure.py b/tests/unit/proxy/spend_tracking/test_budget_reservation_redis_failure.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_budget_reservation_redis_failure.pyrename to tests/unit/proxy/spend_tracking/test_budget_reservation_redis_failure.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_carried_budget_state.py b/tests/unit/proxy/spend_tracking/test_carried_budget_state.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_carried_budget_state.pyrename to tests/unit/proxy/spend_tracking/test_carried_budget_state.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.py b/tests/unit/proxy/spend_tracking/test_cloudzero_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.pyrename to tests/unit/proxy/spend_tracking/test_cloudzero_endpoints.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_compression_savings.py b/tests/unit/proxy/spend_tracking/test_compression_savings.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_compression_savings.pyrename to tests/unit/proxy/spend_tracking/test_compression_savings.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_input_tokens.py b/tests/unit/proxy/spend_tracking/test_input_tokens.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_input_tokens.pyrename to tests/unit/proxy/spend_tracking/test_input_tokens.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_key_metadata_recovery.py b/tests/unit/proxy/spend_tracking/test_key_metadata_recovery.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_key_metadata_recovery.pyrename to tests/unit/proxy/spend_tracking/test_key_metadata_recovery.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_ptu_feature_flag.py b/tests/unit/proxy/spend_tracking/test_ptu_feature_flag.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_ptu_feature_flag.pyrename to tests/unit/proxy/spend_tracking/test_ptu_feature_flag.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_ptu_flat_cost_rollup.py b/tests/unit/proxy/spend_tracking/test_ptu_flat_cost_rollup.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_ptu_flat_cost_rollup.pyrename to tests/unit/proxy/spend_tracking/test_ptu_flat_cost_rollup.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_savings.py b/tests/unit/proxy/spend_tracking/test_savings.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_savings.pyrename to tests/unit/proxy/spend_tracking/test_savings.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_capture_rate.py b/tests/unit/proxy/spend_tracking/test_spend_capture_rate.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_capture_rate.pyrename to tests/unit/proxy/spend_tracking/test_spend_capture_rate.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_counter_batch.py b/tests/unit/proxy/spend_tracking/test_spend_counter_batch.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_counter_batch.pyrename to tests/unit/proxy/spend_tracking/test_spend_counter_batch.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_event.py b/tests/unit/proxy/spend_tracking/test_spend_event.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_event.pyrename to tests/unit/proxy/spend_tracking/test_spend_event.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_event_producer.py b/tests/unit/proxy/spend_tracking/test_spend_event_producer.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_event_producer.pyrename to tests/unit/proxy/spend_tracking/test_spend_event_producer.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_log_error_logger.py b/tests/unit/proxy/spend_tracking/test_spend_log_error_logger.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_log_error_logger.pyrename to tests/unit/proxy/spend_tracking/test_spend_log_error_logger.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py b/tests/unit/proxy/spend_tracking/test_spend_management_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.pyrename to tests/unit/proxy/spend_tracking/test_spend_management_endpoints.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.py b/tests/unit/proxy/spend_tracking/test_spend_query_optimization.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.pyrename to tests/unit/proxy/spend_tracking/test_spend_query_optimization.pydiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py b/tests/unit/proxy/spend_tracking/test_spend_tracking_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.pyrename to tests/unit/proxy/spend_tracking/test_spend_tracking_utils.pydiff --git a/tests/test_litellm/proxy/test__types.py b/tests/unit/proxy/test__types.pysimilarity index 100%rename from tests/test_litellm/proxy/test__types.pyrename to tests/unit/proxy/test__types.pydiff --git a/tests/test_litellm/proxy/test_aiohttp_cleanup_closed.py b/tests/unit/proxy/test_aiohttp_cleanup_closed.pysimilarity index 100%rename from tests/test_litellm/proxy/test_aiohttp_cleanup_closed.pyrename to tests/unit/proxy/test_aiohttp_cleanup_closed.pydiff --git a/tests/test_litellm/proxy/test_aiohttp_session_recovery.py b/tests/unit/proxy/test_aiohttp_session_recovery.pysimilarity index 100%rename from tests/test_litellm/proxy/test_aiohttp_session_recovery.pyrename to tests/unit/proxy/test_aiohttp_session_recovery.pydiff --git a/tests/test_litellm/proxy/test_api_key_masking_in_errors.py b/tests/unit/proxy/test_api_key_masking_in_errors.pysimilarity index 100%rename from tests/test_litellm/proxy/test_api_key_masking_in_errors.pyrename to tests/unit/proxy/test_api_key_masking_in_errors.pydiff --git a/tests/test_litellm/proxy/test_audio_speech_prometheus_hooks.py b/tests/unit/proxy/test_audio_speech_prometheus_hooks.pysimilarity index 99%rename from tests/test_litellm/proxy/test_audio_speech_prometheus_hooks.pyrename to tests/unit/proxy/test_audio_speech_prometheus_hooks.pyindex 959cb2b1e89..01650e7a77d 100644--- a/tests/test_litellm/proxy/test_audio_speech_prometheus_hooks.py+++ b/tests/unit/proxy/test_audio_speech_prometheus_hooks.py@@ -44,7 +44,7 @@ def client_no_auth():cleanup_router_config_variables()filepath = os.path.dirname(os.path.abspath(__file__))- config_fp = os.path.join(filepath, "test_configs", "test_config_no_auth.yaml")+ config_fp = os.path.join(filepath, "test_configs", "test_config_hosted_vllm_embedding.yaml")asyncio.run(initialize(config=config_fp, debug=True))return TestClient(app)diff --git a/tests/test_litellm/proxy/test_batch_expiry.py b/tests/unit/proxy/test_batch_expiry.pysimilarity index 100%rename from tests/test_litellm/proxy/test_batch_expiry.pyrename to tests/unit/proxy/test_batch_expiry.pydiff --git a/tests/test_litellm/proxy/test_batch_metadata_none_fix.py b/tests/unit/proxy/test_batch_metadata_none_fix.pysimilarity index 100%rename from tests/test_litellm/proxy/test_batch_metadata_none_fix.pyrename to tests/unit/proxy/test_batch_metadata_none_fix.pydiff --git a/tests/test_litellm/proxy/test_batch_retrieve_bedrock.py b/tests/unit/proxy/test_batch_retrieve_bedrock.pysimilarity index 100%rename from tests/test_litellm/proxy/test_batch_retrieve_bedrock.pyrename to tests/unit/proxy/test_batch_retrieve_bedrock.pydiff --git a/tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.py b/tests/unit/proxy/test_batch_x_litellm_model_encoding.pysimilarity index 100%rename from tests/test_litellm/proxy/test_batch_x_litellm_model_encoding.pyrename to tests/unit/proxy/test_batch_x_litellm_model_encoding.pydiff --git a/tests/test_litellm/proxy/test_blocked_response_usage.py b/tests/unit/proxy/test_blocked_response_usage.pysimilarity index 100%rename from tests/test_litellm/proxy/test_blocked_response_usage.pyrename to tests/unit/proxy/test_blocked_response_usage.pydiff --git a/tests/test_litellm/proxy/test_body_snapshot_callback_params.py b/tests/unit/proxy/test_body_snapshot_callback_params.pysimilarity index 100%rename from tests/test_litellm/proxy/test_body_snapshot_callback_params.pyrename to tests/unit/proxy/test_body_snapshot_callback_params.pydiff --git a/tests/test_litellm/proxy/test_budget_reservation.py b/tests/unit/proxy/test_budget_reservation.pysimilarity index 100%rename from tests/test_litellm/proxy/test_budget_reservation.pyrename to tests/unit/proxy/test_budget_reservation.pydiff --git a/tests/test_litellm/proxy/test_bug_report_config.py b/tests/unit/proxy/test_bug_report_config.pysimilarity index 100%rename from tests/test_litellm/proxy/test_bug_report_config.pyrename to tests/unit/proxy/test_bug_report_config.pydiff --git a/tests/test_litellm/proxy/test_caching_routes.py b/tests/unit/proxy/test_caching_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/test_caching_routes.pyrename to tests/unit/proxy/test_caching_routes.pydiff --git a/tests/test_litellm/proxy/test_chat_completion_metadata.py b/tests/unit/proxy/test_chat_completion_metadata.pysimilarity index 100%rename from tests/test_litellm/proxy/test_chat_completion_metadata.pyrename to tests/unit/proxy/test_chat_completion_metadata.pydiff --git a/tests/test_litellm/proxy/test_claude_code_marketplace.py b/tests/unit/proxy/test_claude_code_marketplace.pysimilarity index 100%rename from tests/test_litellm/proxy/test_claude_code_marketplace.pyrename to tests/unit/proxy/test_claude_code_marketplace.pydiff --git a/tests/test_litellm/proxy/test_collector.py b/tests/unit/proxy/test_collector.pysimilarity index 100%rename from tests/test_litellm/proxy/test_collector.pyrename to tests/unit/proxy/test_collector.pydiff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/unit/proxy/test_common_request_processing.pysimilarity index 100%rename from tests/test_litellm/proxy/test_common_request_processing.pyrename to tests/unit/proxy/test_common_request_processing.pydiff --git a/tests/test_litellm/proxy/test_component_allowlists.py b/tests/unit/proxy/test_component_allowlists.pysimilarity index 100%rename from tests/test_litellm/proxy/test_component_allowlists.pyrename to tests/unit/proxy/test_component_allowlists.pydiff --git a/tests/test_litellm/proxy/test_configs/test_config_no_auth.yaml b/tests/unit/proxy/test_configs/test_config_hosted_vllm_embedding.yamlsimilarity index 100%rename from tests/test_litellm/proxy/test_configs/test_config_no_auth.yamlrename to tests/unit/proxy/test_configs/test_config_hosted_vllm_embedding.yamldiff --git a/tests/test_litellm/proxy/test_conftest.py b/tests/unit/proxy/test_conftest.pysimilarity index 100%rename from tests/test_litellm/proxy/test_conftest.pyrename to tests/unit/proxy/test_conftest.pydiff --git a/tests/test_litellm/proxy/test_cors_config.py b/tests/unit/proxy/test_cors_config.pysimilarity index 100%rename from tests/test_litellm/proxy/test_cors_config.pyrename to tests/unit/proxy/test_cors_config.pydiff --git a/tests/test_litellm/proxy/test_custom_proxy.py b/tests/unit/proxy/test_custom_proxy.pysimilarity index 100%rename from tests/test_litellm/proxy/test_custom_proxy.pyrename to tests/unit/proxy/test_custom_proxy.pydiff --git a/tests/test_litellm/proxy/test_dynamic_mcp_route.py b/tests/unit/proxy/test_dynamic_mcp_route.pysimilarity index 100%rename from tests/test_litellm/proxy/test_dynamic_mcp_route.pyrename to tests/unit/proxy/test_dynamic_mcp_route.pydiff --git a/tests/test_litellm/proxy/test_empty_model_list.py b/tests/unit/proxy/test_empty_model_list.pysimilarity index 100%rename from tests/test_litellm/proxy/test_empty_model_list.pyrename to tests/unit/proxy/test_empty_model_list.pydiff --git a/tests/test_litellm/proxy/test_enforce_user_param.py b/tests/unit/proxy/test_enforce_user_param.pysimilarity index 99%rename from tests/test_litellm/proxy/test_enforce_user_param.pyrename to tests/unit/proxy/test_enforce_user_param.pyindex 1001372aeb5..cca2fbadaa9 100644--- a/tests/test_litellm/proxy/test_enforce_user_param.py+++ b/tests/unit/proxy/test_enforce_user_param.py@@ -488,5 +488,5 @@ class TestEnforceUserParamEdgeCases:if __name__ == "__main__":- # Run tests with: pytest tests/test_litellm/proxy/test_enforce_user_param.py -v+ # Run tests with: pytest tests/unit/proxy/test_enforce_user_param.py -vpytest.main([__file__, "-v"])diff --git a/tests/test_litellm/proxy/test_fallback_management_endpoints.py b/tests/unit/proxy/test_fallback_management_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/test_fallback_management_endpoints.pyrename to tests/unit/proxy/test_fallback_management_endpoints.pydiff --git a/tests/test_litellm/proxy/test_fastapi_offline_routes.py b/tests/unit/proxy/test_fastapi_offline_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/test_fastapi_offline_routes.pyrename to tests/unit/proxy/test_fastapi_offline_routes.pydiff --git a/tests/test_litellm/proxy/test_filter_models_by_team_access_group.py b/tests/unit/proxy/test_filter_models_by_team_access_group.pysimilarity index 100%rename from tests/test_litellm/proxy/test_filter_models_by_team_access_group.pyrename to tests/unit/proxy/test_filter_models_by_team_access_group.pydiff --git a/tests/test_litellm/proxy/test_health_check_functions.py b/tests/unit/proxy/test_health_check_functions.pysimilarity index 100%rename from tests/test_litellm/proxy/test_health_check_functions.pyrename to tests/unit/proxy/test_health_check_functions.pydiff --git a/tests/test_litellm/proxy/test_health_check_max_tokens.py b/tests/unit/proxy/test_health_check_max_tokens.pysimilarity index 100%rename from tests/test_litellm/proxy/test_health_check_max_tokens.pyrename to tests/unit/proxy/test_health_check_max_tokens.pydiff --git a/tests/test_litellm/proxy/test_init_litellm_callbacks.py b/tests/unit/proxy/test_init_litellm_callbacks.pysimilarity index 100%rename from tests/test_litellm/proxy/test_init_litellm_callbacks.pyrename to tests/unit/proxy/test_init_litellm_callbacks.pydiff --git a/tests/test_litellm/proxy/test_langfuse_passthrough_security.py b/tests/unit/proxy/test_langfuse_passthrough_security.pysimilarity index 100%rename from tests/test_litellm/proxy/test_langfuse_passthrough_security.pyrename to tests/unit/proxy/test_langfuse_passthrough_security.pydiff --git a/tests/test_litellm/proxy/test_lazy_openapi_snapshot.py b/tests/unit/proxy/test_lazy_openapi_snapshot.pysimilarity index 100%rename from tests/test_litellm/proxy/test_lazy_openapi_snapshot.pyrename to tests/unit/proxy/test_lazy_openapi_snapshot.pydiff --git a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py b/tests/unit/proxy/test_litellm_pre_call_utils.pysimilarity index 100%rename from tests/test_litellm/proxy/test_litellm_pre_call_utils.pyrename to tests/unit/proxy/test_litellm_pre_call_utils.pydiff --git a/tests/test_litellm/proxy/test_max_budget_env_var.py b/tests/unit/proxy/test_max_budget_env_var.pysimilarity index 100%rename from tests/test_litellm/proxy/test_max_budget_env_var.pyrename to tests/unit/proxy/test_max_budget_env_var.pydiff --git a/tests/test_litellm/proxy/test_mcp_asgi_response.py b/tests/unit/proxy/test_mcp_asgi_response.pysimilarity index 100%rename from tests/test_litellm/proxy/test_mcp_asgi_response.pyrename to tests/unit/proxy/test_mcp_asgi_response.pydiff --git a/tests/test_litellm/proxy/test_model_based_routing_files_batches.py b/tests/unit/proxy/test_model_based_routing_files_batches.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_based_routing_files_batches.pyrename to tests/unit/proxy/test_model_based_routing_files_batches.pydiff --git a/tests/test_litellm/proxy/test_model_deprecations_endpoint.py b/tests/unit/proxy/test_model_deprecations_endpoint.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_deprecations_endpoint.pyrename to tests/unit/proxy/test_model_deprecations_endpoint.pydiff --git a/tests/test_litellm/proxy/test_model_dump_with_preserved_fields.py b/tests/unit/proxy/test_model_dump_with_preserved_fields.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_dump_with_preserved_fields.pyrename to tests/unit/proxy/test_model_dump_with_preserved_fields.pydiff --git a/tests/test_litellm/proxy/test_model_id_header_propagation.py b/tests/unit/proxy/test_model_id_header_propagation.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_id_header_propagation.pyrename to tests/unit/proxy/test_model_id_header_propagation.pydiff --git a/tests/test_litellm/proxy/test_model_info_default_limits.py b/tests/unit/proxy/test_model_info_default_limits.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_info_default_limits.pyrename to tests/unit/proxy/test_model_info_default_limits.pydiff --git a/tests/test_litellm/proxy/test_model_level_guardrails.py b/tests/unit/proxy/test_model_level_guardrails.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_level_guardrails.pyrename to tests/unit/proxy/test_model_level_guardrails.pydiff --git a/tests/test_litellm/proxy/test_model_list_aliases.py b/tests/unit/proxy/test_model_list_aliases.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_list_aliases.pyrename to tests/unit/proxy/test_model_list_aliases.pydiff --git a/tests/test_litellm/proxy/test_model_list_callback_filter.py b/tests/unit/proxy/test_model_list_callback_filter.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_list_callback_filter.pyrename to tests/unit/proxy/test_model_list_callback_filter.pydiff --git a/tests/test_litellm/proxy/test_model_list_discoverable.py b/tests/unit/proxy/test_model_list_discoverable.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_list_discoverable.pyrename to tests/unit/proxy/test_model_list_discoverable.pydiff --git a/tests/test_litellm/proxy/test_model_list_healthy_only.py b/tests/unit/proxy/test_model_list_healthy_only.pysimilarity index 100%rename from tests/test_litellm/proxy/test_model_list_healthy_only.pyrename to tests/unit/proxy/test_model_list_healthy_only.pydiff --git a/tests/test_litellm/proxy/test_modify_response_streaming_passthrough.py b/tests/unit/proxy/test_modify_response_streaming_passthrough.pysimilarity index 100%rename from tests/test_litellm/proxy/test_modify_response_streaming_passthrough.pyrename to tests/unit/proxy/test_modify_response_streaming_passthrough.pydiff --git a/tests/test_litellm/proxy/test_native_compaction.py b/tests/unit/proxy/test_native_compaction.pysimilarity index 100%rename from tests/test_litellm/proxy/test_native_compaction.pyrename to tests/unit/proxy/test_native_compaction.pydiff --git a/tests/test_litellm/proxy/test_openai_ws_passthrough_routes.py b/tests/unit/proxy/test_openai_ws_passthrough_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/test_openai_ws_passthrough_routes.pyrename to tests/unit/proxy/test_openai_ws_passthrough_routes.pydiff --git a/tests/test_litellm/proxy/test_openapi_schema_validation.py b/tests/unit/proxy/test_openapi_schema_validation.pysimilarity index 100%rename from tests/test_litellm/proxy/test_openapi_schema_validation.pyrename to tests/unit/proxy/test_openapi_schema_validation.pydiff --git a/tests/test_litellm/proxy/test_plugin_routes.py b/tests/unit/proxy/test_plugin_routes.pysimilarity index 100%rename from tests/test_litellm/proxy/test_plugin_routes.pyrename to tests/unit/proxy/test_plugin_routes.pydiff --git a/tests/test_litellm/proxy/test_pointfive_dashboard_config.py b/tests/unit/proxy/test_pointfive_dashboard_config.pysimilarity index 100%rename from tests/test_litellm/proxy/test_pointfive_dashboard_config.pyrename to tests/unit/proxy/test_pointfive_dashboard_config.pydiff --git a/tests/test_litellm/proxy/test_pointfive_ui_callback.py b/tests/unit/proxy/test_pointfive_ui_callback.pysimilarity index 100%rename from tests/test_litellm/proxy/test_pointfive_ui_callback.pyrename to tests/unit/proxy/test_pointfive_ui_callback.pydiff --git a/tests/test_litellm/proxy/test_pricing_field_strip.py b/tests/unit/proxy/test_pricing_field_strip.pysimilarity index 100%rename from tests/test_litellm/proxy/test_pricing_field_strip.pyrename to tests/unit/proxy/test_pricing_field_strip.pydiff --git a/tests/test_litellm/proxy/test_prisma_engine_watchdog.py b/tests/unit/proxy/test_prisma_engine_watchdog.pysimilarity index 100%rename from tests/test_litellm/proxy/test_prisma_engine_watchdog.pyrename to tests/unit/proxy/test_prisma_engine_watchdog.pydiff --git a/tests/test_litellm/proxy/test_prisma_migration.py b/tests/unit/proxy/test_prisma_migration.pysimilarity index 100%rename from tests/test_litellm/proxy/test_prisma_migration.pyrename to tests/unit/proxy/test_prisma_migration.pydiff --git a/tests/test_litellm/proxy/test_prometheus_cleanup.py b/tests/unit/proxy/test_prometheus_cleanup.pysimilarity index 100%rename from tests/test_litellm/proxy/test_prometheus_cleanup.pyrename to tests/unit/proxy/test_prometheus_cleanup.pydiff --git a/tests/test_litellm/proxy/test_prometheus_metrics_server.py b/tests/unit/proxy/test_prometheus_metrics_server.pysimilarity index 100%rename from tests/test_litellm/proxy/test_prometheus_metrics_server.pyrename to tests/unit/proxy/test_prometheus_metrics_server.pydiff --git a/tests/test_litellm/proxy/test_provider_url_destination_guard.py b/tests/unit/proxy/test_provider_url_destination_guard.pysimilarity index 100%rename from tests/test_litellm/proxy/test_provider_url_destination_guard.pyrename to tests/unit/proxy/test_provider_url_destination_guard.pydiff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/unit/proxy/test_proxy_cli.pysimilarity index 99%rename from tests/test_litellm/proxy/test_proxy_cli.pyrename to tests/unit/proxy/test_proxy_cli.pyindex a275dd62400..7007189aab9 100644--- a/tests/test_litellm/proxy/test_proxy_cli.py+++ b/tests/unit/proxy/test_proxy_cli.py@@ -2575,7 +2575,7 @@ class TestWorkerStartupHooks:from litellm.proxy.proxy_server import proxy_startup_eventenv_overrides = {- "LITELLM_WORKER_STARTUP_HOOKS": "tests.test_litellm.proxy.test_proxy_cli:_dummy_hook",+ "LITELLM_WORKER_STARTUP_HOOKS": "tests.unit.proxy.test_proxy_cli:_dummy_hook",}# Remove DATABASE_URL to avoid real DB setupclean_env = {@@ -2603,7 +2603,7 @@ class TestWorkerStartupHooks:from litellm.proxy.proxy_server import proxy_startup_eventenv_overrides = {- "LITELLM_WORKER_STARTUP_HOOKS": "tests.test_litellm.proxy.test_proxy_cli:_dummy_async_hook",+ "LITELLM_WORKER_STARTUP_HOOKS": "tests.unit.proxy.test_proxy_cli:_dummy_async_hook",}clean_env = {k: v@@ -2627,7 +2627,7 @@ class TestWorkerStartupHooks:from litellm.proxy.proxy_server import proxy_startup_eventenv_overrides = {- "LITELLM_WORKER_STARTUP_HOOKS": "tests.test_litellm.proxy.test_proxy_cli:_failing_hook",+ "LITELLM_WORKER_STARTUP_HOOKS": "tests.unit.proxy.test_proxy_cli:_failing_hook",}clean_env = {k: v@@ -2663,8 +2663,8 @@ class TestWorkerStartupHooks:from litellm.proxy.proxy_server import proxy_startup_eventhooks = (- "tests.test_litellm.proxy.test_proxy_cli:_dummy_hook,"- "tests.test_litellm.proxy.test_proxy_cli:_dummy_async_hook"+ "tests.unit.proxy.test_proxy_cli:_dummy_hook,"+ "tests.unit.proxy.test_proxy_cli:_dummy_async_hook")env_overrides = {"LITELLM_WORKER_STARTUP_HOOKS": hooks,diff --git a/tests/test_litellm/proxy/test_proxy_logging_hook_detection.py b/tests/unit/proxy/test_proxy_logging_hook_detection.pysimilarity index 100%rename from tests/test_litellm/proxy/test_proxy_logging_hook_detection.pyrename to tests/unit/proxy/test_proxy_logging_hook_detection.pydiff --git a/tests/test_litellm/proxy/test_proxy_types.py b/tests/unit/proxy/test_proxy_types.pysimilarity index 100%rename from tests/test_litellm/proxy/test_proxy_types.pyrename to tests/unit/proxy/test_proxy_types.pydiff --git a/tests/test_litellm/proxy/test_pyroscope.py b/tests/unit/proxy/test_pyroscope.pysimilarity index 100%rename from tests/test_litellm/proxy/test_pyroscope.pyrename to tests/unit/proxy/test_pyroscope.pydiff --git a/tests/test_litellm/proxy/test_read_model_list.py b/tests/unit/proxy/test_read_model_list.pysimilarity index 100%rename from tests/test_litellm/proxy/test_read_model_list.pyrename to tests/unit/proxy/test_read_model_list.pydiff --git a/tests/test_litellm/proxy/test_redis_auth_cache_flag.py b/tests/unit/proxy/test_redis_auth_cache_flag.pysimilarity index 98%rename from tests/test_litellm/proxy/test_redis_auth_cache_flag.pyrename to tests/unit/proxy/test_redis_auth_cache_flag.pyindex 573bfc40c96..cb600bbb5fd 100644--- a/tests/test_litellm/proxy/test_redis_auth_cache_flag.py+++ b/tests/unit/proxy/test_redis_auth_cache_flag.py@@ -65,6 +65,7 @@ def _patched_init_cache(litellm_settings: dict, cache_params: dict):fresh_user_cache = DualCache()fresh_spend_cache = DualCache()fresh_cli_sso_cache = DualCache()+ fresh_config_cache = DualCache()enable_redis_auth_cache = litellm_settings.get("enable_redis_auth_cache", False)@@ -72,6 +73,7 @@ def _patched_init_cache(litellm_settings: dict, cache_params: dict):patch.object(ps, "user_api_key_cache", fresh_user_cache),patch.object(ps, "spend_counter_cache", fresh_spend_cache),patch.object(ps, "cli_sso_session_cache", fresh_cli_sso_cache),+ patch.object(ps, "litellm_config_cache", fresh_config_cache),patch.object(ps, "llm_router", None),# Cache is locally imported inside _init_cache: patch it at source.patch("litellm.Cache", return_value=mock_litellm_cache),diff --git a/tests/test_litellm/proxy/test_response_model_sanitization.py b/tests/unit/proxy/test_response_model_sanitization.pysimilarity index 100%rename from tests/test_litellm/proxy/test_response_model_sanitization.pyrename to tests/unit/proxy/test_response_model_sanitization.pydiff --git a/tests/test_litellm/proxy/test_route_a2a_models.py b/tests/unit/proxy/test_route_a2a_models.pysimilarity index 100%rename from tests/test_litellm/proxy/test_route_a2a_models.pyrename to tests/unit/proxy/test_route_a2a_models.pydiff --git a/tests/test_litellm/proxy/test_route_llm_request.py b/tests/unit/proxy/test_route_llm_request.pysimilarity index 100%rename from tests/test_litellm/proxy/test_route_llm_request.pyrename to tests/unit/proxy/test_route_llm_request.pydiff --git a/tests/test_litellm/proxy/test_route_priority.py b/tests/unit/proxy/test_route_priority.pysimilarity index 100%rename from tests/test_litellm/proxy/test_route_priority.pyrename to tests/unit/proxy/test_route_priority.pydiff --git a/tests/test_litellm/proxy/test_sensitive_route_auth.py b/tests/unit/proxy/test_sensitive_route_auth.pysimilarity index 100%rename from tests/test_litellm/proxy/test_sensitive_route_auth.pyrename to tests/unit/proxy/test_sensitive_route_auth.pydiff --git a/tests/test_litellm/proxy/test_shared_health_check.py b/tests/unit/proxy/test_shared_health_check.pysimilarity index 100%rename from tests/test_litellm/proxy/test_shared_health_check.pyrename to tests/unit/proxy/test_shared_health_check.pydiff --git a/tests/test_litellm/proxy/test_spend_log_cleanup.py b/tests/unit/proxy/test_spend_log_cleanup.pysimilarity index 100%rename from tests/test_litellm/proxy/test_spend_log_cleanup.pyrename to tests/unit/proxy/test_spend_log_cleanup.pydiff --git a/tests/test_litellm/proxy/test_swagger_chat_completions.py b/tests/unit/proxy/test_swagger_chat_completions.pysimilarity index 100%rename from tests/test_litellm/proxy/test_swagger_chat_completions.pyrename to tests/unit/proxy/test_swagger_chat_completions.pydiff --git a/tests/test_litellm/proxy/test_team_member_update.py b/tests/unit/proxy/test_team_member_update.pysimilarity index 100%rename from tests/test_litellm/proxy/test_team_member_update.pyrename to tests/unit/proxy/test_team_member_update.pydiff --git a/tests/test_litellm/proxy/test_team_org_move.py b/tests/unit/proxy/test_team_org_move.pysimilarity index 100%rename from tests/test_litellm/proxy/test_team_org_move.pyrename to tests/unit/proxy/test_team_org_move.pydiff --git a/tests/test_litellm/proxy/test_tools_allowlist_enforcement.py b/tests/unit/proxy/test_tools_allowlist_enforcement.pysimilarity index 100%rename from tests/test_litellm/proxy/test_tools_allowlist_enforcement.pyrename to tests/unit/proxy/test_tools_allowlist_enforcement.pydiff --git a/tests/test_litellm/proxy/test_tracing_endpoints.py b/tests/unit/proxy/test_tracing_endpoints.pysimilarity index 100%rename from tests/test_litellm/proxy/test_tracing_endpoints.pyrename to tests/unit/proxy/test_tracing_endpoints.pydiff --git a/tests/test_litellm/proxy/test_update_llm_router_resilience.py b/tests/unit/proxy/test_update_llm_router_resilience.pysimilarity index 100%rename from tests/test_litellm/proxy/test_update_llm_router_resilience.pyrename to tests/unit/proxy/test_update_llm_router_resilience.pydiff --git a/tests/test_litellm/proxy/test_zerobus_dashboard_config.py b/tests/unit/proxy/test_zerobus_dashboard_config.pysimilarity index 100%rename from tests/test_litellm/proxy/test_zerobus_dashboard_config.pyrename to tests/unit/proxy/test_zerobus_dashboard_config.pydiff --git a/tests/unit/proxy/types_utils/__init__.py b/tests/unit/proxy/types_utils/__init__.pynew file mode 100644index 00000000000..e69de29bb2ddiff --git a/tests/test_litellm/proxy/types_utils/test_db_overlay_remote_module_scrub.py b/tests/unit/proxy/types_utils/test_db_overlay_remote_module_scrub.pysimilarity index 100%rename from tests/test_litellm/proxy/types_utils/test_db_overlay_remote_module_scrub.pyrename to tests/unit/proxy/types_utils/test_db_overlay_remote_module_scrub.pydiff --git a/tests/test_litellm/proxy/types_utils/test_get_instance_fn_runtime_gate.py b/tests/unit/proxy/types_utils/test_get_instance_fn_runtime_gate.pysimilarity index 100%rename from tests/test_litellm/proxy/types_utils/test_get_instance_fn_runtime_gate.pyrename to tests/unit/proxy/types_utils/test_get_instance_fn_runtime_gate.py