Skip to content

Commit 14064f9

Browse files
authored
Merge branch 'BerriAI:main' into main
2 parents 08bcd1c + de706a3 commit 14064f9

2,597 files changed

Lines changed: 162697 additions & 49556 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,7 +2731,7 @@ jobs:
27312731
- ~/.cache/uv
27322732
- restore_cache:
27332733
keys:
2734-
- ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
2734+
- ui-e2e-node-deps-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }}
27352735
- run:
27362736
name: Install Node dependencies and Playwright
27372737
# The cimg/python:3.12-browsers image already ships the Chromium system
@@ -2742,11 +2742,14 @@ jobs:
27422742
command: |
27432743
cd ui/litellm-dashboard
27442744
npm ci
2745+
cd ../../tests/e2e/ui
2746+
npm ci
27452747
npx playwright install chromium
27462748
- save_cache:
2747-
key: ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
2749+
key: ui-e2e-node-deps-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }}
27482750
paths:
27492751
- ui/litellm-dashboard/node_modules
2752+
- tests/e2e/ui/node_modules
27502753
- ~/.cache/ms-playwright
27512754
- run:
27522755
name: Build UI from source
@@ -2777,10 +2780,10 @@ jobs:
27772780
name: Seed database
27782781
command: |
27792782
PGPASSWORD=e2epassword psql -h localhost -p 5432 -U e2euser -d litellm_e2e \
2780-
-f ui/litellm-dashboard/e2e_tests/fixtures/seed.sql
2783+
-f tests/e2e/ui/fixtures/seed.sql
27812784
- run:
27822785
name: Start mock LLM server
2783-
command: uv run --no-sync python ui/litellm-dashboard/e2e_tests/fixtures/mock_llm_server/server.py
2786+
command: uv run --no-sync python tests/e2e/ui/fixtures/mock_llm_server/server.py
27842787
background: true
27852788
- run:
27862789
name: Start LiteLLM proxy
@@ -2798,7 +2801,7 @@ jobs:
27982801
command: |
27992802
LITELLM_LICENSE="$LITELLM_LICENSE" \
28002803
uv run --no-sync python -m litellm.proxy.proxy_cli \
2801-
--config ui/litellm-dashboard/e2e_tests/fixtures/config.yml \
2804+
--config tests/e2e/ui/fixtures/config.yml \
28022805
--port 4000
28032806
background: true
28042807
- run:
@@ -2819,15 +2822,15 @@ jobs:
28192822
# Forward LITELLM_LICENSE so license.spec.ts can detect that the
28202823
# proxy was launched with a license and assert premium_user=true.
28212824
command: |
2822-
cd ui/litellm-dashboard
2825+
cd tests/e2e/ui
28232826
LITELLM_LICENSE="$LITELLM_LICENSE" \
2824-
npx playwright test --config e2e_tests/playwright.config.ts
2827+
npx playwright test --config playwright.config.ts
28252828
no_output_timeout: 10m
28262829
- store_artifacts:
2827-
path: ui/litellm-dashboard/test-results
2830+
path: tests/e2e/ui/test-results
28282831
destination: e2e-test-results
28292832
- store_artifacts:
2830-
path: ui/litellm-dashboard/playwright-report
2833+
path: tests/e2e/ui/playwright-report
28312834
destination: e2e-playwright-report
28322835

