Skip to content

Commit 9925101

Browse files
author
Krish Dholakia
authored
Merge branch 'main' into litellm_oss_staging_02_18_2026
2 parents 42afba9 + f44e67b commit 9925101

File tree

2,346 files changed

+221422
-33381
lines changed

Some content is hidden

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

2,346 files changed

+221422
-33381
lines changed

.circleci/config.yml

Lines changed: 190 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ commands:
2121
- run:
2222
name: "Install local version of litellm-enterprise"
2323
command: |
24-
cd enterprise
25-
python -m pip install -e .
26-
cd ..
24+
pip install --force-reinstall --no-deps -e enterprise/
2725
setup_litellm_test_deps:
2826
steps:
2927
- checkout
@@ -71,9 +69,11 @@ jobs:
7169
- run:
7270
name: Install Python
7371
command: |
74-
choco install python --version=3.11.0 -y
72+
choco install python --version=3.11.0 -y --no-progress --force
7573
refreshenv
7674
python --version
75+
environment:
76+
CHOCOLATEY_CONFIRM_ALL: "true"
7777
- run:
7878
name: Install Dependencies
7979
command: |
@@ -1183,7 +1183,7 @@ jobs:
11831183
command: |
11841184
pwd
11851185
ls
1186-
python -m pytest tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --cov=litellm --cov-report=xml --junitxml=test-results/junit-part2.xml --durations=10 -n 8 --timeout=300 -vv --log-cli-level=INFO
1186+
python -m pytest tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --cov=litellm --cov-report=xml --junitxml=test-results/junit-part2.xml --durations=10 -n 4 --timeout=300 -vv --log-cli-level=INFO
11871187
no_output_timeout: 120m
11881188
- run:
11891189
name: Rename the coverage files
@@ -1458,6 +1458,7 @@ jobs:
14581458
pip install "respx==0.22.0"
14591459
pip install "pydantic==2.10.2"
14601460
pip install "boto3==1.36.0"
1461+
pip install "semantic_router==0.1.10"
14611462
# Run pytest and generate JUnit XML report
14621463
- run:
14631464
name: Run tests
@@ -1700,7 +1701,7 @@ jobs:
17001701
command: |
17011702
prisma generate
17021703
export PYTHONUNBUFFERED=1
1703-
python -m pytest tests/test_litellm/proxy --ignore=tests/test_litellm/proxy/guardrails --ignore=tests/test_litellm/proxy/management_endpoints --ignore=tests/test_litellm/proxy/_experimental --ignore=tests/test_litellm/proxy/client --ignore=tests/test_litellm/proxy/auth --cov=litellm --cov-report=xml --junitxml=test-results/junit-proxy-part2.xml --durations=10 -n 8 --maxfail=5 --timeout=60 -vv --log-cli-level=WARNING -r A
1704+
python -m pytest tests/test_litellm/proxy --ignore=tests/test_litellm/proxy/guardrails --ignore=tests/test_litellm/proxy/management_endpoints --ignore=tests/test_litellm/proxy/_experimental --ignore=tests/test_litellm/proxy/client --ignore=tests/test_litellm/proxy/auth --cov=litellm --cov-report=xml --junitxml=test-results/junit-proxy-part2.xml --durations=10 -n 4 --maxfail=5 --timeout=120 -vv --log-cli-level=WARNING -r A
17041705
no_output_timeout: 60m
17051706
- run:
17061707
name: Rename the coverage files
@@ -3690,6 +3691,114 @@ jobs:
36903691
- store_test_results:
36913692
path: test-results
36923693

