Add datadog health check support + fix bedrock converse cost tracking w/ region name specified (#7958)

* fix(bedrock/converse_handler.py): fix bedrock region name on async calls

* fix(utils.py): fix split model handling

Fixes bedrock cost calculation when region name is given

* feat(_health_endpoints.py): support health checking datadog integration

Closes https://github.com/BerriAI/litellm/issues/7921
This commit is contained in:
Krish Dholakia 2025-01-23 22:17:09 -08:00 committed by GitHub
parent c0e83ab377
commit fe460f19f5
13 changed files with 254 additions and 33 deletions

View file

@ -539,17 +539,19 @@ class BaseLLMChatTest(ABC):
return url
def test_completion_cost(self):
@pytest.mark.asyncio
async def test_completion_cost(self):
from litellm import completion_cost
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")
litellm.set_verbose = True
response = self.completion_function(
response = await self.async_completion_function(
**self.get_base_completion_call_args(),
messages=[{"role": "user", "content": "Hello, how are you?"}],
)
print(response._hidden_params)
cost = completion_cost(response)
assert cost > 0