Commit graph

18474 commits

Author SHA1 Message Date
Krrish Dholakia
d2b123eef7 bump: version 1.53.1 → 1.53.2 2024-12-01 06:55:33 -08:00
Krish Dholakia
859b47f08b
LiteLLM Minor Fixes & Improvements (11/29/2024) (#6965)
* fix(factory.py): ensure tool call converts image url

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

* fix(transformation.py): support mp4 + pdf url's for vertex ai

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

* fix(http_handler.py): mask gemini api key in error logs

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

* docs(prometheus.md): update prometheus FAQs

* feat(auth_checks.py): ensure specific model access > wildcard model access

if wildcard model is in access group, but specific model is not - deny access

* fix(auth_checks.py): handle auth checks for team based model access groups

handles scenario where model access group used for wildcard models

* fix(internal_user_endpoints.py): support adding guardrails on `/user/update`

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

* fix(key_management_endpoints.py): fix prepare_metadata_fields helper

* fix: fix tests

* build(requirements.txt): bump openai dep version

fixes proxies argument

* test: fix tests

* fix(http_handler.py): fix error message masking

* fix(bedrock_guardrails.py): pass in prepped data

* test: fix test

* test: fix nvidia nim test

* fix(http_handler.py): return original response headers

* fix: revert maskedhttpstatuserror

* test: update tests

* test: cleanup test

* fix(key_management_endpoints.py): fix metadata field update logic

* fix(key_management_endpoints.py): maintain initial order of guardrails in key update

* fix(key_management_endpoints.py): handle prepare metadata

* fix: fix linting errors

* fix: fix linting errors

* fix: fix linting errors

* fix: fix key management errors

* fix(key_management_endpoints.py): update metadata

* test: update test

* refactor: add more debug statements

* test: skip flaky test

* test: fix test

* fix: fix test

* fix: fix update metadata logic

* fix: fix test

* ci(config.yml): change db url for e2e ui testing
2024-12-01 05:24:11 -08:00
Krish Dholakia
bd59f18809
fix(key_management_endpoints.py): support 'tags' param on /key/update (#6945) 2024-11-29 02:02:54 -08:00
Ishaan Jaff
05f810922c
(feat) Allow disabling ErrorLogs written to the DB (#6940)
* fix - allow disabling logging error logs

* docs on disabling error logs

* doc string for _PROXY_failure_handler

* test_disable_error_logs

* rename file

* fix rename file

* increase test coverage for test_enable_error_logs
2024-11-27 19:34:51 -08:00
Ishaan Jaff
0ac2d8b256 fix doc string 2024-11-27 18:55:06 -08:00
Ishaan Jaff
9393434d01
(fix) tag merging / aggregation logic (#6932)
* use 1 helper to merge tags + ensure unique ness

* test_add_litellm_data_to_request_duplicate_tags

* fix _merge_tags

* fix proxy utils test
2024-11-27 18:40:33 -08:00
Ishaan Jaff
d6181b2c9f
(feat) add enforcement for unique key aliases on /key/update and /key/generate (#6944)
* add enforcement for unique key aliases

* fix _enforce_unique_key_alias

* fix _enforce_unique_key_alias

* fix _enforce_unique_key_alias

* test_enforce_unique_key_alias
2024-11-27 18:40:21 -08:00
Ishaan Jaff
4ebb7c8a7f
(docs + fix) Add docs on Moderations endpoint, Text Completion (#6947)
* fix _pass_through_moderation_endpoint_factory

* fix route_llm_request

* doc moderations api

* docs on /moderations

* add e2e tests for moderations api

* docs moderations api

* test_pass_through_moderation_endpoint_factory

* docs text completion
2024-11-27 16:30:48 -08:00
Ishaan Jaff
eba700a491 Revert "Revert "(feat) Allow using include to include external YAML files in a config.yaml (#6922)""
This reverts commit 5d13302e6b.
2024-11-27 16:08:59 -08:00
Ishaan Jaff
a8b8deb793
(fix) handle json decode errors for DD exception logging (#6934)
* fix JSONDecodeError

* handle async_log_proxy_authentication_errors

* fix test_async_log_proxy_authentication_errors_get_request
2024-11-27 14:48:54 -08:00
Ishaan Jaff
77f714dc51
(bug fix) /key/update was not storing budget_duration in the DB (#6941)
* fix - store budget_duration for keys

* test_generate_and_update_key

* test_update_user_unit_test

* fix user update
2024-11-27 14:48:01 -08:00
Sara Han
8af5b11f54
docs: update the docs (#6923) 2024-11-28 03:43:20 +05:30
Krish Dholakia
21156ff5d0
LiteLLM Minor Fixes & Improvements (11/27/2024) (#6943)
* fix(http_parsing_utils.py): remove `ast.literal_eval()` from http utils

Security fix - https://huntr.com/bounties/96a32812-213c-4819-ba4e-36143d35e95b?token=bf414bbd77f8b346556e
64ab2dd9301ea44339910877ea50401c76f977e36cdd78272f5fb4ca852a88a7e832828aae1192df98680544ee24aa98f3cf6980d8
bab641a66b7ccbc02c0e7d4ddba2db4dbe7318889dc0098d8db2d639f345f574159814627bb084563bad472e2f990f825bff0878a9
e281e72c88b4bc5884d637d186c0d67c9987c57c3f0caf395aff07b89ad2b7220d1dd7d1b427fd2260b5f01090efce5250f8b56ea2
c0ec19916c24b23825d85ce119911275944c840a1340d69e23ca6a462da610

* fix(converse/transformation.py): support bedrock apac cross region inference

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

* fix(user_api_key_auth.py): add auth check for websocket endpoint

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

* fix(user_api_key_auth.py): use `model` from query param

* fix: fix linting error

* test: run flaky tests first
2024-11-28 00:32:46 +05:30
Krish Dholakia
2d2931a215
LiteLLM Minor Fixes & Improvements (11/26/2024) (#6913)
* docs(config_settings.md): document all router_settings

* ci(config.yml): add router_settings doc test to ci/cd

* test: debug test on ci/cd

* test: debug ci/cd test

* test: fix test

* fix(team_endpoints.py): skip invalid team object. don't fail `/team/list` call

Causes downstream errors if ui just fails to load team list

* test(base_llm_unit_tests.py): add 'response_format={"type": "text"}' test to base_llm_unit_tests

adds complete coverage for all 'response_format' values to ci/cd

* feat(router.py): support wildcard routes in `get_router_model_info()`

Addresses https://github.com/BerriAI/litellm/issues/6914

* build(model_prices_and_context_window.json): add tpm/rpm limits for all gemini models

Allows for ratelimit tracking for gemini models even with wildcard routing enabled

Addresses https://github.com/BerriAI/litellm/issues/6914

* feat(router.py): add tpm/rpm tracking on success/failure to global_router

Addresses https://github.com/BerriAI/litellm/issues/6914

* feat(router.py): support wildcard routes on router.get_model_group_usage()

* fix(router.py): fix linting error

* fix(router.py): implement get_remaining_tokens_and_requests

Addresses https://github.com/BerriAI/litellm/issues/6914

* fix(router.py): fix linting errors

* test: fix test

* test: fix tests

* docs(config_settings.md): add missing dd env vars to docs

* fix(router.py): check if hidden params is dict
2024-11-28 00:01:38 +05:30
Ishaan Jaff
5d13302e6b Revert "(feat) Allow using include to include external YAML files in a config.yaml (#6922)"
This reverts commit 68e59824a3.
2024-11-27 10:17:09 -08:00
Krrish Dholakia
07223bdedf bump: version 1.53.0 → 1.53.1 2024-11-27 12:53:32 +05:30
Krrish Dholakia
562e7defe6 build(ui/): update ui build 2024-11-27 12:53:19 +05:30
Ishaan Jaff
a6da3dea03
(feat) dd logger - set tags according to the values set by those env vars (#6933)
* dd logger, inherit from .envs

* test_datadog_payload_environment_variables

* fix _get_datadog_service
2024-11-26 22:08:04 -08:00
Ishaan Jaff
fe151db27c bump: version 1.52.16 → 1.53. 2024-11-26 20:27:58 -08:00
Ishaan Jaff
68e59824a3
(feat) Allow using include to include external YAML files in a config.yaml (#6922)
* add helper to process inlcudes directive on yaml

* add doc on config management

* unit tests for `include` on config.yaml
2024-11-26 20:27:12 -08:00
Ishaan Jaff
4bc06392db
(feat) log proxy auth errors on datadog (#6931)
* add new dd type for auth errors

* add async_log_proxy_authentication_errors

* fix comment

* use async_log_proxy_authentication_errors

* test_datadog_post_call_failure_hook

* test_async_log_proxy_authentication_errors
2024-11-26 20:26:57 -08:00
Ishaan Jaff
aea68cbeb6
(feat) DataDog Logger - Add Failure logging + use Standard Logging payload (#6929)
* add async_log_failure_event for dd

* use standard logging payload for DD logging

* use standard logging payload for DD

* fix use SLP status

* allow opting into _create_v0_logging_payload

* add unit tests for DD logging payload

* fix dd logging tests
2024-11-26 19:27:06 -08:00
paul-gauthier
d84e355eab
sonnet supports pdf, haiku does not (#6928) 2024-11-26 19:06:17 -08:00
Ishaan Jaff
8fd3bf34d8
(feat) pass through llm endpoints - add PATCH support (vertex context caching requires for update ops) (#6924)
* add PATCH for pass through endpoints

* test_pass_through_routes_support_all_methods
2024-11-26 14:39:13 -08:00
Krish Dholakia
8673f2541e
fix(key_management_endpoints.py): fix user-membership check when creating team key (#6890)
* fix(key_management_endpoints.py): fix user-membership check when creating team key

* docs: add deprecation notice on original `/v1/messages` endpoint + add better swagger tags on pass-through endpoints

* fix(gemini/): fix image_url handling for gemini

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

* fix(teams.tsx): fix member add when role is 'user'

* fix(team_endpoints.py): /team/member_add

fix adding several new members to team

* test(test_vertex.py): remove redundant test

* test(test_proxy_server.py): fix team member add tests
2024-11-26 14:19:24 +05:30
Ishaan Jaff
dcea31e50a run ci/cd again for new release 2024-11-26 00:26:27 -08:00
Krrish Dholakia
0b15662c6e test: temporarily comment out doc test - fix ci/cd issue in separate pr 2024-11-26 13:52:40 +05:30
Krrish Dholakia
fd288c5081 test: fix test 2024-11-26 13:48:08 +05:30
Krrish Dholakia
195112565d test: fix documentation tests 2024-11-26 13:45:00 +05:30
Ishaan Jaff
8ec0e8cbc4 bump: version 1.52.15 → 1.52.16 2024-11-25 23:58:21 -08:00
Ishaan Jaff
c285132ad6
(docs) Simplify /vertex_ai/ pass through docs (#6910)
* simplify vertex pass through docs

* allow using known path for setting up pass throughs

* add unit testing for vtx pass through auth
2024-11-25 23:57:50 -08:00
Krrish Dholakia
d26ad42f86 docs(router_architecture.md): add router architecture docs 2024-11-26 12:54:38 +05:30
Ishaan Jaff
5c854650c2
(redis fix) - fix AbstractConnection.__init__() got an unexpected keyword argument 'ssl' (#6908)
* add better debugging for get_redis_connection_pool + allow passing ssl=None

* test_redis_with_ssl

* test_redis_with_ssl

* test_redis_with_ssl
2024-11-25 22:52:44 -08:00
Ishaan Jaff
552c0dd7a4
(fix) pass through endpoints - run logging async + use thread pool executor for sync logging callbacks (#6907)
* run pass through logging async

* fix use thread_pool_executor for pass through logging

* test_pass_through_request_logging_failure_with_stream

* fix anthropic pt logging test

* test_pass_through_request_logging_failure
2024-11-25 22:52:05 -08:00
Ishaan Jaff
d52aae4e82 ui new build 2024-11-25 22:42:59 -08:00
Ishaan Jaff
e952c666f3
(UI fix) UI does not reload when you login / open a new tab (#6909)
* store current page on url

* update menu history
2024-11-25 22:41:45 -08:00
Ishaan Jaff
c60261c3bc
(feat) Add support for using @google/generative-ai JS with LiteLLM Proxy (#6899)
* feat - allow using gemini js SDK with LiteLLM

* add auth for gemini_proxy_route

* basic local test for js

* test cost tagging gemini js requests

* add js sdk test for gemini with litellm

* add docs on gemini JS SDK

* run node.js tests

* fix google ai studio tests

* fix vertex js spend test
2024-11-25 13:13:03 -08:00
Ishaan Jaff
f77bf49772
feat - allow sending tags on vertex pass through requests (#6876)
* feat - allow tagging vertex JS SDK request

* add unit testing for passing headers for pass through endpoints

* fix allow using vertex_ai as the primary way for pass through vertex endpoints

* docs on vertex js pass tags

* add e2e test for vertex pass through with spend tags

* add e2e tests for streaming vertex JS with tags

* fix vertex ai testing
2024-11-25 12:12:09 -08:00
Ishaan Jaff
c73ce95c01
(feat) - provider budget improvements - ensure provider budgets work with multiple proxy instances + improve latency to ~90ms (#6886)
* use 1 file for duration_in_seconds

* add to readme.md

* re use duration_in_seconds

* fix importing _extract_from_regex, get_last_day_of_month

* fix import

* update provider budget routing

* fix - remove dup test

* add support for using in multi instance environments

* test_in_memory_redis_sync_e2e

* test_in_memory_redis_sync_e2e

* fix test_in_memory_redis_sync_e2e

* fix code quality check

* fix test provider budgets

* working provider budget tests

* add fixture for provider budget routing

* fix router testing for provider budgets

* add comments on provider budget routing

* use RedisPipelineIncrementOperation

* add redis async_increment_pipeline

* use redis async_increment_pipeline

* use lower value for testing

* use redis async_increment_pipeline

* use consistent key name for increment op

* add handling for budget windows

* fix typing async_increment_pipeline

* fix set attr

* add clear doc strings

* unit testing for provider budgets

* test_redis_increment_pipeline
2024-11-24 16:36:19 -08:00
Ishaan Jaff
34bfebe470
(QOL improvement) Provider budget routing - allow using 1s, 1d, 1mo, 2mo etc (#6885)
* use 1 file for duration_in_seconds

* add to readme.md

* re use duration_in_seconds

* fix importing _extract_from_regex, get_last_day_of_month

* fix import

* update provider budget routing

* fix - remove dup test
2024-11-23 16:59:46 -08:00
Ishaan Jaff
e69678a9b3 update doc title 2024-11-23 16:25:00 -08:00
Krrish Dholakia
3d8c0bad58 build(ui/): update ui build 2024-11-24 05:32:26 +05:30
Ishaan Jaff
afc69761de
docs - have 1 section for routing +load balancing (#6884)
* docs - have 1 section for routing +load balancing

* remove emoji
2024-11-23 15:56:57 -08:00
Krrish Dholakia
50314a66ca bump: version 1.52.14 → 1.52.15 2024-11-23 23:43:30 +05:30
Krrish Dholakia
19a7932329 build: update ui build 2024-11-23 23:32:08 +05:30
Krish Dholakia
424b8b0231
Litellm dev 11 23 2024 (#6881)
* build(ui/create_key_button.tsx): support adding tags for cost tracking/routing when making key

* LiteLLM Minor Fixes & Improvements (11/23/2024)  (#6870)

* feat(pass_through_endpoints/): support logging anthropic/gemini pass through calls to langfuse/s3/etc.

* fix(utils.py): allow disabling end user cost tracking with new param

Allows proxy admin to disable cost tracking for end user - keeps prometheus metrics small

* docs(configs.md): add disable_end_user_cost_tracking reference to docs

* feat(key_management_endpoints.py): add support for restricting access to `/key/generate` by team/proxy level role

Enables admin to restrict key creation, and assign team admins to handle distributing keys

* test(test_key_management.py): add unit testing for personal / team key restriction checks

* docs: add docs on restricting key creation

* docs(finetuned_models.md): add new guide on calling finetuned models

* docs(input.md): cleanup anthropic supported params

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

* test(test_embedding.py): add test for passing extra headers via embedding

* feat(cohere/embed): pass client to async embedding

* feat(rerank.py): add `/v1/rerank` if missing for cohere base url

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

* fix(main.py): pass extra_headers param to openai

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

* fix(litellm_logging.py): don't disable global callbacks when dynamic callbacks are set

Fixes issue where global callbacks - e.g. prometheus were overriden when langfuse was set dynamically

* fix(handler.py): fix linting error

* fix: fix typing

* build: add conftest to proxy_admin_ui_tests/

* test: fix test

* fix: fix linting errors

* test: fix test

* fix: fix pass through testing

* feat(key_management_endpoints.py): allow proxy_admin to enforce params on key creation

allows admin to force team keys to have tags

* build(ui/): show teams in leftnav + allow team admin to add new members

* build(ui/): show created tags in dropdown

makes it easier for admin to add tags to keys

* test(test_key_management.py): fix test

* test: fix test

* fix playwright e2e ui test

* fix e2e ui testing deps

* fix: fix linting errors

* fix e2e ui testing

* fix e2e ui testing, only run e2e ui testing in playwright

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2024-11-23 22:37:16 +05:30
Ishaan Jaff
6b6353d4e7 fix e2e ui testing, only run e2e ui testing in playwright 2024-11-23 08:50:10 -08:00
Ishaan Jaff
f3ffa67553 fix e2e ui testing 2024-11-23 08:45:14 -08:00
Ishaan Jaff
fb5f458448 fix e2e ui testing deps 2024-11-23 08:39:11 -08:00
Ishaan Jaff
a8b4e1cc03 fix playwright e2e ui test 2024-11-23 08:34:55 -08:00