diff --git a/.circleci/config.yml b/.circleci/config.yml index 321236f46..440343b45 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,11 @@ jobs: steps: - checkout + - run: + name: Show git commit hash + command: | + echo "Git commit hash: $CIRCLE_SHA1" + - run: name: Check if litellm dir was updated or if pyproject.toml was modified command: | @@ -31,16 +36,17 @@ jobs: pip install "google-generativeai==0.3.2" pip install "google-cloud-aiplatform==1.43.0" pip install pyarrow - pip install "boto3>=1.28.57" - pip install "aioboto3>=12.3.0" + pip install "boto3==1.34.34" + pip install "aioboto3==12.3.0" pip install langchain pip install lunary==0.2.5 - pip install "langfuse>=2.0.0" + pip install "langfuse==2.7.3" pip install numpydoc pip install traceloop-sdk==0.0.69 pip install openai pip install prisma pip install "httpx==0.24.1" + pip install fastapi pip install "gunicorn==21.2.0" pip install "anyio==3.7.1" pip install "aiodynamo==23.10.1" @@ -51,6 +57,7 @@ jobs: pip install "pytest-mock==3.12.0" pip install python-multipart pip install google-cloud-aiplatform + pip install prometheus-client==0.20.0 - save_cache: paths: - ./venv @@ -73,7 +80,7 @@ jobs: name: Linting Testing command: | cd litellm - python -m pip install types-requests types-setuptools types-redis + python -m pip install types-requests types-setuptools types-redis types-PyYAML if ! python -m mypy . --ignore-missing-imports; then echo "mypy detected errors" exit 1 @@ -123,6 +130,7 @@ jobs: build_and_test: machine: image: ubuntu-2204:2023.10.1 + resource_class: xlarge working_directory: ~/project steps: - checkout @@ -182,12 +190,19 @@ jobs: -p 4000:4000 \ -e DATABASE_URL=$PROXY_DOCKER_DB_URL \ -e AZURE_API_KEY=$AZURE_API_KEY \ + -e REDIS_HOST=$REDIS_HOST \ + -e REDIS_PASSWORD=$REDIS_PASSWORD \ + -e REDIS_PORT=$REDIS_PORT \ -e AZURE_FRANCE_API_KEY=$AZURE_FRANCE_API_KEY \ -e AZURE_EUROPE_API_KEY=$AZURE_EUROPE_API_KEY \ -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ -e AWS_REGION_NAME=$AWS_REGION_NAME \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ + -e LANGFUSE_PROJECT1_PUBLIC=$LANGFUSE_PROJECT1_PUBLIC \ + -e LANGFUSE_PROJECT2_PUBLIC=$LANGFUSE_PROJECT2_PUBLIC \ + -e LANGFUSE_PROJECT1_SECRET=$LANGFUSE_PROJECT1_SECRET \ + -e LANGFUSE_PROJECT2_SECRET=$LANGFUSE_PROJECT2_SECRET \ --name my-app \ -v $(pwd)/proxy_server_config.yaml:/app/config.yaml \ my-app:latest \ @@ -292,7 +307,7 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: Bearer $GITHUB_TOKEN" \ "https://api.github.com/repos/BerriAI/litellm/actions/workflows/ghcr_deploy.yml/dispatches" \ - -d "{\"ref\":\"main\", \"inputs\":{\"tag\":\"v${VERSION}\"}}" + -d "{\"ref\":\"main\", \"inputs\":{\"tag\":\"v${VERSION}\", \"commit_hash\":\"$CIRCLE_SHA1\"}}" workflows: version: 2 diff --git a/.circleci/requirements.txt b/.circleci/requirements.txt index f42ae6a34..b505536e2 100644 --- a/.circleci/requirements.txt +++ b/.circleci/requirements.txt @@ -3,11 +3,10 @@ openai python-dotenv tiktoken importlib_metadata -baseten cohere redis anthropic orjson -pydantic +pydantic==1.10.14 google-cloud-aiplatform==1.43.0 redisvl==0.0.7 # semantic caching \ No newline at end of file diff --git a/.dockerignore b/.dockerignore index efff383d4..78833aa31 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ -/docs -/cookbook -/.circleci -/.github -/tests \ No newline at end of file +docs +cookbook +.circleci +.github +tests diff --git a/.github/workflows/ghcr_deploy.yml b/.github/workflows/ghcr_deploy.yml index b3a104e1d..58cda02c3 100644 --- a/.github/workflows/ghcr_deploy.yml +++ b/.github/workflows/ghcr_deploy.yml @@ -5,6 +5,13 @@ on: inputs: tag: description: "The tag version you want to build" + release_type: + description: "The release type you want to build. Can be 'latest', 'stable', 'dev'" + type: string + default: "latest" + commit_hash: + description: "Commit hash" + required: true # Defines two custom environment variables for the workflow. Used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -85,9 +92,9 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@4976231911ebf5f32aad765192d35f942aa48cb8 with: - context: . + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} push: true - tags: ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta.outputs.tags }}-latest # if a tag is provided, use that, otherwise use the release tag, and if neither is available, use 'latest' + tags: ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.release_type }} # if a tag is provided, use that, otherwise use the release tag, and if neither is available, use 'latest' labels: ${{ steps.meta.outputs.labels }} platforms: local,linux/amd64,linux/arm64,linux/arm64/v8 @@ -121,10 +128,10 @@ jobs: - name: Build and push Database Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - context: . + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} file: Dockerfile.database push: true - tags: ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-database.outputs.tags }}-latest + tags: ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.release_type }} labels: ${{ steps.meta-database.outputs.labels }} platforms: local,linux/amd64,linux/arm64,linux/arm64/v8 @@ -158,11 +165,10 @@ jobs: - name: Build and push Database Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - context: . + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} file: ./litellm-js/spend-logs/Dockerfile push: true - tags: ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-spend-logs.outputs.tags }}-latest - labels: ${{ steps.meta-spend-logs.outputs.labels }} + tags: ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.release_type }} platforms: local,linux/amd64,linux/arm64,linux/arm64/v8 build-and-push-helm-chart: @@ -236,17 +242,20 @@ jobs: with: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | + const commitHash = "${{ github.event.inputs.commit_hash}}"; + console.log("Commit Hash:", commitHash); // Add this line for debugging try { const response = await github.rest.repos.createRelease({ draft: false, generate_release_notes: true, + target_commitish: commitHash, name: process.env.RELEASE_TAG, owner: context.repo.owner, prerelease: false, repo: context.repo.repo, tag_name: process.env.RELEASE_TAG, }); - + core.exportVariable('RELEASE_ID', response.data.id); core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); } catch (error) { @@ -288,4 +297,3 @@ jobs: } ] }' $WEBHOOK_URL - diff --git a/.github/workflows/interpret_load_test.py b/.github/workflows/interpret_load_test.py index b52d4d2b3..9d95c768f 100644 --- a/.github/workflows/interpret_load_test.py +++ b/.github/workflows/interpret_load_test.py @@ -77,6 +77,9 @@ if __name__ == "__main__": new_release_body = ( existing_release_body + "\n\n" + + "### Don't want to maintain your internal proxy? get in touch 🎉" + + "\nHosted Proxy Alpha: https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat" + + "\n\n" + "## Load Test LiteLLM Proxy Results" + "\n\n" + markdown_table diff --git a/.github/workflows/locustfile.py b/.github/workflows/locustfile.py index 9e5b62ff0..5dce0bb02 100644 --- a/.github/workflows/locustfile.py +++ b/.github/workflows/locustfile.py @@ -10,7 +10,7 @@ class MyUser(HttpUser): def chat_completion(self): headers = { "Content-Type": "application/json", - "Authorization": f"Bearer sk-gUvTeN9g0sgHBMf9HeCaqA", + "Authorization": f"Bearer sk-S2-EZTUUDY0EmM6-Fy0Fyw", # Include any additional headers you may need for authentication, etc. } diff --git a/.gitignore b/.gitignore index b03bc895b..357f3e1bf 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,9 @@ deploy/charts/litellm/charts/* deploy/charts/*.tgz litellm/proxy/vertex_key.json **/.vim/ +/node_modules +kub.yaml +loadtest_kub.yaml +litellm/proxy/_new_secret_config.yaml +litellm/proxy/_new_secret_config.yaml +litellm/proxy/_super_secret_config.yaml diff --git a/Dockerfile b/Dockerfile index 3262d42b5..c8e9956b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,5 +70,4 @@ EXPOSE 4000/tcp ENTRYPOINT ["litellm"] # Append "--detailed_debug" to the end of CMD to view detailed debug logs -# CMD ["--port", "4000", "--config", "./proxy_server_config.yaml"] -CMD ["--port", "4000", "--config", "./proxy_server_config.yaml"] +CMD ["--port", "4000"] diff --git a/README.md b/README.md index 5a1440f97..3caeb830b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@
Call all LLM APIs using the OpenAI format [Bedrock, Huggingface, VertexAI, TogetherAI, Azure, OpenAI, etc.]