3694+
proxy_e2e_azure_batches_tests:
3695+
machine:
3696+
image: ubuntu-2204:2023.10.1
3697+
resource_class: xlarge
3698+
working_directory: ~/project
3699+
steps:
3700+
- checkout
3701+
- setup_google_dns
3702+
- run:
3703+
name: Install Docker CLI
3704+
command: |
3705+
curl -fsSL https://get.docker.com | sh
3706+
sudo usermod -aG docker $USER
3707+
docker version
3708+
- run:
3709+
name: Install Python 3.12
3710+
command: |
3711+
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh --output miniconda.sh
3712+
bash miniconda.sh -b -p $HOME/miniconda
3713+
export PATH="$HOME/miniconda/bin:$PATH"
3714+
conda init bash
3715+
source ~/.bashrc
3716+
conda create -n myenv python=3.12 -y
3717+
conda activate myenv
3718+
python --version
3719+
- run:
3720+
name: Install Poetry
3721+
command: |
3722+
export PATH="$HOME/miniconda/bin:$PATH"
3723+
source $HOME/miniconda/etc/profile.d/conda.sh
3724+
conda activate myenv
3725+
pip install poetry
3726+
- run:
3727+
name: Install dockerize
3728+
command: |
3729+
wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz
3730+
sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz
3731+
rm dockerize-linux-amd64-v0.6.1.tar.gz
3732+
- run:
3733+
name: Start PostgreSQL Database
3734+
command: |
3735+
docker run -d \
3736+
--name postgres-db \
3737+
-e POSTGRES_USER=llmproxy \
3738+
-e POSTGRES_PASSWORD=dbpassword9090 \
3739+
-e POSTGRES_DB=litellm \
3740+
-p 5432:5432 \
3741+
postgres:15
3742+
- run:
3743+
name: Wait for PostgreSQL to be ready
3744+
command: dockerize -wait tcp://localhost:5432 -timeout 1m
3745+
- run:
3746+
name: Install system dependencies
3747+
command: |
3748+
sudo apt-get update -y
3749+
sudo apt-get install -y libpq-dev
3750+
- run:
3751+
name: Install Dependencies
3752+
command: |
3753+
export PATH="$HOME/miniconda/bin:$PATH"
3754+
source $HOME/miniconda/etc/profile.d/conda.sh
3755+
conda activate myenv
3756+
poetry config virtualenvs.in-project true
3757+
poetry install --with dev,proxy-dev --extras "proxy"
3758+
poetry run pip install psycopg2-binary uvicorn fastapi httpx tenacity
3759+
- run:
3760+
name: Setup litellm-enterprise
3761+
command: |
3762+
export PATH="$HOME/miniconda/bin:$PATH"
3763+
source $HOME/miniconda/etc/profile.d/conda.sh
3764+
conda activate myenv
3765+
poetry run pip install --force-reinstall --no-deps -e enterprise/
3766+
- run:
3767+
name: Generate Prisma client
3768+
command: |
3769+
export PATH="$HOME/miniconda/bin:$PATH"
3770+
source $HOME/miniconda/etc/profile.d/conda.sh
3771+
conda activate myenv
3772+
poetry run prisma generate --schema litellm/proxy/schema.prisma
3773+
- run:
3774+
name: Run Prisma migrations
3775+
command: |
3776+
export PATH="$HOME/miniconda/bin:$PATH"
3777+
source $HOME/miniconda/etc/profile.d/conda.sh
3778+
conda activate myenv
3779+
export DATABASE_URL=postgresql://llmproxy:dbpassword9090@localhost:5432/litellm
3780+
cd litellm/proxy
3781+
poetry run prisma migrate deploy --schema schema.prisma
3782+
cd ../..
3783+
- run:
3784+
name: Run Azure Batch E2E Tests
3785+
command: |
3786+
export PATH="$HOME/miniconda/bin:$PATH"
3787+
source $HOME/miniconda/etc/profile.d/conda.sh
3788+
conda activate myenv
3789+
export DATABASE_URL=postgresql://llmproxy:dbpassword9090@localhost:5432/litellm
3790+
export USE_LOCAL_LITELLM=true
3791+
export USE_MOCK_MODELS=true
3792+
export USE_STATE_TRACKER=true
3793+
export LITELLM_LOG=DEBUG
3794+
poetry run pytest tests/proxy_e2e_azure_batches_tests/test_proxy_e2e_azure_batches.py \
3795+
-vv -s -k "test_e2e_managed_batch" \
3796+
--tb=short \
3797+
--maxfail=3 \
3798+
--durations=10 \
3799+
--junitxml=test-results/junit.xml
3800+
no_output_timeout: 30m
3801+
36933802
upload-coverage:
36943803
docker:
36953804
- image: cimg/python:3.9
@@ -3887,7 +3996,7 @@ jobs:
38873996
command: |
38883997
cd ~/project
38893998
# Check pyproject.toml
3890-
CURRENT_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['dependencies']['litellm-proxy-extras'].split('\"')[1])")
3999+
CURRENT_VERSION=$(python -c "import toml; dep = toml.load('pyproject.toml')['tool']['poetry']['dependencies']['litellm-proxy-extras']; print(dep['version'] if isinstance(dep, dict) else dep)")
38914000
if [ "$CURRENT_VERSION" != "$NEW_VERSION" ]; then
38924001
echo "Error: Version in pyproject.toml ($CURRENT_VERSION) doesn't match new version ($NEW_VERSION)"
38934002
exit 1
@@ -4101,6 +4210,63 @@ jobs:
41014210
path: playwright-report
41024211
destination: playwright-report
41034212

