From c9108d43e004b71470c94a0c75d515cefcc9a635 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 9 Apr 2024 15:12:09 -0700 Subject: [PATCH] fix - return stack trace on failing /health checks --- litellm/main.py | 6 ++++- ...odel_prices_and_context_window_backup.json | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/litellm/main.py b/litellm/main.py index 1ee16f36f..29e76c826 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -3809,11 +3809,15 @@ async def ahealth_check( return response except Exception as e: traceback.print_exc() + stack_trace = traceback.format_exc() + if isinstance(stack_trace, str): + stack_trace = stack_trace[:1000] if model not in litellm.model_cost and mode is None: raise Exception( "Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models" ) - return {"error": f"{str(e)}"} + error_to_return = str(e) + " stack trace: " + stack_trace + return {"error": error_to_return} ####### HELPER FUNCTIONS ################ diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index dd37961a2..6788f82a5 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -66,6 +66,28 @@ "litellm_provider": "openai", "mode": "chat" }, + "gpt-4-turbo": { + "max_tokens": 4096, + "max_input_tokens": 128000, + "max_output_tokens": 4096, + "input_cost_per_token": 0.00001, + "output_cost_per_token": 0.00003, + "litellm_provider": "openai", + "mode": "chat", + "supports_function_calling": true, + "supports_parallel_function_calling": true + }, + "gpt-4-turbo-2024-04-09": { + "max_tokens": 4096, + "max_input_tokens": 128000, + "max_output_tokens": 4096, + "input_cost_per_token": 0.00001, + "output_cost_per_token": 0.00003, + "litellm_provider": "openai", + "mode": "chat", + "supports_function_calling": true, + "supports_parallel_function_calling": true + }, "gpt-4-1106-preview": { "max_tokens": 4096, "max_input_tokens": 128000,