diff --git a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py index 314f68e87..35cff0db3 100644 --- a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py +++ b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py @@ -118,6 +118,8 @@ class AnthropicPassthroughLoggingHandler: # set litellm_call_id to logging response object litellm_model_response.id = logging_obj.litellm_call_id + litellm_model_response.model = model + logging_obj.model_call_details["model"] = model return kwargs @staticmethod diff --git a/tests/pass_through_tests/test_anthropic_passthrough.py b/tests/pass_through_tests/test_anthropic_passthrough.py index 277adcdb9..b062a025a 100644 --- a/tests/pass_through_tests/test_anthropic_passthrough.py +++ b/tests/pass_through_tests/test_anthropic_passthrough.py @@ -150,6 +150,8 @@ async def test_anthropic_basic_completion_with_headers(): "user_api_key" in log_entry["metadata"] ), "Should have user API key in metadata" + assert "claude" in log_entry["model"] + @pytest.mark.asyncio async def test_anthropic_streaming_with_headers(): @@ -257,3 +259,5 @@ async def test_anthropic_streaming_with_headers(): assert ( "user_api_key" in log_entry["metadata"] ), "Should have user API key in metadata" + + assert "claude" in log_entry["model"]