28332836
e2e_ui_testing_server_root_path:
@@ -2870,17 +2873,20 @@ jobs:
28702873
- ~/.cache/uv
28712874
- restore_cache:
28722875
keys:
2873-
- ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
2876+
- ui-e2e-node-deps-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }}
28742877
- run:
28752878
name: Install Node dependencies and Playwright
28762879
command: |
28772880
cd ui/litellm-dashboard
28782881
npm ci
2882+
cd ../../tests/e2e/ui
2883+
npm ci
28792884
npx playwright install chromium
28802885
- save_cache:
2881-
key: ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
2886+
key: ui-e2e-node-deps-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }}
28822887
paths:
28832888
- ui/litellm-dashboard/node_modules
2889+
- tests/e2e/ui/node_modules
28842890
- ~/.cache/ms-playwright
28852891
- run:
28862892
name: Build UI from source
@@ -2902,10 +2908,10 @@ jobs:
29022908
name: Seed database
29032909
command: |
29042910
PGPASSWORD=e2epassword psql -h localhost -p 5432 -U e2euser -d litellm_e2e \
2905-
-f ui/litellm-dashboard/e2e_tests/fixtures/seed.sql
2911+
-f tests/e2e/ui/fixtures/seed.sql
29062912
- run:
29072913
name: Start mock LLM server
2908-
command: uv run --no-sync python ui/litellm-dashboard/e2e_tests/fixtures/mock_llm_server/server.py
2914+
command: uv run --no-sync python tests/e2e/ui/fixtures/mock_llm_server/server.py
29092915
background: true
29102916
- run:
29112917
name: Start LiteLLM proxy under a server root path
@@ -2918,7 +2924,7 @@ jobs:
29182924
command: |
29192925
LITELLM_LICENSE="$LITELLM_LICENSE" \
29202926
uv run --no-sync python -m litellm.proxy.proxy_cli \
2921-
--config ui/litellm-dashboard/e2e_tests/fixtures/config.yml \
2927+
--config tests/e2e/ui/fixtures/config.yml \
29222928
--port 4000
29232929
background: true
29242930
- run:
@@ -2937,15 +2943,15 @@ jobs:
29372943
- run:
29382944
name: Run migration smoke under SERVER_ROOT_PATH
29392945
command: |
2940-
cd ui/litellm-dashboard
2946+
cd tests/e2e/ui
29412947
LITELLM_LICENSE="$LITELLM_LICENSE" \
2942-
npx playwright test --config e2e_tests/migration.serverRootPath.config.ts
2948+
npx playwright test --config migration.serverRootPath.config.ts
29432949
no_output_timeout: 10m
29442950
- store_artifacts:
2945-
path: ui/litellm-dashboard/test-results
2951+
path: tests/e2e/ui/test-results
29462952
destination: e2e-server-root-path-test-results
29472953
- store_artifacts:
2948-
path: ui/litellm-dashboard/playwright-report
2954+
path: tests/e2e/ui/playwright-report
29492955
destination: e2e-server-root-path-playwright-report
29502956

29512957
build_docker_database_image:

.circleci/scripts/classify_changes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ has_backend=false
88
while IFS= read -r file || [ -n "$file" ]; do
99
[ -n "$file" ] || continue
1010
case "$file" in
11-
ui/*) has_client=true ;;
11+
ui/* | tests/e2e/ui/*) has_client=true ;;
1212
docs/* | *.md | *.mdx) : ;;
1313
*) has_backend=true ;;
1414
esac

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
id: steps-to-reproduce
3131
attributes:
3232
label: Steps to Reproduce
33-
description: Please provide detailed steps to reproduce this bug(A curl/python code to reproduce the bug)
33+
description: Please provide a numbered list of the exact steps to reproduce this bug (include a curl/python snippet to reproduce it). Number each step (1., 2., 3., ...) in the order you performed them.
3434
placeholder: |
3535
1. config.yaml file/ .env file/ etc.
3636
2. Run the following code...

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## TLDR
2+
3+
<!-- Fill in the bullets below and keep each one short and concrete: one line per bullet, roughly 10 words max
4+
This section must be extremely human parsable, comprehensible, and readable: its target audience is humans, not AI agents -->
5+
6+
Problem this solves:
7+
8+
- <blah>
9+
- ...
10+
11+
How it solves it:
12+
13+
- <blah>
14+
- ...
15+
116
## Relevant issues
217

318
<!-- e.g., "Fixes #000" -->
@@ -25,6 +40,7 @@ If you're seeing a delay in your PR being merged, ping the LiteLLM Team on [Slac
2540
The proof must be completely e2e with no mocks, using, for example, actual LLM calls costing real $. `pytest` commands are not enough
2641
For bug fixes: show reproduction before the fix and passing behavior after
2742
Include the commit hash each proof was captured at, for both the before and the after runs
43+
If the change applies to all three LLM endpoints (/v1/responses, /v1/chat/completions, /v1/messages), include proof for every single one of them, not just one
2844
For new features: show the feature working end-to-end
2945
For UI changes: include before/after screenshots -->
3046

.github/workflows/_test-unit-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Install dependencies
8181
if: steps.changes.outputs.decision != 'skip'
8282
run: |
83-
.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra google --extra proxy --extra semantic-router
83+
.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra google --extra proxy --extra semantic-router --extra saml
8484
8585
- name: Generate Prisma client
8686
if: steps.changes.outputs.decision != 'skip'

.github/workflows/auto_update_price_and_context_window.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ jobs:
2424
- name: Update JSON Data
2525
run: |
2626
uv run --frozen --with 'aiohttp==3.13.3' python ".github/workflows/auto_update_price_and_context_window_file.py"
27+
- name: Regenerate JSON Schema
28+
run: |
29+
uv run --frozen python ci_cd/generate_model_prices_schema.py
2730
- name: Create Pull Request
2831
run: |
29-
git add model_prices_and_context_window.json
32+
git add model_prices_and_context_window.json model_prices_and_context_window.schema.json
3033
git commit -m "Update model_prices_and_context_window.json file: $(date +'%Y-%m-%d')"
3134
gh pr create --title "Update model_prices_and_context_window.json file" \
3235
--body "Automated update for model_prices_and_context_window.json" \

.github/workflows/codspeed.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,24 @@ on:
55
branches:
66
- main
77
- litellm_internal_staging
8+
paths:
9+
- "litellm/**"
10+
- "tests/benchmarks/**"
11+
- "pyproject.toml"
12+
- "uv.lock"
13+
- ".github/workflows/codspeed.yml"
14+
- ".github/actions/setup-uv-with-retries/**"
815
pull_request:
916
branches:
1017
- main
1118
- litellm_internal_staging
19+
paths:
20+
- "litellm/**"
21+
- "tests/benchmarks/**"
22+
- "pyproject.toml"
23+
- "uv.lock"
24+
- ".github/workflows/codspeed.yml"
25+
- ".github/actions/setup-uv-with-retries/**"
1226
# Allow CodSpeed to trigger backtest performance analysis
1327
# in order to generate initial data
1428
workflow_dispatch:

.github/workflows/create_daily_oss_branch.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/guard-main-branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
echo "PR head repo: $HEAD_REPO"
3232
echo "PR head branch: $HEAD_REF"
3333
if [ "$HEAD_REPO" != "$BASE_REPO" ]; then
34-
echo "::error::PRs to main must originate from the canonical repository ($BASE_REPO), not a fork ($HEAD_REPO). External contributors should open PRs against the current daily OSS branch (named litellm_oss_daily_YYYY_MM_DD; a fresh one is cut each weekday, so target the most recent) instead."
34+
echo "::error::PRs to main must originate from the canonical repository ($BASE_REPO), not a fork ($HEAD_REPO). External contributors should open PRs against 'litellm_internal_staging' instead."
3535
exit 1
3636
fi
3737
if [ "$HEAD_REF" = "litellm_internal_staging" ] || [[ "$HEAD_REF" == litellm_hotfix_?* ]]; then
3838
echo "Allowed source branch."
3939
exit 0
4040
fi
41-
echo "::error::PRs to main must originate from 'litellm_internal_staging' or a 'litellm_hotfix_*' branch. Got: '$HEAD_REF'. If this is a contribution, retarget the PR against the current daily OSS branch (named litellm_oss_daily_YYYY_MM_DD; a fresh one is cut each weekday, so target the most recent) instead."
41+
echo "::error::PRs to main must originate from 'litellm_internal_staging' or a 'litellm_hotfix_*' branch. Got: '$HEAD_REF'. If this is a contribution, retarget the PR against 'litellm_internal_staging' instead."
4242
exit 1

.github/workflows/image-scan.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "litellm_**"
1010
paths:
1111
- docker/Dockerfile.non_root
12+
- tests/proxy_migration_tests/test_offline_image_migration.py
1213
- uv.lock
1314
- ui/litellm-dashboard/package-lock.json
1415
- .github/workflows/image-scan.yml
@@ -51,13 +52,32 @@ jobs:
5152
- name: Build runtime image
5253
run: docker build -f docker/Dockerfile.non_root -t litellm-image-scan:${{ github.sha }} .
5354

55+
# The prisma bake must migrate a fresh DB with no egress as an arbitrary
56+
# non-root uid (OpenShift restricted-v2 / air-gapped / readOnlyRootFilesystem).
57+
# `docker run` as the default uid with network hides a broken bake because
58+
# the migration entrypoint exits 0 even when it applied nothing; asserting
59+
# the schema was created is what catches it.
60+
- name: Set up Python
61+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
62+
with:
63+
python-version: "3.12"
64+
65+
- name: Verify offline migration as a non-root uid
66+
env:
67+
LITELLM_IMAGE: litellm-image-scan:${{ github.sha }}
68+
run: |
69+
python -m pip install "pytest==9.0.3"
70+
python -m pytest tests/proxy_migration_tests/test_offline_image_migration.py -v
71+
5472
# Scans the whole shipped artifact: OS/apk plus every language package
5573
# baked into the image, including ones no lockfile declares (e.g. prisma's
5674
# vendored node engine) that osv-scan cannot see. osv-scan stays the fast
5775
# source-level gate; this is the customer's-eye-view backstop. Credential-
5876
# free OSS, run as a pinned, checksum-verified binary; no GitHub Action
5977
# dependency and no vendor SaaS callout.
6078
- name: Scan image for fixable HIGH/CRITICAL CVEs
79+
env:
80+
GRYPE_MATCH_PYTHON_USING_CPES: "true"
6181
run: |
6282
"$RUNNER_TEMP/grype" litellm-image-scan:${{ github.sha }} \
6383
--only-fixed \

0 commit comments

Comments
 (0)