Skip to content

Commit f9a5109

Browse files
authored
Merge branch 'BerriAI:main' into main
2 parents 5dfd0ad + 53f9df5 commit f9a5109

File tree

317 files changed

+16094
-5321
lines changed

Some content is hidden

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

317 files changed

+16094
-5321
lines changed

.circleci/config.yml

+63-13
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
pip install opentelemetry-api==1.25.0
5050
pip install opentelemetry-sdk==1.25.0
5151
pip install opentelemetry-exporter-otlp==1.25.0
52-
pip install openai==1.54.0
52+
pip install openai==1.66.1
5353
pip install prisma==0.11.0
5454
pip install "detect_secrets==1.5.0"
5555
pip install "httpx==0.24.1"
@@ -168,7 +168,7 @@ jobs:
168168
pip install opentelemetry-api==1.25.0
169169
pip install opentelemetry-sdk==1.25.0
170170
pip install opentelemetry-exporter-otlp==1.25.0
171-
pip install openai==1.54.0
171+
pip install openai==1.66.1
172172
pip install prisma==0.11.0
173173
pip install "detect_secrets==1.5.0"
174174
pip install "httpx==0.24.1"
@@ -267,7 +267,7 @@ jobs:
267267
pip install opentelemetry-api==1.25.0
268268
pip install opentelemetry-sdk==1.25.0
269269
pip install opentelemetry-exporter-otlp==1.25.0
270-
pip install openai==1.54.0
270+
pip install openai==1.66.1
271271
pip install prisma==0.11.0
272272
pip install "detect_secrets==1.5.0"
273273
pip install "httpx==0.24.1"
@@ -511,7 +511,7 @@ jobs:
511511
pip install opentelemetry-api==1.25.0
512512
pip install opentelemetry-sdk==1.25.0
513513
pip install opentelemetry-exporter-otlp==1.25.0
514-
pip install openai==1.54.0
514+
pip install openai==1.66.1
515515
pip install prisma==0.11.0
516516
pip install "detect_secrets==1.5.0"
517517
pip install "httpx==0.24.1"
@@ -678,6 +678,48 @@ jobs:
678678
paths:
679679
- llm_translation_coverage.xml
680680
- llm_translation_coverage
681+
llm_responses_api_testing:
682+
docker:
683+
- image: cimg/python:3.11
684+
auth:
685+
username: ${DOCKERHUB_USERNAME}
686+
password: ${DOCKERHUB_PASSWORD}
687+
working_directory: ~/project
688+
689+
steps:
690+
- checkout
691+
- run:
692+
name: Install Dependencies
693+
command: |
694+
python -m pip install --upgrade pip
695+
python -m pip install -r requirements.txt
696+
pip install "pytest==7.3.1"
697+
pip install "pytest-retry==1.6.3"
698+
pip install "pytest-cov==5.0.0"
699+
pip install "pytest-asyncio==0.21.1"
700+
pip install "respx==0.21.1"
701+
# Run pytest and generate JUnit XML report
702+
- run:
703+
name: Run tests
704+
command: |
705+
pwd
706+
ls
707+
python -m pytest -vv tests/llm_responses_api_testing --cov=litellm --cov-report=xml -x -s -v --junitxml=test-results/junit.xml --durations=5
708+
no_output_timeout: 120m
709+
- run:
710+
name: Rename the coverage files
711+
command: |
712+
mv coverage.xml llm_responses_api_coverage.xml
713+
mv .coverage llm_responses_api_coverage
714+
715+
# Store test results
716+
- store_test_results:
717+
path: test-results
718+
- persist_to_workspace:
719+
root: .
720+
paths:
721+
- llm_responses_api_coverage.xml
722+
- llm_responses_api_coverage
681723
litellm_mapped_tests:
682724
docker:
683725
- image: cimg/python:3.11
@@ -1234,7 +1276,7 @@ jobs:
12341276
pip install "aiodynamo==23.10.1"
12351277
pip install "asyncio==3.4.3"
12361278
pip install "PyGithub==1.59.1"
1237-
pip install "openai==1.54.0 "
1279+
pip install "openai==1.66.1"
12381280
- run:
12391281
name: Install Grype
12401282
command: |
@@ -1309,7 +1351,7 @@ jobs:
13091351
command: |
13101352
pwd
13111353
ls
1312-
python -m pytest -s -vv tests/*.py -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/pass_through_tests --ignore=tests/proxy_admin_ui_tests --ignore=tests/load_tests --ignore=tests/llm_translation --ignore=tests/image_gen_tests --ignore=tests/pass_through_unit_tests
1354+
python -m pytest -s -vv tests/*.py -x --junitxml=test-results/junit.xml --durations=5 --ignore=tests/otel_tests --ignore=tests/pass_through_tests --ignore=tests/proxy_admin_ui_tests --ignore=tests/load_tests --ignore=tests/llm_translation --ignore=tests/llm_responses_api_testing --ignore=tests/image_gen_tests --ignore=tests/pass_through_unit_tests
13131355
no_output_timeout: 120m
13141356

13151357
# Store test results
@@ -1370,7 +1412,7 @@ jobs:
13701412
pip install "aiodynamo==23.10.1"
13711413
pip install "asyncio==3.4.3"
13721414
pip install "PyGithub==1.59.1"
1373-
pip install "openai==1.54.0 "
1415+
pip install "openai==1.66.1"
13741416
# Run pytest and generate JUnit XML report
13751417
- run:
13761418
name: Build Docker image
@@ -1492,7 +1534,7 @@ jobs:
14921534
pip install "aiodynamo==23.10.1"
14931535
pip install "asyncio==3.4.3"
14941536
pip install "PyGithub==1.59.1"
1495-
pip install "openai==1.54.0 "
1537+
pip install "openai==1.66.1"
14961538
- run:
14971539
name: Build Docker image
14981540
command: docker build -t my-app:latest -f ./docker/Dockerfile.database .
@@ -1921,7 +1963,7 @@ jobs:
19211963
pip install "pytest-asyncio==0.21.1"
19221964
pip install "google-cloud-aiplatform==1.43.0"
19231965
pip install aiohttp
1924-
pip install "openai==1.54.0 "
1966+
pip install "openai==1.66.1"
19251967
pip install "assemblyai==0.37.0"
19261968
python -m pip install --upgrade pip
19271969
pip install "pydantic==2.7.1"
@@ -1935,12 +1977,12 @@ jobs:
19351977
pip install prisma
19361978
pip install fastapi
19371979
pip install jsonschema
1938-
pip install "httpx==0.24.1"
1980+
pip install "httpx==0.27.0"
19391981
pip install "anyio==3.7.1"
19401982
pip install "asyncio==3.4.3"
19411983
pip install "PyGithub==1.59.1"
19421984
pip install "google-cloud-aiplatform==1.59.0"
1943-
pip install "anthropic==0.21.3"
1985+
pip install "anthropic==0.49.0"
19441986
# Run pytest and generate JUnit XML report
19451987
- run:
19461988
name: Build Docker image
@@ -2068,7 +2110,7 @@ jobs:
20682110
python -m venv venv
20692111
. venv/bin/activate
20702112
pip install coverage
2071-
coverage combine llm_translation_coverage logging_coverage litellm_router_coverage local_testing_coverage litellm_assistants_api_coverage auth_ui_unit_tests_coverage langfuse_coverage caching_coverage litellm_proxy_unit_tests_coverage image_gen_coverage pass_through_unit_tests_coverage batches_coverage litellm_proxy_security_tests_coverage
2113+
coverage combine llm_translation_coverage llm_responses_api_coverage logging_coverage litellm_router_coverage local_testing_coverage litellm_assistants_api_coverage auth_ui_unit_tests_coverage langfuse_coverage caching_coverage litellm_proxy_unit_tests_coverage image_gen_coverage pass_through_unit_tests_coverage batches_coverage litellm_proxy_security_tests_coverage
20722114
coverage xml
20732115
- codecov/upload:
20742116
file: ./coverage.xml
@@ -2197,7 +2239,7 @@ jobs:
21972239
pip install "pytest-retry==1.6.3"
21982240
pip install "pytest-asyncio==0.21.1"
21992241
pip install aiohttp
2200-
pip install "openai==1.54.0 "
2242+
pip install "openai==1.66.1"
22012243
python -m pip install --upgrade pip
22022244
pip install "pydantic==2.7.1"
22032245
pip install "pytest==7.3.1"
@@ -2429,6 +2471,12 @@ workflows:
24292471
only:
24302472
- main
24312473
- /litellm_.*/
2474+
- llm_responses_api_testing:
2475+
filters:
2476+
branches:
2477+
only:
2478+
- main
2479+
- /litellm_.*/
24322480
- litellm_mapped_tests:
24332481
filters:
24342482
branches:
@@ -2468,6 +2516,7 @@ workflows:
24682516
- upload-coverage:
24692517
requires:
24702518
- llm_translation_testing
2519+
- llm_responses_api_testing
24712520
- litellm_mapped_tests
24722521
- batches_testing
24732522
- litellm_utils_testing
@@ -2526,6 +2575,7 @@ workflows:
25262575
- load_testing
25272576
- test_bad_database_url
25282577
- llm_translation_testing
2578+
- llm_responses_api_testing
25292579
- litellm_mapped_tests
25302580
- batches_testing
25312581
- litellm_utils_testing

