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
Litellm dev 01 02 2025 p1 (#7516)
Krish Dholakia33f301ec8620
diff --git a/litellm/litellm_core_utils/redact_messages.py b/litellm/litellm_core_utils/redact_messages.pyindex 3be27c44dfd..3d0cec8d727 100644--- a/litellm/litellm_core_utils/redact_messages.py+++ b/litellm/litellm_core_utils/redact_messages.py@@ -70,7 +70,7 @@ def perform_redaction(model_call_details: dict, result):choice.delta.content = "redacted-by-litellm"return _resultelse:- return "redacted-by-litellm"+ return {"text": "redacted-by-litellm"}def redact_message_input_output_from_logging(diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yamlindex dc7bf9d62b3..61dc6774c09 100644--- a/litellm/proxy/_new_secret_config.yaml+++ b/litellm/proxy/_new_secret_config.yaml@@ -1,5 +1,5 @@model_list:- - model_name: openai/gpt-3.5-turbo+ - model_name: azure-embedding-modellitellm_params:model: openai/gpt-3.5-turboapi_key: os.environ/OPENAI_API_KEY@@ -12,16 +12,4 @@ model_list:prompt_id: "jokes"litellm_settings:- default_team_settings:- - team_id: "team_1"- success_callback: ["langfuse"]- failure_callback: ["langfuse"]- langfuse_public_key: os.environ/LANGFUSE_PUBLIC_KEY- langfuse_secret: os.environ/LANGFUSE_SECRET_KEY- langfuse_host: os.environ/LANGFUSE_HOST- - team_id: "team_2"- success_callback: ["langfuse"]- failure_callback: ["langfuse"]- langfuse_public_key: os.environ/LANGFUSE_PROJECT3_PUBLIC- langfuse_secret: os.environ/LANGFUSE_PROJECT3_SECRET- langfuse_host: os.environ/LANGFUSE_HOST\ No newline at end of file+ callbacks: ["otel"]\ No newline at end of filediff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 2760ad9f7aa..0e614b0ae3d 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -1862,8 +1862,12 @@ class ProxyConfig:try:TeamDefaultSettings(**team_setting)except Exception:+ if isinstance(team_setting, dict):+ raise Exception(+ f"team_id missing from default_team_settings at index={idx}\npassed in value={team_setting.keys()}"+ )raise Exception(- f"team_id missing from default_team_settings at index={idx}\npassed in value={team_setting}"+ f"team_id missing from default_team_settings at index={idx}\npassed in value={type(team_setting)}")verbose_proxy_logger.debug(f"{blue_color_code} setting litellm.{key}={value}{reset_color_code}"diff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.pyindex 747174279f8..911defd0b4d 100644--- a/tests/local_testing/test_custom_callback_input.py+++ b/tests/local_testing/test_custom_callback_input.py@@ -1264,7 +1264,7 @@ def test_standard_logging_payload(model, turn_off_message_logging):if turn_off_message_logging:print("checks redacted-by-litellm")assert "redacted-by-litellm" == slobject["messages"][0]["content"]- assert "redacted-by-litellm" == slobject["response"]+ assert {"text": "redacted-by-litellm"} == slobject["response"]@pytest.mark.parametrize(@@ -1358,7 +1358,7 @@ def test_standard_logging_payload_audio(turn_off_message_logging, stream):if turn_off_message_logging:print("checks redacted-by-litellm")assert "redacted-by-litellm" == slobject["messages"][0]["content"]- assert "redacted-by-litellm" == slobject["response"]+ assert {"text": "redacted-by-litellm"} == slobject["response"]@pytest.mark.skip(reason="Works locally. Flaky on ci/cd")@@ -1467,7 +1467,9 @@ def test_logging_async_cache_hit_sync_call(turn_off_message_logging):"redacted-by-litellm"== standard_logging_object["messages"][0]["content"])- assert "redacted-by-litellm" == standard_logging_object["response"]+ assert {"text": "redacted-by-litellm"} == standard_logging_object[+ "response"+ ]def test_logging_standard_payload_failure_call():diff --git a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py b/tests/logging_callback_tests/test_logging_redaction_e2e_test.pyindex ea821e78806..5a5b720b2e0 100644--- a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py+++ b/tests/logging_callback_tests/test_logging_redaction_e2e_test.py@@ -45,7 +45,7 @@ async def test_global_redaction_on():await asyncio.sleep(1)standard_logging_payload = test_custom_logger.logged_standard_logging_payloadassert standard_logging_payload is not None- assert standard_logging_payload["response"] == "redacted-by-litellm"+ assert standard_logging_payload["response"] == {"text": "redacted-by-litellm"}assert standard_logging_payload["messages"][0]["content"] == "redacted-by-litellm"print("logged standard logging payload",@@ -75,7 +75,7 @@ async def test_global_redaction_with_dynamic_params(turn_off_message_logging):)if turn_off_message_logging is True:- assert standard_logging_payload["response"] == "redacted-by-litellm"+ assert standard_logging_payload["response"] == {"text": "redacted-by-litellm"}assert (standard_logging_payload["messages"][0]["content"] == "redacted-by-litellm")@@ -108,7 +108,7 @@ async def test_global_redaction_off_with_dynamic_params(turn_off_message_loggingjson.dumps(standard_logging_payload, indent=2),)if turn_off_message_logging is True:- assert standard_logging_payload["response"] == "redacted-by-litellm"+ assert standard_logging_payload["response"] == {"text": "redacted-by-litellm"}assert (standard_logging_payload["messages"][0]["content"] == "redacted-by-litellm")