Skip to content

Commit e3d7412

Browse files
committed
chore: fixes
1 parent 52f2176 commit e3d7412

File tree

72 files changed

+1668
-2067
lines changed

Some content is hidden

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

72 files changed

+1668
-2067
lines changed

.circleci/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ cohere
77
redis==5.2.1
88
redisvl==0.4.1
99
anthropic
10-
orjson==3.10.12 # fast /embedding responses
11-
pydantic==2.11.0
12-
google-cloud-aiplatform==1.43.0
10+
orjson==3.10.15 # fast /embedding responses
11+
pydantic==2.12.5
12+
google-cloud-aiplatform==1.133.0
1313
google-cloud-iam==2.19.1
1414
fastapi-sso==0.16.0
1515
uvloop==0.21.0
16-
mcp==1.25.0 # for MCP server
16+
mcp==1.26.0 # for MCP server
1717
semantic_router==0.1.10 # for auto-routing with litellm
18-
fastuuid==0.12.0
18+
fastuuid==0.14.0
1919
responses==0.25.7 # for proxy client tests
2020
pytest-retry==1.6.3 # for automatic test retries
2121
litellm-proxy-extras # for prisma migrations

.github/actions/helm-oci-chart-releaser/action.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,54 @@ runs:
4141
using: composite
4242
steps:
4343
- name: Helm | Setup
44-
uses: azure/setup-helm@v4
44+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
4545
with:
4646
version: v3.20.0
4747

4848
- name: Helm | Login
4949
shell: bash
50-
run: echo ${{ inputs.registry_password }} | helm registry login -u ${{ inputs.registry_username }} --password-stdin ${{ inputs.registry }}
50+
env:
51+
REGISTRY_PASSWORD: ${{ inputs.registry_password }}
52+
REGISTRY_USERNAME: ${{ inputs.registry_username }}
53+
REGISTRY: ${{ inputs.registry }}
54+
run: echo "$REGISTRY_PASSWORD" | helm registry login -u "$REGISTRY_USERNAME" --password-stdin "$REGISTRY"
5155

5256
- name: Helm | Dependency
5357
if: inputs.update_dependencies == 'true'
5458
shell: bash
55-
run: helm dependency update ${{ inputs.path == null && format('{0}/{1}', 'charts', inputs.name) || inputs.path }}
59+
env:
60+
CHART_PATH: ${{ inputs.path == null && format('{0}/{1}', 'charts', inputs.name) || inputs.path }}
61+
run: helm dependency update "$CHART_PATH"
5662

5763
- name: Helm | Package
5864
shell: bash
59-
run: helm package ${{ inputs.path == null && format('{0}/{1}', 'charts', inputs.name) || inputs.path }} --version ${{ inputs.tag }} --app-version ${{ inputs.app_version }}
65+
env:
66+
CHART_PATH: ${{ inputs.path == null && format('{0}/{1}', 'charts', inputs.name) || inputs.path }}
67+
TAG: ${{ inputs.tag }}
68+
APP_VERSION: ${{ inputs.app_version }}
69+
run: helm package "$CHART_PATH" --version "$TAG" --app-version "$APP_VERSION"
6070

6171
- name: Helm | Push
6272
shell: bash
63-
run: helm push ${{ inputs.name }}-${{ inputs.tag }}.tgz oci://${{ inputs.registry }}/${{ inputs.repository }}
73+
env:
74+
NAME: ${{ inputs.name }}
75+
TAG: ${{ inputs.tag }}
76+
REGISTRY: ${{ inputs.registry }}
77+
REPOSITORY: ${{ inputs.repository }}
78+
run: helm push "${NAME}-${TAG}.tgz" "oci://${REGISTRY}/${REPOSITORY}"
6479

6580
- name: Helm | Logout
6681
shell: bash
67-
run: helm registry logout ${{ inputs.registry }}
82+
env:
83+
REGISTRY: ${{ inputs.registry }}
84+
run: helm registry logout "$REGISTRY"
6885

6986
- name: Helm | Output
7087
id: output
7188
shell: bash
72-
run: echo "image=${{ inputs.registry }}/${{ inputs.repository }}/${{ inputs.name }}:${{ inputs.tag }}" >> $GITHUB_OUTPUT
89+
env:
90+
REGISTRY: ${{ inputs.registry }}
91+
REPOSITORY: ${{ inputs.repository }}
92+
NAME: ${{ inputs.name }}
93+
TAG: ${{ inputs.tag }}
94+
run: echo "image=${REGISTRY}/${REPOSITORY}/${NAME}:${TAG}" >> $GITHUB_OUTPUT

