litellm-enterprise 0.1.12__tar.gz → 0.1.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/PKG-INFO +2 -3
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/callback_controls.py +41 -8
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/llama_guard.py +2 -11
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/llm_guard.py +3 -11
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py +14 -10
- litellm_enterprise-0.1.28/litellm_enterprise/enterprise_callbacks/send_emails/base_email.py +621 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/send_emails/resend_email.py +2 -1
- litellm_enterprise-0.1.28/litellm_enterprise/enterprise_callbacks/send_emails/sendgrid_email.py +82 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/send_emails/smtp_email.py +2 -1
- litellm_enterprise-0.1.28/litellm_enterprise/integrations/custom_guardrail.py +46 -0
- litellm_enterprise-0.1.28/litellm_enterprise/proxy/__init__.py +1 -0
- litellm_enterprise-0.1.28/litellm_enterprise/proxy/auth/route_checks.py +66 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/auth/user_api_key_auth.py +3 -1
- litellm_enterprise-0.1.28/litellm_enterprise/proxy/common_utils/__init__.py +1 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/common_utils/check_batch_cost.py +23 -11
- litellm_enterprise-0.1.28/litellm_enterprise/proxy/common_utils/check_responses_cost.py +110 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/enterprise_routes.py +0 -4
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/hooks/managed_files.py +285 -47
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/management_endpoints/internal_user_endpoints.py +10 -5
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/management_endpoints/key_management_endpoints.py +12 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/proxy_server.py +12 -0
- litellm_enterprise-0.1.28/litellm_enterprise/proxy/vector_stores/endpoints.py +345 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/types/enterprise_callbacks/send_emails.py +18 -2
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/types/proxy/proxy_server.py +3 -1
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/pyproject.toml +2 -2
- litellm_enterprise-0.1.12/litellm_enterprise/enterprise_callbacks/generic_api_callback.py +0 -266
- litellm_enterprise-0.1.12/litellm_enterprise/enterprise_callbacks/send_emails/base_email.py +0 -325
- litellm_enterprise-0.1.12/litellm_enterprise/enterprise_callbacks/session_handler.py +0 -160
- litellm_enterprise-0.1.12/litellm_enterprise/proxy/guardrails/endpoints.py +0 -41
- litellm_enterprise-0.1.12/litellm_enterprise/proxy/vector_stores/endpoints.py +0 -207
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/LICENSE.md +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/README.md +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/__init__.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/example_logging_api.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secret_detection.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/__init__.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/adafruit.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/adobe.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/age_secret_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/airtable_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/algolia_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/alibaba.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/asana.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/atlassian_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/authress_access_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/beamer_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/bitbucket.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/bittrex.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/clojars_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/codecov_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/coinbase_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/confluent.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/contentful_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/databricks_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/datadog_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/defined_networking_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/digitalocean.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/discord.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/doppler_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/droneci_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/dropbox.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/duffel_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/dynatrace_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/easypost.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/etsy_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/facebook_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/fastly_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/finicity.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/finnhub_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/flickr_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/flutterwave.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/frameio_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/freshbooks_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/gcp_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/github_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/gitlab.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/gitter_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/gocardless_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/grafana.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/hashicorp_tf_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/heroku_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/hubspot_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/huggingface.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/intercom_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/jfrog.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/jwt.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/kraken_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/kucoin.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/launchdarkly_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/linear.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/linkedin.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/lob.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/mailgun.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/mapbox_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/mattermost_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/messagebird.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/microsoft_teams_webhook.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/netlify_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/new_relic.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/nytimes_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/okta_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/openai_api_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/planetscale.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/postman_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/prefect_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/pulumi_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/pypi_upload_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/rapidapi_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/readme_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/rubygems_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/scalingo_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/sendbird.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/sendgrid_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/sendinblue_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/sentry_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/shippo_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/shopify.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/slack.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/snyk_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/squarespace_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/sumologic.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/telegram_bot_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/travisci_access_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/twitch_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/twitter.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/typeform_api_token.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/vault.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/yandex.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/secrets_plugins/zendesk_secret_key.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/enterprise_callbacks/send_emails/endpoints.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/litellm_core_utils/litellm_logging.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/audit_logging_endpoints.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/auth/__init__.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/auth/custom_sso_handler.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/management_endpoints/__init__.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/readme.md +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/proxy/utils.py +0 -0
- {litellm_enterprise-0.1.12 → litellm_enterprise-0.1.28}/litellm_enterprise/types/proxy/audit_logging_endpoints.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: litellm-enterprise
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.28
|
|
4
4
|
Summary: Package for LiteLLM Enterprise features
|
|
5
5
|
Author: BerriAI
|
|
6
6
|
Requires-Python: >=3.8, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
|
|
@@ -9,7 +9,6 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
13
12
|
Project-URL: Documentation, https://docs.litellm.ai
|
|
14
13
|
Project-URL: Homepage, https://litellm.ai
|
|
15
14
|
Project-URL: Repository, https://github.com/BerriAI/litellm
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
1
3
|
import litellm
|
|
2
4
|
from litellm._logging import verbose_logger
|
|
3
5
|
from litellm.constants import X_LITELLM_DISABLE_CALLBACKS
|
|
@@ -6,15 +8,18 @@ from litellm.litellm_core_utils.llm_request_utils import (
|
|
|
6
8
|
get_proxy_server_request_headers,
|
|
7
9
|
)
|
|
8
10
|
from litellm.proxy._types import CommonProxyErrors
|
|
11
|
+
from litellm.types.utils import StandardCallbackDynamicParams
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
class EnterpriseCallbackControls:
|
|
12
15
|
@staticmethod
|
|
13
|
-
def
|
|
14
|
-
callback: litellm.CALLBACK_TYPES,
|
|
16
|
+
def is_callback_disabled_dynamically(
|
|
17
|
+
callback: litellm.CALLBACK_TYPES,
|
|
18
|
+
litellm_params: dict,
|
|
19
|
+
standard_callback_dynamic_params: StandardCallbackDynamicParams
|
|
15
20
|
) -> bool:
|
|
16
21
|
"""
|
|
17
|
-
Check if a callback is disabled via the x-litellm-disable-callbacks header.
|
|
22
|
+
Check if a callback is disabled via the x-litellm-disable-callbacks header or via `litellm_disabled_callbacks` in standard_callback_dynamic_params.
|
|
18
23
|
|
|
19
24
|
Args:
|
|
20
25
|
callback: The callback to check (can be string, CustomLogger instance, or callable)
|
|
@@ -28,18 +33,16 @@ class EnterpriseCallbackControls:
|
|
|
28
33
|
)
|
|
29
34
|
|
|
30
35
|
try:
|
|
31
|
-
|
|
32
|
-
disabled_callbacks = request_headers.get(X_LITELLM_DISABLE_CALLBACKS, None)
|
|
36
|
+
disabled_callbacks = EnterpriseCallbackControls.get_disabled_callbacks(litellm_params, standard_callback_dynamic_params)
|
|
33
37
|
verbose_logger.debug(f"Dynamically disabled callbacks from {X_LITELLM_DISABLE_CALLBACKS}: {disabled_callbacks}")
|
|
34
38
|
verbose_logger.debug(f"Checking if {callback} is disabled via headers. Disable callbacks from headers: {disabled_callbacks}")
|
|
35
39
|
if disabled_callbacks is not None:
|
|
36
40
|
#########################################################
|
|
37
41
|
# premium user check
|
|
38
42
|
#########################################################
|
|
39
|
-
if not EnterpriseCallbackControls.
|
|
43
|
+
if not EnterpriseCallbackControls._should_allow_dynamic_callback_disabling():
|
|
40
44
|
return False
|
|
41
45
|
#########################################################
|
|
42
|
-
disabled_callbacks = set([cb.strip().lower() for cb in disabled_callbacks.split(",")])
|
|
43
46
|
if isinstance(callback, str):
|
|
44
47
|
if callback.lower() in disabled_callbacks:
|
|
45
48
|
verbose_logger.debug(f"Not logging to {callback} because it is disabled via {X_LITELLM_DISABLE_CALLBACKS}")
|
|
@@ -56,10 +59,40 @@ class EnterpriseCallbackControls:
|
|
|
56
59
|
f"Error checking disabled callbacks header: {str(e)}"
|
|
57
60
|
)
|
|
58
61
|
return False
|
|
62
|
+
@staticmethod
|
|
63
|
+
def get_disabled_callbacks(litellm_params: dict, standard_callback_dynamic_params: StandardCallbackDynamicParams) -> Optional[List[str]]:
|
|
64
|
+
"""
|
|
65
|
+
Get the disabled callbacks from the standard callback dynamic params.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
#########################################################
|
|
69
|
+
# check if disabled via headers
|
|
70
|
+
#########################################################
|
|
71
|
+
request_headers = get_proxy_server_request_headers(litellm_params)
|
|
72
|
+
disabled_callbacks = request_headers.get(X_LITELLM_DISABLE_CALLBACKS, None)
|
|
73
|
+
if disabled_callbacks is not None:
|
|
74
|
+
disabled_callbacks = set([cb.strip().lower() for cb in disabled_callbacks.split(",")])
|
|
75
|
+
return list(disabled_callbacks)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#########################################################
|
|
79
|
+
# check if disabled via request body
|
|
80
|
+
#########################################################
|
|
81
|
+
if standard_callback_dynamic_params.get("litellm_disabled_callbacks", None) is not None:
|
|
82
|
+
return standard_callback_dynamic_params.get("litellm_disabled_callbacks", None)
|
|
83
|
+
|
|
84
|
+
return None
|
|
59
85
|
|
|
60
86
|
@staticmethod
|
|
61
|
-
def
|
|
87
|
+
def _should_allow_dynamic_callback_disabling():
|
|
88
|
+
import litellm
|
|
62
89
|
from litellm.proxy.proxy_server import premium_user
|
|
90
|
+
|
|
91
|
+
# Check if admin has disabled this feature
|
|
92
|
+
if litellm.allow_dynamic_callback_disabling is not True:
|
|
93
|
+
verbose_logger.debug("Dynamic callback disabling is disabled by admin via litellm.allow_dynamic_callback_disabling")
|
|
94
|
+
return False
|
|
95
|
+
|
|
63
96
|
if premium_user:
|
|
64
97
|
return True
|
|
65
98
|
verbose_logger.warning(f"Disabling callbacks using request headers is an enterprise feature. {CommonProxyErrors.not_premium_user.value}")
|
|
@@ -23,9 +23,7 @@ import litellm
|
|
|
23
23
|
from litellm._logging import verbose_proxy_logger
|
|
24
24
|
from litellm.integrations.custom_logger import CustomLogger
|
|
25
25
|
from litellm.proxy._types import UserAPIKeyAuth
|
|
26
|
-
from litellm.types.utils import Choices, ModelResponse
|
|
27
|
-
|
|
28
|
-
litellm.set_verbose = True
|
|
26
|
+
from litellm.types.utils import CallTypesLiteral, Choices, ModelResponse
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
class _ENTERPRISE_LlamaGuard(CustomLogger):
|
|
@@ -100,14 +98,7 @@ class _ENTERPRISE_LlamaGuard(CustomLogger):
|
|
|
100
98
|
self,
|
|
101
99
|
data: dict,
|
|
102
100
|
user_api_key_dict: UserAPIKeyAuth,
|
|
103
|
-
call_type:
|
|
104
|
-
"completion",
|
|
105
|
-
"embeddings",
|
|
106
|
-
"image_generation",
|
|
107
|
-
"moderation",
|
|
108
|
-
"audio_transcription",
|
|
109
|
-
"responses",
|
|
110
|
-
],
|
|
101
|
+
call_type: CallTypesLiteral,
|
|
111
102
|
):
|
|
112
103
|
"""
|
|
113
104
|
- Calls the Llama Guard Endpoint
|
|
@@ -17,10 +17,9 @@ from litellm._logging import verbose_proxy_logger
|
|
|
17
17
|
from litellm.integrations.custom_logger import CustomLogger
|
|
18
18
|
from litellm.proxy._types import UserAPIKeyAuth
|
|
19
19
|
from litellm.secret_managers.main import get_secret_str
|
|
20
|
+
from litellm.types.utils import CallTypesLiteral
|
|
20
21
|
from litellm.utils import get_formatted_prompt
|
|
21
22
|
|
|
22
|
-
litellm.set_verbose = True
|
|
23
|
-
|
|
24
23
|
|
|
25
24
|
class _ENTERPRISE_LLMGuard(CustomLogger):
|
|
26
25
|
# Class variables or attributes
|
|
@@ -65,7 +64,7 @@ class _ENTERPRISE_LLMGuard(CustomLogger):
|
|
|
65
64
|
analyze_url, json=analyze_payload
|
|
66
65
|
) as response:
|
|
67
66
|
redacted_text = await response.json()
|
|
68
|
-
verbose_proxy_logger.
|
|
67
|
+
verbose_proxy_logger.debug(
|
|
69
68
|
f"LLM Guard: Received response - {redacted_text}"
|
|
70
69
|
)
|
|
71
70
|
if redacted_text is not None:
|
|
@@ -122,14 +121,7 @@ class _ENTERPRISE_LLMGuard(CustomLogger):
|
|
|
122
121
|
self,
|
|
123
122
|
data: dict,
|
|
124
123
|
user_api_key_dict: UserAPIKeyAuth,
|
|
125
|
-
call_type:
|
|
126
|
-
"completion",
|
|
127
|
-
"embeddings",
|
|
128
|
-
"image_generation",
|
|
129
|
-
"moderation",
|
|
130
|
-
"audio_transcription",
|
|
131
|
-
"responses",
|
|
132
|
-
],
|
|
124
|
+
call_type: CallTypesLiteral,
|
|
133
125
|
):
|
|
134
126
|
"""
|
|
135
127
|
- Calls the LLM Guard Endpoint
|
|
@@ -31,6 +31,7 @@ from litellm.types.integrations.pagerduty import (
|
|
|
31
31
|
PagerDutyRequestBody,
|
|
32
32
|
)
|
|
33
33
|
from litellm.types.utils import (
|
|
34
|
+
CallTypesLiteral,
|
|
34
35
|
StandardLoggingPayload,
|
|
35
36
|
StandardLoggingPayloadErrorInformation,
|
|
36
37
|
)
|
|
@@ -109,6 +110,9 @@ class PagerDutyAlerting(SlackAlerting):
|
|
|
109
110
|
error_llm_provider=error_info.get("llm_provider"),
|
|
110
111
|
user_api_key_hash=_meta.get("user_api_key_hash"),
|
|
111
112
|
user_api_key_alias=_meta.get("user_api_key_alias"),
|
|
113
|
+
user_api_key_spend=_meta.get("user_api_key_spend"),
|
|
114
|
+
user_api_key_max_budget=_meta.get("user_api_key_max_budget"),
|
|
115
|
+
user_api_key_budget_reset_at=_meta.get("user_api_key_budget_reset_at"),
|
|
112
116
|
user_api_key_org_id=_meta.get("user_api_key_org_id"),
|
|
113
117
|
user_api_key_team_id=_meta.get("user_api_key_team_id"),
|
|
114
118
|
user_api_key_user_id=_meta.get("user_api_key_user_id"),
|
|
@@ -116,6 +120,7 @@ class PagerDutyAlerting(SlackAlerting):
|
|
|
116
120
|
user_api_key_end_user_id=_meta.get("user_api_key_end_user_id"),
|
|
117
121
|
user_api_key_user_email=_meta.get("user_api_key_user_email"),
|
|
118
122
|
user_api_key_request_route=_meta.get("user_api_key_request_route"),
|
|
123
|
+
user_api_key_auth_metadata=_meta.get("user_api_key_auth_metadata"),
|
|
119
124
|
)
|
|
120
125
|
)
|
|
121
126
|
|
|
@@ -138,16 +143,7 @@ class PagerDutyAlerting(SlackAlerting):
|
|
|
138
143
|
user_api_key_dict: UserAPIKeyAuth,
|
|
139
144
|
cache: DualCache,
|
|
140
145
|
data: dict,
|
|
141
|
-
call_type:
|
|
142
|
-
"completion",
|
|
143
|
-
"text_completion",
|
|
144
|
-
"embeddings",
|
|
145
|
-
"image_generation",
|
|
146
|
-
"moderation",
|
|
147
|
-
"audio_transcription",
|
|
148
|
-
"pass_through_endpoint",
|
|
149
|
-
"rerank",
|
|
150
|
-
],
|
|
146
|
+
call_type: CallTypesLiteral,
|
|
151
147
|
) -> Optional[Union[Exception, str, dict]]:
|
|
152
148
|
"""
|
|
153
149
|
Example of detecting hanging requests by waiting a given threshold.
|
|
@@ -190,6 +186,13 @@ class PagerDutyAlerting(SlackAlerting):
|
|
|
190
186
|
error_llm_provider="HangingRequest",
|
|
191
187
|
user_api_key_hash=user_api_key_dict.api_key,
|
|
192
188
|
user_api_key_alias=user_api_key_dict.key_alias,
|
|
189
|
+
user_api_key_spend=user_api_key_dict.spend,
|
|
190
|
+
user_api_key_max_budget=user_api_key_dict.max_budget,
|
|
191
|
+
user_api_key_budget_reset_at=(
|
|
192
|
+
user_api_key_dict.budget_reset_at.isoformat()
|
|
193
|
+
if user_api_key_dict.budget_reset_at
|
|
194
|
+
else None
|
|
195
|
+
),
|
|
193
196
|
user_api_key_org_id=user_api_key_dict.org_id,
|
|
194
197
|
user_api_key_team_id=user_api_key_dict.team_id,
|
|
195
198
|
user_api_key_user_id=user_api_key_dict.user_id,
|
|
@@ -197,6 +200,7 @@ class PagerDutyAlerting(SlackAlerting):
|
|
|
197
200
|
user_api_key_end_user_id=user_api_key_dict.end_user_id,
|
|
198
201
|
user_api_key_user_email=user_api_key_dict.user_email,
|
|
199
202
|
user_api_key_request_route=user_api_key_dict.request_route,
|
|
203
|
+
user_api_key_auth_metadata=user_api_key_dict.metadata,
|
|
200
204
|
)
|
|
201
205
|
)
|
|
202
206
|
|