Skip to content

Commit 661a42b

Browse files
Merge pull request #14698 from BerriAI/litellm_contributor_prs_09_18_2025_p1
Litellm contributor prs 09 18 2025 p1
2 parents 6080069 + 7b53ede commit 661a42b

20 files changed

+3852
-528
lines changed

.circleci/config.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,8 +2826,8 @@ jobs:
28262826
source "$NVM_DIR/bash_completion"
28272827
28282828
# Install and use Node version
2829-
nvm install v18.17.0
2830-
nvm use v18.17.0
2829+
nvm install v20
2830+
nvm use v20
28312831
28322832
cd ui/litellm-dashboard
28332833
@@ -2880,7 +2880,26 @@ jobs:
28802880
name: Install Playwright Browsers
28812881
command: |
28822882
npx playwright install
2883+
- run:
2884+
name: Run UI unit tests (Vitest)
2885+
command: |
2886+
# Use Node 20 (several deps require >=20)
2887+
export NVM_DIR="/opt/circleci/.nvm"
2888+
source "$NVM_DIR/nvm.sh"
2889+
nvm install 20
2890+
nvm use 20
28832891
2892+
cd ui/litellm-dashboard
2893+
npm ci || npm install
2894+
2895+
# CI run, with both LCOV (Codecov) and HTML (artifact you can click)
2896+
CI=true npm run test -- --run --coverage \
2897+
--coverage.provider=v8 \
2898+
--coverage.reporter=lcov \
2899+
--coverage.reporter=html \
2900+
--coverage.reportsDirectory=coverage/html
2901+
2902+
28842903
- run:
28852904
name: Build Docker image
28862905
command: docker build -t my-app:latest -f ./docker/Dockerfile.database .

litellm/integrations/custom_guardrail.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ def add_standard_logging_guardrail_information_to_request_data(
357357
end_time: Optional[float] = None,
358358
duration: Optional[float] = None,
359359
masked_entity_count: Optional[Dict[str, int]] = None,
360+
guardrail_provider: Optional[str] = None,
360361
) -> None:
361362
"""
362363
Builds `StandardLoggingGuardrailInformation` and adds it to the request metadata so it can be used for logging to DataDog, Langfuse, etc.
@@ -367,6 +368,7 @@ def add_standard_logging_guardrail_information_to_request_data(
367368

368369
slg = StandardLoggingGuardrailInformation(
369370
guardrail_name=self.guardrail_name,
371+
guardrail_provider=guardrail_provider,
370372
guardrail_mode=(
371373
GuardrailMode(**self.event_hook.model_dump()) # type: ignore
372374
if isinstance(self.event_hook, Mode)

litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def __init__(
111111
)
112112
self.guardrailIdentifier = guardrailIdentifier
113113
self.guardrailVersion = guardrailVersion
114+
self.guardrail_provider = "bedrock"
114115

115116
# store kwargs as optional_params
116117
self.optional_params = kwargs
@@ -372,6 +373,7 @@ async def make_bedrock_api_request(
372373
# Add guardrail information to request trace
373374
#########################################################
374375
self.add_standard_logging_guardrail_information_to_request_data(
376+
guardrail_provider=self.guardrail_provider,
375377
guardrail_json_response=response.json(),
376378
request_data=request_data or {},
377379
guardrail_status=self._get_bedrock_guardrail_response_status(

litellm/proxy/guardrails/guardrail_hooks/presidio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def __init__(
7676
self.logging_only = True
7777
kwargs["event_hook"] = GuardrailEventHooks.logging_only
7878
super().__init__(**kwargs)
79+
self.guardrail_provider = "presidio"
7980
self.pii_tokens: dict = (
8081
{}
8182
) # mapping of PII token to original text - only used with Presidio `replace` operation
@@ -369,6 +370,7 @@ async def check_pii(
369370
else:
370371
guardrail_json_response = exception_str
371372
self.add_standard_logging_guardrail_information_to_request_data(
373+
guardrail_provider=self.guardrail_provider,
372374
guardrail_json_response=guardrail_json_response,
373375
request_data=request_data,
374376
guardrail_status=status,

litellm/types/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ class GuardrailMode(TypedDict, total=False):
20152015

20162016
class StandardLoggingGuardrailInformation(TypedDict, total=False):
20172017
guardrail_name: Optional[str]
2018+
guardrail_provider: Optional[str]
20182019
guardrail_mode: Optional[
20192020
Union[GuardrailEventHooks, List[GuardrailEventHooks], GuardrailMode]
20202021
]

ui/litellm-dashboard/build_ui.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ if ! command -v nvm &> /dev/null; then
1111
fi
1212

1313
# Use nvm to set the required Node.js version
14-
nvm use v18.17.0
14+
nvm use v20
1515

1616
# Check if nvm use was successful
1717
if [ $? -ne 0 ]; then
18-
echo "Error: Failed to switch to Node.js v18.17.0. Deployment aborted."
18+
echo "Error: Failed to switch to Node.js v20. Deployment aborted."
1919
exit 1
2020
fi
2121

0 commit comments

Comments
 (0)