Skip to content

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]

fix(tests): remove test_completion_bedrock_claude_sts_oidc_auth and test_completion_bedrock_httpx_command_r_sts_oidc_auth that depend on external infra

yuneng-jiang25e161a0fa19
diff --git a/tests/llm_translation/test_bedrock_completion.py b/tests/llm_translation/test_bedrock_completion.py
index 40ef2c32831..b71e4e51877 100644
--- a/tests/llm_translation/test_bedrock_completion.py
+++ b/tests/llm_translation/test_bedrock_completion.py
@@ -496,110 +496,6 @@ def test_completion_bedrock_claude_aws_bedrock_client(bedrock_session_token_cred
# test_completion_bedrock_claude_sts_client_auth()
- os.environ.get("CIRCLE_OIDC_TOKEN_V2") is None,
- reason="Cannot run without being in CircleCI Runner",
-)
-def test_completion_bedrock_claude_sts_oidc_auth():
- print("\ncalling bedrock claude with oidc auth")
- import os
-
- aws_web_identity_token = "oidc/circleci_v2/"
- aws_region_name = os.environ["AWS_REGION_NAME"]
- # aws_role_name = os.environ["AWS_TEMP_ROLE_NAME"]
- # TODO: This is using ai.moda's IAM role, we should use LiteLLM's IAM role eventually
- aws_role_name = "arn:aws:iam::335785316107:role/litellm-github-unit-tests-circleci"
-
- try:
- litellm.set_verbose = True
-
- response_1 = completion(
- model="bedrock/anthropic.claude-3-haiku-20240307-v1:0",
- messages=messages,
- max_tokens=10,
- temperature=0.1,
- aws_region_name=aws_region_name,
- aws_web_identity_token=aws_web_identity_token,
- aws_role_name=aws_role_name,
- aws_session_name="my-test-session",
- )
- print(response_1)
- assert len(response_1.choices) > 0
- assert len(response_1.choices[0].message.content) > 0
-
- # This second call is to verify that the cache isn't breaking anything
- response_2 = completion(
- model="bedrock/anthropic.claude-3-haiku-20240307-v1:0",
- messages=messages,
- max_tokens=5,
- temperature=0.2,
- aws_region_name=aws_region_name,
- aws_web_identity_token=aws_web_identity_token,
- aws_role_name=aws_role_name,
- aws_session_name="my-test-session",
- )
- print(response_2)
- assert len(response_2.choices) > 0
- assert len(response_2.choices[0].message.content) > 0
-
- # This third call is to verify that the cache isn't used for a different region
- response_3 = completion(
- model="bedrock/anthropic.claude-3-haiku-20240307-v1:0",
- messages=messages,
- max_tokens=6,
- temperature=0.3,
- aws_region_name="us-east-1",
- aws_web_identity_token=aws_web_identity_token,
- aws_role_name=aws_role_name,
- aws_session_name="my-test-session",
- )
- print(response_3)
- assert len(response_3.choices) > 0
- assert len(response_3.choices[0].message.content) > 0
-
- except RateLimitError:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
- os.environ.get("CIRCLE_OIDC_TOKEN_V2") is None,
- reason="Cannot run without being in CircleCI Runner",
-)
-def test_completion_bedrock_httpx_command_r_sts_oidc_auth():
- print("\ncalling bedrock httpx command r with oidc auth")
- import os
-
- aws_web_identity_token = "oidc/circleci_v2/"
- aws_region_name = "us-west-2"
- # aws_role_name = os.environ["AWS_TEMP_ROLE_NAME"]
- # TODO: This is using ai.moda's IAM role, we should use LiteLLM's IAM role eventually
- aws_role_name = "arn:aws:iam::335785316107:role/litellm-github-unit-tests-circleci"
-
- try:
- litellm.set_verbose = True
-
- response = completion(
- model="bedrock/cohere.command-r-v1:0",
- messages=messages,
- max_tokens=10,
- temperature=0.1,
- aws_region_name=aws_region_name,
- aws_web_identity_token=aws_web_identity_token,
- aws_role_name=aws_role_name,
- aws_session_name="cross-region-test",
- aws_sts_endpoint="https://sts-fips.us-east-2.amazonaws.com",
- aws_bedrock_runtime_endpoint="https://bedrock-runtime-fips.us-west-2.amazonaws.com",
- )
- # Add any assertions here to check the response
- print(response)
- except RateLimitError:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
@pytest.mark.parametrize(
"image_url",
[