.circleci/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# used by CI/CD testing
2-
openai==1.54.0
2+
openai==1.66.1
33
python-dotenv
44
tiktoken
55
importlib_metadata

.github/pull_request_template.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77
<!-- e.g. "Fixes #000" -->
88

9+
## Pre-Submission checklist
10+
11+
**Please complete all items before asking a LiteLLM maintainer to review your PR**
12+
13+
- [ ] I have Added testing in the `tests/litellm/` directory, **Adding at least 1 test is a hard requirement** - [see details](https://docs.litellm.ai/docs/extras/contributing_code)
14+
- [ ] I have added a screenshot of my new test passing locally
15+
- [ ] My PR passes all unit tests on (`make test-unit`)[https://docs.litellm.ai/docs/extras/contributing_code]
16+
- [ ] My PR's scope is as isolated as possible, it only solves 1 specific problem
17+
18+
919
## Type
1020

1121
<!-- Select the type of Pull Request -->
@@ -20,10 +30,4 @@
2030

2131
## Changes
2232

23-
<!-- List of changes -->
24-
25-
## [REQUIRED] Testing - Attach a screenshot of any new tests passing locally
26-
If UI changes, send a screenshot/GIF of working UI fixes
27-
28-
<!-- Test procedure -->
2933

.github/workflows/helm_unit_test.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Helm unit test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
unit-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Helm 3.11.1
17+
uses: azure/setup-helm@v1
18+
with:
19+
version: '3.11.1'
20+
21+
- name: Install Helm Unit Test Plugin
22+
run: |
23+
helm plugin install https://github.com/helm-unittest/helm-unittest --version v0.4.4
24+
25+
- name: Run unit tests
26+
run:
27+
helm unittest -f 'tests/*.yaml' deploy/charts/litellm-helm

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# LiteLLM Makefile
2+
# Simple Makefile for running tests and basic development tasks
3+
4+
.PHONY: help test test-unit test-integration
5+
6+
# Default target
7+
help:
8+
@echo "Available commands:"
9+
@echo " make test - Run all tests"
10+
@echo " make test-unit - Run unit tests"
11+
@echo " make test-integration - Run integration tests"
12+
13+
# Testing
14+
test:
15+
poetry run pytest tests/
16+
17+
test-unit:
18+
poetry run pytest tests/litellm/
19+
20+
test-integration:
21+
poetry run pytest tests/ -k "not litellm"

README.md

+1-65
Original file line numberDiff line numberDiff line change
@@ -340,71 +340,7 @@ curl 'http://0.0.0.0:4000/key/generate' \
340340

341341
## Contributing
342342

343-
To contribute: Clone the repo locally -> Make a change -> Submit a PR with the change.
344-
345-
Here's how to modify the repo locally:
346-
347-
Step 1: Clone the repo
348-
349-
```
350-
git clone https://github.com/BerriAI/litellm.git
351-
```
352-
353-
Step 2: Install dependencies:
354-
355-
```
356-
pip install -r requirements.txt
357-
```
358-
359-
Step 3: Test your change:
360-
361-
a. Add a pytest test within `tests/litellm/`
362-
363-
This folder follows the same directory structure as `litellm/`.
364-
365-
If a corresponding test file does not exist, create one.
366-
367-
b. Run the test
368-
369-
```
370-
cd tests/litellm # pwd: Documents/litellm/litellm/tests/litellm
371-
pytest /path/to/test_file.py
372-
```
373-
374-
Step 4: Submit a PR with your changes! 🚀
375-
376-
- push your fork to your GitHub repo
377-
- submit a PR from there
378-
379-
### Building LiteLLM Docker Image
380-
381-
Follow these instructions if you want to build / run the LiteLLM Docker Image yourself.
382-
383-
Step 1: Clone the repo
384-
385-
```
386-
git clone https://github.com/BerriAI/litellm.git
387-
```
388-
389-
Step 2: Build the Docker Image
390-
391-
Build using Dockerfile.non_root
392-
```
393-
docker build -f docker/Dockerfile.non_root -t litellm_test_image .
394-
```
395-
396-
Step 3: Run the Docker Image
397-
398-
Make sure config.yaml is present in the root directory. This is your litellm proxy config file.
399-
```
400-
docker run \
401-
-v $(pwd)/proxy_config.yaml:/app/config.yaml \
402-
-e DATABASE_URL="postgresql://xxxxxxxx" \
403-
-e LITELLM_MASTER_KEY="sk-1234" \
404-
-p 4000:4000 \
405-
litellm_test_image \
406-
--config /app/config.yaml --detailed_debug
407-
```
343+
Interested in contributing? Contributions to LiteLLM Python SDK, Proxy Server, and contributing LLM integrations are both accepted and highly encouraged! [See our Contribution Guide for more details](https://docs.litellm.ai/docs/extras/contributing_code)
408344

409345
# Enterprise
410346
For companies that need better security, user management and professional support

0 commit comments

Comments
 (0)