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
Fix flaky tests: anthropic error_msg state leak and vertex llama 404
yuneng-jiang4030a8b2cd8c
diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.pyindex 7c66dd55d78..6f7c371bdb5 100644--- a/tests/local_testing/test_amazing_vertex_completion.py+++ b/tests/local_testing/test_amazing_vertex_completion.py@@ -3691,6 +3691,8 @@ def test_vertex_ai_llama_tool_calling():response = completion(**args)except litellm.RateLimitError:pytest.skip("Rate limit error")+ except litellm.NotFoundError:+ pytest.skip("Model not found / resource unavailable")print(response)assert response.choices[0].message.tool_calls is not Nonediff --git a/tests/local_testing/test_function_calling.py b/tests/local_testing/test_function_calling.pyindex e47b32a01f3..1597ab691a9 100644--- a/tests/local_testing/test_function_calling.py+++ b/tests/local_testing/test_function_calling.py@@ -333,6 +333,10 @@ def test_parallel_function_call_anthropic_error_msg(Reference Issue: https://github.com/BerriAI/litellm/issues/5747, https://github.com/BerriAI/litellm/issues/5388"""+ # Ensure modify_params is False so UnsupportedParamsError is raised+ # (other tests in this file set it to True and don't reset it)+ original_modify_params = litellm.modify_params+ litellm.modify_params = Falsetry:litellm.set_verbose = True@@ -363,6 +367,8 @@ def test_parallel_function_call_anthropic_error_msg(print(e)except Exception as e:pytest.fail(f"Error occurred: {e}")+ finally:+ litellm.modify_params = original_modify_paramsdef test_parallel_function_call_stream():