.github/dependabot.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
cooldown:
8+
default-days: 7
9+
semver-major-days: 14
710
groups:
811
github-actions:
912
patterns:
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: _Unit Test Base (Reusable)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-path:
7+
description: "Pytest path(s) to run"
8+
required: true
9+
type: string
10+
workers:
11+
description: "Number of pytest-xdist workers"
12+
required: false
13+
type: number
14+
default: 2
15+
reruns:
16+
description: "Number of reruns for flaky tests"
17+
required: false
18+
type: number
19+
default: 2
20+
timeout-minutes:
21+
description: "Job timeout in minutes"
22+
required: false
23+
type: number
24+
default: 20
25+
max-failures:
26+
description: "Stop after this many failures"
27+
required: false
28+
type: number
29+
default: 10
30+
31+
permissions:
32+
contents: read
33+
34+
jobs:
35+
run:
36+
name: Run tests
37+
runs-on: ubuntu-latest
38+
timeout-minutes: ${{ inputs.timeout-minutes }}
39+
40+
steps:
41+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
42+
with:
43+
persist-credentials: false
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
47+
with:
48+
python-version: "3.12"
49+
50+
- name: Install Poetry
51+
run: pip install 'poetry==2.3.2'
52+
53+
- name: Cache Poetry dependencies
54+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
55+
with:
56+
path: |
57+
~/.cache/pypoetry
58+
~/.cache/pip
59+
.venv
60+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
61+
restore-keys: |
62+
${{ runner.os }}-poetry-
63+
64+
- name: Install dependencies
65+
run: |
66+
poetry config virtualenvs.in-project true
67+
poetry install --with dev,proxy-dev --extras "proxy semantic-router"
68+
poetry run pip install google-genai==1.22.0 \
69+
google-cloud-aiplatform==1.115.0 fastapi-offline==1.7.3 python-multipart==0.0.22 openapi-core==0.23.0
70+
71+
- name: Setup litellm-enterprise
72+
run: |
73+
poetry run pip install --force-reinstall --no-deps -e enterprise/
74+
75+
- name: Generate Prisma client
76+
env:
77+
PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cache
78+
run: |
79+
poetry run pip install nodejs-wheel-binaries==24.13.1
80+
poetry run prisma generate --schema litellm/proxy/schema.prisma
81+
82+
- name: Run tests
83+
env:
84+
TEST_PATH: ${{ inputs.test-path }}
85+
MAX_FAILURES: ${{ inputs.max-failures }}
86+
WORKERS: ${{ inputs.workers }}
87+
RERUNS: ${{ inputs.reruns }}
88+
run: |
89+
poetry run pytest ${TEST_PATH:?} \
90+
--tb=short -vv \
91+
--maxfail="${MAX_FAILURES}" \
92+
-n "${WORKERS}" \
93+
--reruns "${RERUNS}" \
94+
--reruns-delay 1 \
95+
--dist=loadscope \
96+
--durations=20
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: _Unit Test Services Base (Reusable)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-path:
7+
description: "Pytest path(s) to run"
8+
required: true
9+
type: string
10+
workers:
11+
description: "Number of pytest-xdist workers (0 = no parallelism)"
12+
required: false
13+
type: number
14+
default: 2
15+
reruns:
16+
description: "Number of reruns for flaky tests"
17+
required: false
18+
type: number
19+
default: 2
20+
timeout-minutes:
21+
description: "Job timeout in minutes"
22+
required: false
23+
type: number
24+
default: 20
25+
max-failures:
26+
description: "Stop after this many failures"
27+
required: false
28+
type: number
29+
default: 10
30+
enable-redis:
31+
description: "Pass Redis Cloud credentials to tests via REDIS_HOST/PORT/PASSWORD env vars"
32+
required: false
33+
type: boolean
34+
default: false
35+
enable-postgres:
36+
description: "Start a local Postgres service container and run Prisma migrations"
37+
required: false
38+
type: boolean
39+
default: false
40+
secrets:
41+
REDIS_HOST:
42+
required: false
43+
REDIS_PORT:
44+
required: false
45+
REDIS_PASSWORD:
46+
required: false
47+
DATABASE_URL:
48+
required: false
49+
POSTGRES_USER:
50+
required: false
51+
POSTGRES_PASSWORD:
52+
required: false
53+
54+
permissions:
55+
contents: read
56+
57+
jobs:
58+
run:
59+
name: Run tests
60+
runs-on: ubuntu-latest
61+
timeout-minutes: ${{ inputs.timeout-minutes }}
62+
# Environment is derived from the enable-* flags, not caller-controllable.
63+
# This prevents callers from passing arbitrary environment names to bypass secret scoping.
64+
# Note: Postgres service container always starts (GHA limitation), so any Redis job
65+
# also needs Postgres secrets → uses integration-redis-postgres, not integration-redis.
66+
environment: >-
67+
${{
68+
inputs.enable-redis && 'integration-redis-postgres' ||
69+
inputs.enable-postgres && 'integration-postgres' ||
70+
''
71+
}}
72+
73+
services:
74+
postgres:
75+
image: postgres@sha256:705a5d5b5836f3fcba0d02c4d281e6a7dd9ed2dd4078640f08a1e1e9896e097d # postgres:14
76+
env:
77+
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
78+
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
79+
POSTGRES_DB: litellm_test
80+
ports:
81+
- 5432:5432
82+
options: >-
83+
--health-cmd "pg_isready"
84+
--health-interval 10s
85+
--health-timeout 5s
86+
--health-retries 5
87+
88+
steps:
89+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
90+
with:
91+
persist-credentials: false
92+
93+
- name: Set up Python
94+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
95+
with:
96+
python-version: "3.12"
97+
98+
- name: Install Poetry
99+
run: pip install 'poetry==2.3.2'
100+
101+
- name: Cache Poetry dependencies
102+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
103+
with:
104+
path: |
105+
~/.cache/pypoetry
106+
~/.cache/pip
107+
.venv
108+
key: ${{ runner.os }}-poetry-services-${{ hashFiles('poetry.lock') }}
109+
restore-keys: |
110+
${{ runner.os }}-poetry-services-
111+
112+
- name: Install dependencies
113+
run: |
114+
poetry config virtualenvs.in-project true
115+
poetry install --with dev,proxy-dev --extras "proxy semantic-router"
116+
poetry run pip install google-genai==1.22.0 \
117+
google-cloud-aiplatform==1.115.0 fastapi-offline==1.7.3 python-multipart==0.0.22 openapi-core==0.23.0
118+
119+
- name: Setup litellm-enterprise
120+
run: |
121+
poetry run pip install --force-reinstall --no-deps -e enterprise/
122+
123+
- name: Generate Prisma client
124+
env:
125+
PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cache
126+
run: |
127+
poetry run pip install nodejs-wheel-binaries==24.13.1
128+
poetry run prisma generate --schema litellm/proxy/schema.prisma
129+
130+
- name: Run Prisma migrations
131+
if: ${{ inputs.enable-postgres }}
132+
env:
133+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
134+
run: |
135+
poetry run prisma db push --schema litellm/proxy/schema.prisma --accept-data-loss
136+
137+
- name: Run tests
138+
env:
139+
TEST_PATH: ${{ inputs.test-path }}
140+
MAX_FAILURES: ${{ inputs.max-failures }}
141+
WORKERS: ${{ inputs.workers }}
142+
RERUNS: ${{ inputs.reruns }}
143+
DATABASE_URL: ${{ inputs.enable-postgres && secrets.DATABASE_URL || '' }}
144+
REDIS_HOST: ${{ inputs.enable-redis && secrets.REDIS_HOST || '' }}
145+
REDIS_PORT: ${{ inputs.enable-redis && secrets.REDIS_PORT || '' }}
146+
REDIS_PASSWORD: ${{ inputs.enable-redis && secrets.REDIS_PASSWORD || '' }}
147+
run: |
148+
if [ "${WORKERS}" = "0" ]; then
149+
poetry run pytest ${TEST_PATH:?} \
150+
--tb=short -vv \
151+
--maxfail="${MAX_FAILURES}" \
152+
--reruns "${RERUNS}" \
153+
--reruns-delay 1 \
154+
--durations=20
155+
else
156+
poetry run pytest ${TEST_PATH:?} \
157+
--tb=short -vv \
158+
--maxfail="${MAX_FAILURES}" \
159+
-n "${WORKERS}" \
160+
--reruns "${RERUNS}" \
161+
--reruns-delay 1 \
162+
--dist=loadscope \
163+
--durations=20
164+
fi

.github/workflows/auto_update_price_and_context_window.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,24 @@ name: Updates model_prices_and_context_window.json and Create Pull Request
22

33
on:
44
schedule:
5-
- cron: "0 0 * * 0" # Run every Sundays at midnight
5+
- cron: "0 0 * * 0" # Run every Sundays at midnight
66
#- cron: "0 0 * * *" # Run daily at midnight
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
auto_update_price_and_context_window:
1014
if: github.repository == 'BerriAI/litellm'
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
18+
with:
19+
persist-credentials: false
1420
- name: Install Dependencies
1521
run: |
16-
pip install aiohttp
22+
pip install 'aiohttp==3.13.3'
1723
- name: Update JSON Data
1824
run: |
1925
python ".github/workflows/auto_update_price_and_context_window_file.py"
@@ -26,4 +32,4 @@ jobs:
2632
--head auto-update-price-and-context-window-$(date +'%Y-%m-%d') \
2733
--base main
2834
env:
29-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
35+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)