4213+
prisma_schema_sync:
4214+
machine:
4215+
image: ubuntu-2204:2023.10.1
4216+
resource_class: xlarge
4217+
working_directory: ~/project
4218+
steps:
4219+
- checkout
4220+
- setup_google_dns
4221+
- attach_workspace:
4222+
at: ~/project
4223+
- run:
4224+
name: Load Docker Database Image
4225+
command: |
4226+
gunzip -c litellm-docker-database.tar.gz | docker load
4227+
docker images | grep litellm-docker-database
4228+
- run:
4229+
name: Install Neon CLI
4230+
command: |
4231+
npm i -g neonctl
4232+
- run:
4233+
name: Install curl and dockerize
4234+
command: |
4235+
sudo apt-get update
4236+
sudo apt-get install -y curl
4237+
sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz
4238+
sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz
4239+
sudo rm dockerize-linux-amd64-v0.6.1.tar.gz
4240+
- run:
4241+
name: Sync schema on base e2e database
4242+
command: |
4243+
BASE_DATABASE_URL=$(neon connection-string \
4244+
--project-id $NEON_PROJECT_ID \
4245+
--api-key $NEON_API_KEY \
4246+
--branch br-fancy-paper-ad1olsb3 \
4247+
--database-name yuneng-trial-db \
4248+
--role neondb_owner)
4249+
docker run -d \
4250+
-p 4000:4000 \
4251+
-e DATABASE_URL=$BASE_DATABASE_URL \
4252+
-e LITELLM_MASTER_KEY="sk-1234" \
4253+
--name schema-sync \
4254+
-v $(pwd)/litellm/proxy/example_config_yaml/simple_config.yaml:/app/config.yaml \
4255+
litellm-docker-database:ci \
4256+
--config /app/config.yaml \
4257+
--port 4000 \
4258+
--use_prisma_db_push
4259+
- run:
4260+
name: Start outputting logs
4261+
command: docker logs -f schema-sync
4262+
background: true
4263+
- run:
4264+
name: Wait for proxy to be ready (schema sync complete)
4265+
command: dockerize -wait http://localhost:4000 -timeout 5m
4266+
- run:
4267+
name: Stop schema sync container
4268+
command: docker stop schema-sync
4269+
41044270
test_nonroot_image:
41054271
machine:
41064272
image: ubuntu-2204:2023.10.1
@@ -4299,13 +4465,23 @@ workflows:
42994465
only:
43004466
- main
43014467
- /litellm_.*/
4468+
- prisma_schema_sync:
4469+
context: e2e_ui_tests
4470+
requires:
4471+
- build_docker_database_image
4472+
filters:
4473+
branches:
4474+
only:
4475+
- main
4476+
- /litellm_.*/
43024477
- e2e_ui_testing:
43034478
name: e2e_ui_testing_chromium
43044479
browser: chromium
43054480
context: e2e_ui_tests
43064481
requires:
43074482
- ui_build
43084483
- build_docker_database_image
4484+
- prisma_schema_sync
43094485
filters:
43104486
branches:
43114487
only:
@@ -4318,6 +4494,7 @@ workflows:
43184494
requires:
43194495
- ui_build
43204496
- build_docker_database_image
4497+
- prisma_schema_sync
43214498
filters:
43224499
branches:
43234500
only:
@@ -4391,6 +4568,12 @@ workflows:
43914568
only:
43924569
- main
43934570
- /litellm_.*/
4571+
- proxy_e2e_azure_batches_tests:
4572+
filters:
4573+
branches:
4574+
only:
4575+
- main
4576+
- /litellm_.*/
43944577
- llm_translation_testing:
43954578
filters:
43964579
branches:

