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 whitelisted models
Ishaan Jaff6b623f9c9817
diff --git a/tests/litellm_utils_tests/test_utils.py b/tests/litellm_utils_tests/test_utils.pyindex b59b95d3f54..fe5ab1d4dee 100644--- a/tests/litellm_utils_tests/test_utils.py+++ b/tests/litellm_utils_tests/test_utils.py@@ -2230,3 +2230,25 @@ def test_get_valid_models_from_dynamic_api_key():valid_models = get_valid_models(custom_llm_provider="anthropic", litellm_params=creds, check_provider_endpoint=True)assert len(valid_models) > 0assert "anthropic/claude-3-7-sonnet-20250219" in valid_models++++def test_get_whitelisted_models():+ """+ Snapshot of all bedrock models as of 12/24/2024.++ Enforce any new bedrock chat model to be added as `bedrock_converse` unless explicitly whitelisted.++ Create whitelist to prevent naming regressions for older litellm versions.+ """+ whitelisted_models = []+ for model, info in litellm.model_cost.items():+ if info["litellm_provider"] == "bedrock" and info["mode"] == "chat":+ whitelisted_models.append(model)++ # Write to a local file+ with open("whitelisted_bedrock_models.txt", "w") as file:+ for model in whitelisted_models:+ file.write(f"{model}\n")++ print("whitelisted_models written to whitelisted_bedrock_models.txt")\ No newline at end of filediff --git a/tests/local_testing/test_get_model_info.py b/tests/local_testing/test_get_model_info.pyindex 40e52c8173b..823f03185d5 100644--- a/tests/local_testing/test_get_model_info.py+++ b/tests/local_testing/test_get_model_info.py@@ -158,26 +158,6 @@ def test_get_model_info_ft_model_with_provider_prefix():assert info["key"] == "ft:gpt-3.5-turbo"-def test_get_whitelisted_models():- """- Snapshot of all bedrock models as of 12/24/2024.-- Enforce any new bedrock chat model to be added as `bedrock_converse` unless explicitly whitelisted.-- Create whitelist to prevent naming regressions for older litellm versions.- """- whitelisted_models = []- for model, info in litellm.model_cost.items():- if info["litellm_provider"] == "bedrock" and info["mode"] == "chat":- whitelisted_models.append(model)-- # Write to a local file- with open("whitelisted_bedrock_models.txt", "w") as file:- for model in whitelisted_models:- file.write(f"{model}\n")-- print("whitelisted_models written to whitelisted_bedrock_models.txt")-def _enforce_bedrock_converse_models(model_cost: List[Dict[str, Any]], whitelist_models: List[str]