LiteLLM Minor Fixes and Improvements (09/10/2024) (#5618)

* fix(cost_calculator.py): move to debug for noisy warning message on cost calculation error

Fixes https://github.com/BerriAI/litellm/issues/5610

* fix(databricks/cost_calculator.py): Handles model name issues for databricks models

* fix(main.py): fix stream chunk builder for multiple tool calls

Fixes https://github.com/BerriAI/litellm/issues/5591

* fix: correctly set user_alias when passed in

Fixes https://github.com/BerriAI/litellm/issues/5612

* fix(types/utils.py): allow passing role for message object

https://github.com/BerriAI/litellm/issues/5621

* fix(litellm_logging.py): Fix langfuse logging across multiple projects

Fixes issue where langfuse logger was re-using the old logging object

* feat(proxy/_types.py): support adding key-based tags for tag-based routing

Enable tag based routing at key-level

* fix(proxy/_types.py): fix inheritance

* test(test_key_generate_prisma.py): fix test

* test: fix test

* fix(litellm_logging.py): return used callback object
This commit is contained in:
Krish Dholakia 2024-09-11 11:30:29 -07:00 committed by GitHub
parent d6e0d5d234
commit 7f47c48b35
15 changed files with 673 additions and 96 deletions

View file

@ -2762,6 +2762,7 @@ async def test_generate_key_with_model_tpm_limit(prisma_client):
"team": "litellm-team3",
"model_tpm_limit": {"gpt-4": 100},
"model_rpm_limit": {"gpt-4": 2},
"tags": None,
}
# Update model tpm_limit and rpm_limit
@ -2782,6 +2783,7 @@ async def test_generate_key_with_model_tpm_limit(prisma_client):
"team": "litellm-team3",
"model_tpm_limit": {"gpt-4": 200},
"model_rpm_limit": {"gpt-4": 3},
"tags": None,
}
@ -2818,6 +2820,7 @@ async def test_generate_key_with_guardrails(prisma_client):
assert result["info"]["metadata"] == {
"team": "litellm-team3",
"guardrails": ["aporia-pre-call"],
"tags": None,
}
# Update model tpm_limit and rpm_limit
@ -2836,6 +2839,7 @@ async def test_generate_key_with_guardrails(prisma_client):
assert result["info"]["metadata"] == {
"team": "litellm-team3",
"guardrails": ["aporia-pre-call", "aporia-post-call"],
"tags": None,
}