Commit Graph

72 Commits

Author SHA1 Message Date
yuneng-jiang 6e8dd06d18 fixing test 2026-01-16 19:06:23 -08:00
yuneng-jiang 809b4cb310 Revert "Revert "[Feature] Deleted Keys and Deleted Teams Table"" 2026-01-16 14:25:23 -08:00
YutaSaito 034e3a6d44 Revert "[Feature] Deleted Keys and Deleted Teams Table" 2026-01-17 06:46:41 +09:00
yuneng-jiang bd4a893daf fixing tests 2026-01-16 12:42:35 -08:00
Ishaan Jaffer bab43ee9dd fix list keys 2026-01-07 14:34:37 +05:30
Alexsander Hamir e9baa83a0f [Fix] CI/CD – Clean Up Performance PR Changes & others (#17838) 2025-12-11 12:50:03 -08:00
Ishaan Jaff 06eeb28c8f Litellm ci cd fixes 2 (#16693)
* litellm_proxy_unit_testing_part1

* test proxy unit test

* litellm_proxy_unit_testing_key_generation

* test_async_call_with_key_over_model_budget

* test_aasync_call_with_key_over_model_budget
2025-11-15 14:12:44 -08:00
Ishaan Jaffer 666913f76d test_async_call_with_key_over_model_budget 2025-11-15 09:26:29 -08:00
Ishaan Jaffer 63994e302e test_call_with_key_over_model_budget 2025-11-14 19:05:00 -08:00
Ishaan Jaffer 9e8653ad3c fix prisma client 2025-11-14 18:25:27 -08:00
Ishaan Jaffer ee8b1cfabc test_call_with_end_user_over_budget 2025-11-13 16:26:02 -08:00
Ishaan Jaffer b5d81a5d9c test_completion_text_003_prompt_array, test_key_generate_with_secret_manager_call 2025-11-06 17:18:01 -08:00
Achintya Rajan 264f1cded1 Merge branch 'main' into litellm_view_key_pagination_calls_fix 2025-10-06 18:10:57 -07:00
Krrish Dholakia 63cb2764fe test: fix raise 2025-10-04 16:11:22 -07:00
= 6ba077593f Update test_key_generate_prisma.py 2025-10-04 14:36:19 -07:00
= 5e03ef7382 fixes bloated key alias network calls with lean endpoint 2025-10-04 14:32:15 -07:00
Alexsander Hamir eaa04cd8ce fix: use fastuuid helper (#14903)
* fix: use fastuuid helper across the codebase

First batch of changes, simple drop in replacement.

* second batch of changes

* fixed: script mistake on helper file
2025-09-25 15:47:01 -07:00
Mubashir Osmani a7a6381926 fix: flaky passthrough tests (#14692)
* fix: flaky passthrough tests

* Revert "fix: flaky passthrough tests"

This reverts commit ffe692e017600a8853ab7c31f95485958ab74c5f.

* fix: serialize prisma objects
2025-09-18 15:35:14 -07:00
Krrish Dholakia c45ede7187 test: update test 2025-09-09 21:31:34 -07:00
Ishaan Jaff 2cc85936ed Revert "Security fix - prevent proxy_admin_viewer from modifying other user's credentials + remove hardcoded sensitive keys from test repo" (#14362) 2025-09-08 18:40:54 -07:00
Krrish Dholakia 06d472f205 test: fix tests 2025-09-06 21:59:02 -07:00
Krrish Dholakia 952c2b5215 test: update test 2025-08-01 09:07:53 -07:00
Ishaan Jaff 50466e0077 test_user_api_key_auth 2025-07-29 18:01:40 -07:00
Ishaan Jaff 0c19414b36 [️ Python SDK import] - reduce python sdk import time by .3s (#12140)
* use 1 file for KeyManagementSystem

* move key management settings

* fix import locs

* test_proxy_types_not_imported

* test the import loc

* fix import item

* fix imports

* fix import loc

* fix imports
2025-06-28 14:57:10 -07:00
Ishaan Jaff e3094c2249 set flaky tests as flaky 2025-06-14 13:51:52 -07:00
Krish Dholakia 39de3610be fix(internal_user_endpoints.py): support user with + in email on us… (#11601)
* fix(internal_user_endpoints.py): support user with `+` in email on user info

ensures user is correctly parsed from input

* fix(factory.py): support vertex function call args as None

handles empty string in args for vertex gemini calls

* docs(langfuse_integration.md): pin langfuse sdk version on docs

* fix(vertex_ai/): return empty dict, instead of none when empty string given

* refactor: reduce function size

* fix: fix linting errors

* fix: revert check

* fix(internal_user_endpoints.py): fix check

* test: update tests

* test: update tests
2025-06-10 22:13:10 -07:00
Krrish Dholakia 1cd97e41e9 test: update tests 2025-05-24 12:26:31 -07:00
Ishaan Jaff 702b5fec22 [Feat] Add /image/edits on LiteLLM (#11123)
* feat: add image edits on litellm router

* feat: add image edits endpoint

* fix: use pure async for image edits

* fix: base_process_llm_request

* fix: get_image_content_type

* feat: add image edits endpoint

* add image edits on UI

* test: image edits support

* fix: linting errors

* fix: linting errors

* test fix img gen
2025-05-24 10:18:01 -07:00
Krrish Dholakia 1857f5d264 test: update test 2025-05-19 21:21:44 -07:00
Ishaan Jaff c67ca115ae Return 404 when delete_verification_tokens (POST /key/delete) fails to find keys (#10604) (#10605)
* Return 404 when delete_verification_tokens fails to find keys

* Add test_delete_nonexistent_key_returns_404

Co-authored-by: Marc Abramowitz <abramowi@adobe.com>
2025-05-06 20:45:15 -07:00
Prathamesh Saraf ac7b1efe5c Refactor budget assertions in tests to improve clarity and accuracy. Updated remaining hours check to ensure positive values and adjusted budget reset time validation for better range checks. (#10500) 2025-05-02 09:02:02 -07:00
Krish Dholakia 711601e22a Add key-level multi-instance tpm/rpm/max parallel request limiting (#10458)
* fix: initial commit of v2 parallel request limiter hook

enables multi-instance rate limiting to work

* fix: subsequent commit with additional refactors

* fix(parallel_request_limiter_v2.py): cleanup initial call hook

simplify it

* fix(parallel_request_limiter_v2.py): working v2 parallel request limiter

* fix: more updates - still not passing testing

* fix(test_parallel_request_limiter_v2.py): update test + add conftest

* fix: fix ruff checks

* fix(parallel_request_limiter_v2.py): use pull via pattern method to load in keys instance wouldn't have seen yet

Fixes issue where redis syncing was not pulling key until instance had seen it

* test: update testing to cover tpm and rpm

* fix(parallel_request_limiter_v2.py): fix ruff errors

* fix(proxy/hooks/__init__.py): feature flag export

* fix(proxy/hooks/__init_.py): fix linting error

* ci(config.yml): add tests/enterprise to ci/cd

* fix: fix ruff check

* test: update testing
2025-04-30 21:32:31 -07:00
Krish Dholakia 290e2528cd Schedule budget resets at expectable times (#10331) (#10333)
* Schedule budget resets at expectable times (#10331)

* Enhance budget reset functionality with timezone support and standardized reset times

- Added `get_next_standardized_reset_time` function to calculate budget reset times based on specified durations and timezones.
- Introduced `timezone_utils.py` to manage timezone retrieval and budget reset time calculations.
- Updated budget reset logic in `reset_budget_job.py`, `internal_user_endpoints.py`, `key_management_endpoints.py`, and `team_endpoints.py` to utilize the new timezone-aware reset time calculations.
- Added unit tests for the new reset time functionality in `test_duration_parser.py`.
- Updated `.gitignore` to include `test.py` and made minor formatting adjustments in `docker-compose.yml` for consistency.

* Fixed linting

* Fix for mypy

* Fixed testcase for reset

* fix(duration_parser.py): move off zoneinfo - doesn't work with python 3.8

* test: update test

* refactor: improve budget reset time calculation and update related tests for accuracy

* clean up imports in team_endpoints.py

* test: update budget remaining hours assertions to reflect new reset time logic

* build(model_prices_and_context_window.json): update model

---------

Co-authored-by: Prathamesh Saraf <pratamesh1867@gmail.com>
2025-04-29 20:59:44 -07:00
Ishaan Jaff 8ae2653280 fix calculated cache key for tests 2025-04-19 09:25:11 -07:00
Krish Dholakia 1ea046cc61 test: update tests to new deployment model (#10142)
* test: update tests to new deployment model

* test: update model name

* test: skip cohere rbac issue test

* test: update test - replace gpt-4o model
2025-04-18 14:22:12 -07:00
Krish Dholakia 0d503ad8ad Move daily user transaction logging outside of 'disable_spend_logs' flag - different tables (#9772)
* refactor(db_spend_update_writer.py): aggregate table is entirely different

* test(test_db_spend_update_writer.py): add unit test to ensure if disable_spend_logs is true daily user transactions is still logged

* test: fix test
2025-04-05 09:58:16 -07:00
Ishaan Jaff 290e837515 test_update_logs_with_spend_logs_url 2025-04-01 18:15:01 -07:00
Krish Dholakia 5c107c64dd Add gemini audio input support + handle special tokens in sagemaker response (#9640)
* fix(internal_user_endpoints.py): cleanup unused variables on beta endpoint

no team/org split on daily user endpoint

* build(model_prices_and_context_window.json): gemini-2.0-flash supports audio input

* feat(gemini/transformation.py): support passing audio input to gemini

* test: fix test

* fix(gemini/transformation.py): support audio input as a url

enables passing google cloud bucket urls

* fix(gemini/transformation.py): support explicitly passing format of file

* fix(gemini/transformation.py): expand support for inferred file types from url

* fix(sagemaker/completion/transformation.py): fix special token error when counting sagemaker tokens

* test: fix import
2025-03-29 19:23:09 -07:00
Krrish Dholakia b3c7785240 test: skip flaky test - failing due to db timeouts - unrelated to test 2025-03-27 20:34:26 -07:00
Krrish Dholakia e2d4597588 test: mark flaky test 2025-03-27 20:10:57 -07:00
Krish Dholakia 11838e1c3b Litellm fix db testing (#9593)
* ci: fix test

* test: safely change db url

* fix: print db url

* test: remove delenv
2025-03-27 14:50:41 -07:00
Ishaan Jaff 63a32ff02c test_reset_budget_job 2025-03-17 19:37:09 -07:00
Ishaan Jaff 3a086cee06 (Feat) - Show Error Logs on LiteLLM UI (#8904)
* fix test_moderations_bad_model

* use async_post_call_failure_hook

* basic logging errors in DB

* show status on ui

* show status on ui

* ui show request / response side by side

* stash fixes

* working, track raw request

* track error info in metadata

* fix showing error / request / response logs

* show traceback on error viewer

* ui with traceback of error

* fix async_post_call_failure_hook

* fix(http_parsing_utils.py): orjson can throw errors on some emoji's in text, default to json.loads

* test_get_error_information

* fix code quality

* rename proxy track cost callback test

* _should_store_errors_in_spend_logs

* feature flag error logs

* Revert "_should_store_errors_in_spend_logs"

This reverts commit 7f345df47762ff3be04e6fde2f13e70019ede4ee.

* Revert "feature flag error logs"

This reverts commit 0e90c022bbea3550f169118d81e60d711a4024fe.

* test_spend_logs_payload

* fix OTEL log_db_metrics

* fix import json

* fix ui linting error

* test_async_post_call_failure_hook

* test_chat_completion_bad_model_with_spend_logs

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
2025-02-28 20:10:09 -08:00
Ishaan Jaff 1b2e3855cc test_update_user_unit_test 2025-02-25 10:46:33 -08:00
Krish Dholakia 51cb3c84e3 Litellm stable UI 02 17 2025 p1 (#8599)
* fix(key_management_endpoints.py): initial commit with logic to get all keys for teams user is an admin for

* fix(key_managements_endpoints.py): return all keys for teams user is an admin for

* fix(key_management_endpoints.py): add query param to ensure user opts into seeing all team keys (not just their own)

* fix(regenerate_key_modal.tsx): fix key regenerate

* fix(proxy_server.py): fix model metrics check on none api base

* test(test_key_generate_prisma.py): remove redundant test

* test(test_proxy_utils.py): add unit test covering new management endpoint helper util

* fix: fix test

* test(test_proxy_server.py): fix test
2025-02-17 17:55:05 -08:00
Krish Dholakia aee90f1dfe fix: fix test (#8501) 2025-02-12 18:38:15 -08:00
Ishaan Jaff ac14cfc25e fix test_aview_spend_per_user 2025-02-11 15:49:21 -08:00
Krish Dholakia df93debbc7 Internal User Endpoint - vulnerability fix + response type fix (#8228)
* fix(key_management_endpoints.py): fix vulnerability where a user could update another user's keys

Resolves https://github.com/BerriAI/litellm/issues/8031

* test(key_management_endpoints.py): return consistent 403 forbidden error when modifying key that doesn't belong to user

* fix(internal_user_endpoints.py): return model max budget in internal user create response

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

* test: fix test

* test: update test to handle gemini token counter change

* fix(factory.py): fix bedrock http:// handling

* docs: fix typo in lm_studio.md (#8222)

* test: fix testing

* test: fix test

---------

Co-authored-by: foreign-sub <51928805+foreign-sub@users.noreply.github.com>
2025-02-04 06:41:14 -08:00
Ishaan Jaff da3ddd2282 fix test_generate_and_update_key 2025-01-30 21:34:33 -08:00
Ishaan Jaff 31e967cbbd test_generate_and_update_key 2025-01-29 18:48:34 -08:00