Commit graph

22 commits

Author SHA1 Message Date
Krish Dholakia
dd602753c0
Litellm fix router testing (#5748)
* test: fix testing - azure changed content policy error logic

* test: fix tests to use mock responses

* test(test_image_generation.py): handle api instability

* test(test_image_generation.py): handle azure api instability

* fix(utils.py): fix unbounded variable error

* fix(utils.py): fix unbounded variable error

* test: refactor test to use mock response

* test: mark flaky azure tests
2024-09-17 18:02:23 -07:00
Ishaan Jaff
c8d15544c8
[Fix] Router cooldown logic - use % thresholds instead of allowed fails to cooldown deployments (#5698)
* move cooldown logic to it's own helper

* add new track deployment metrics folder

* increment success, fails for deployment in current minute

* fix cooldown logic

* fix test_aaarouter_dynamic_cooldown_message_retry_time

* fix test_single_deployment_no_cooldowns_test_prod_mock_completion_calls

* clean up get from deployment test

* fix _async_get_healthy_deployments

* add mock InternalServerError

* test deployment failing 25% requests

* add test_high_traffic_cooldowns_one_bad_deployment

* fix vertex load test

* add test for rate limit error models in cool down

* change default cooldown time

* fix cooldown message time

* fix cooldown on 429 error

* fix doc string for _should_cooldown_deployment

* fix sync cooldown logic router
2024-09-14 18:01:19 -07:00
Krish Dholakia
98c34a7e27
LiteLLM Minor Fixes and Improvements (11/09/2024) (#5634)
* fix(caching.py): set ttl for async_increment cache

fixes issue where ttl for redis client was not being set on increment_cache

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

* fix(caching.py): fix increment cache w/ ttl for sync increment cache on redis

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

* fix(router.py): support adding retry policy + allowed fails policy via config.yaml

* fix(router.py): don't cooldown single deployments

No point, as there's no other deployment to loadbalance with.

* fix(user_api_key_auth.py): support setting allowed email domains on jwt tokens

Closes https://github.com/BerriAI/litellm/issues/5605

* docs(token_auth.md): add user upsert + allowed email domain to jwt auth docs

* fix(litellm_pre_call_utils.py): fix dynamic key logging when team id is set

Fixes issue where key logging would not be set if team metadata was not none

* fix(secret_managers/main.py): load environment variables correctly

Fixes issue where os.environ/ was not being loaded correctly

* test(test_router.py): fix test

* feat(spend_tracking_utils.py): support logging additional usage params - e.g. prompt caching values for deepseek

* test: fix tests

* test: fix test

* test: fix test

* test: fix test

* test: fix test
2024-09-11 22:36:06 -07:00
Ishaan Jaff
cae9245b33 fix router retries tests 2024-08-20 13:02:24 -07:00
Ishaan Jaff
e28b240a5b fix don't retry errors when no healthy deployments available 2024-08-20 12:17:05 -07:00
Ishaan Jaff
19c3a82d1b test + never retry on 404 errors 2024-08-20 11:59:43 -07:00
Krrish Dholakia
5f99938cb8 test(test_amazing_vertex_completion.py): add retries for 'Content has no parts.' error in vertex test 2024-06-03 14:06:36 -07:00
Krrish Dholakia
a019fd05e3 fix(router.py): fix should_retry logic for authentication errors 2024-06-03 13:12:00 -07:00
Ishaan Jaff
054456c50e
Merge pull request #3963 from BerriAI/litellm_set_allowed_fail_policy
[FEAT]- set custom AllowedFailsPolicy on litellm.Router
2024-06-01 17:57:11 -07:00
Ishaan Jaff
4eaeec2a2d feat - set allowed fails policy 2024-06-01 17:39:44 -07:00
Ishaan Jaff
3caa9dfec6 add test 2024-06-01 17:03:53 -07:00
Krrish Dholakia
183dd81087 fix(router.py): fix should_retry logic 2024-05-31 23:27:43 -07:00
Ishaan Jaff
beac60ed12 test - router retry policy 2024-05-11 19:58:17 -07:00
Ishaan Jaff
32e445c59d fix - unit tests for router retries 2024-05-11 19:10:33 -07:00
Ishaan Jaff
4e844d7438 test - unit tests for time to sleep when there are rate limit errors 2024-05-11 18:13:28 -07:00
Ishaan Jaff
ed8a25c630 tests - unit test router retry logic 2024-05-11 17:31:01 -07:00
Krrish Dholakia
e95be13f10 fix(router.py): fix router retry policy logic 2024-05-04 23:02:50 -07:00
Ishaan Jaff
f09da3f14c test - test setting retry policies per model groups 2024-05-04 20:40:56 -07:00
Ishaan Jaff
495d3a9646 router set dynamic retry policies 2024-05-04 18:13:43 -07:00
Ishaan Jaff
8d128a4b91 test - router retry policy 2024-05-04 17:30:30 -07:00
Ishaan Jaff
9e4e467039 test router - retry policy 2024-05-04 17:06:34 -07:00
Krrish Dholakia
1baad80c7d fix(router.py): cooldown deployments, for 401 errors 2024-04-30 17:54:00 -07:00