.claude/settings.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git show:*)",
5+
"Bash(git worktree add:*)",
6+
"Read(//Users/krrishdholakia/Documents/litellm/**)",
7+
"Read(//Users/krrishdholakia/Documents/litellm-claude-code-guardrails/litellm/types/**)",
8+
"Read(//Users/krrishdholakia/Documents/litellm-claude-code-guardrails/**)",
9+
"Read(//Users/krrishdholakia/Documents/litellm-claude-code-guardrails/litellm/**)",
10+
"Bash(python:*)",
11+
"Bash(python -c \"\nimport sys; sys.path.insert\\(0, ''.''\\)\nfrom litellm.proxy.guardrails.guardrail_hooks.claude_code.guardrail import ClaudeCodeGuardrail, HOSTED_TOOL_PREFIXES\nprint\\(''HOSTED_TOOL_PREFIXES:'', HOSTED_TOOL_PREFIXES\\)\nprint\\(''ClaudeCodeGuardrail imported OK''\\)\n\")",
12+
"Read(//Users/krrishdholakia/Documents/litellm-mcp-jwt-groups/litellm/proxy/**)",
13+
"Read(//Users/krrishdholakia/Documents/litellm-mcp-jwt-groups/**)",
14+
"Bash(poetry run pytest:*)",
15+
"Bash(git add:*)",
16+
"Bash(git commit:*)",
17+
"Bash(poetry run python:*)",
18+
"Bash(poetry run pip:*)",
19+
"Bash(git reset:*)",
20+
"Bash(git cherry-pick:*)",
21+
"Bash(git checkout:*)",
22+
"Read(//Users/krrishdholakia/Documents/litellm/litellm/proxy/guardrails/guardrail_hooks/**)",
23+
"Read(//Users/krrishdholakia/Documents/**)",
24+
"Bash(git -C /Users/krrishdholakia/Documents/litellm-mcp-user-permissions worktree list)",
25+
"Bash(ls:*)"
26+
],
27+
"additionalDirectories": [
28+
"/Users/krrishdholakia/Documents/litellm-mcp-group-plan/plan",
29+
"/Users/krrishdholakia/Documents/litellm-claude-code-guardrails/litellm/proxy/guardrails/guardrail_hooks/claude_code",
30+
"/Users/krrishdholakia/Documents/litellm-claude-code-guardrails/litellm/types",
31+
"/Users/krrishdholakia/Documents/litellm-claude-code-guardrails",
32+
"/Users/krrishdholakia/Documents/litellm-mcp-jwt-groups/litellm/proxy",
33+
"/Users/krrishdholakia/Documents/litellm-mcp-jwt-groups/tests/test_litellm/proxy/auth"
34+
]
35+
}
36+
}

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: Schedule Demo
4-
url: https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat
4+
url: https://calendly.com/d/cx9p-5yf-2nm/litellm-introductions
55
about: Speak directly with Krrish and Ishaan, the founders, to discuss issues, share feedback, or explore improvements for LiteLLM
66
- name: Discord
77
url: https://discord.com/invite/wuPM9dRgDw

.github/codeql/codeql-config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "LiteLLM CodeQL config"
2+
3+
# Exclude queries that produce result sets > 2 GiB on this codebase,
4+
# causing 49+ minute runs that fail and block CI resources.
5+
query-filters:
6+
- exclude:
7+
id: py/clear-text-logging-sensitive-data # CWE-312/CleartextLogging.ql — result set > 2 GiB
8+
- exclude:
9+
id: py/polynomial-redos # CWE-730/PolynomialReDoS.ql — result set > 2 GiB
10+
11+
paths-ignore:
12+
- tests
13+
- docs
14+
- "**/*.md"
15+
- litellm/proxy/_experimental/out
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# LiteLLM Observatory Test Configuration
2+
# This config is used by CI to spin up a temporary LiteLLM instance
3+
# for running observatory tests against RC/stable releases.
4+
#
5+
# Add model definitions for the providers you want to test.
6+
# Provider API keys are injected via environment variables in CI.
7+
8+
model_list:
9+
- model_name: gpt-4o
10+
litellm_params:
11+
model: azure/gpt-4o
12+
api_key: os.environ/AZURE_API_KEY
13+
api_base: os.environ/AZURE_API_BASE
14+
15+
- model_name: gpt-4o-mini
16+
litellm_params:
17+
model: azure/gpt-4o-mini
18+
api_key: os.environ/AZURE_API_KEY
19+
api_base: os.environ/AZURE_API_BASE

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Please complete all items before asking a LiteLLM maintainer to review your PR**
88

9-
- [ ] I have Added testing in the [`tests/litellm/`](https://github.com/BerriAI/litellm/tree/main/tests/litellm) directory, **Adding at least 1 test is a hard requirement** - [see details](https://docs.litellm.ai/docs/extras/contributing_code)
9+
- [ ] I have Added testing in the [`tests/test_litellm/`](https://github.com/BerriAI/litellm/tree/main/tests/test_litellm) directory, **Adding at least 1 test is a hard requirement** - [see details](https://docs.litellm.ai/docs/extras/contributing_code)
1010
- [ ] My PR passes all unit tests on [`make test-unit`](https://docs.litellm.ai/docs/extras/contributing_code)
1111
- [ ] My PR's scope is as isolated as possible, it only solves 1 specific problem
1212
- [ ] I have requested a Greptile review by commenting `@greptileai` and received a **Confidence Score of at least 4/5** before requesting a maintainer review

0 commit comments

Comments
 (0)