From c97724df7de3d3dcf6f4db7d2ad7b867296facce Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 27 Mar 2024 15:51:00 -0700 Subject: [PATCH 1/5] (fix) remove background tasks --- litellm/proxy/proxy_server.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 8fa2862f2..311d3d2be 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -130,7 +130,6 @@ from fastapi import ( HTTPException, status, Depends, - BackgroundTasks, Header, Response, Form, @@ -2896,7 +2895,6 @@ async def completion( fastapi_response: Response, model: Optional[str] = None, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), - background_tasks: BackgroundTasks = BackgroundTasks(), ): global user_temperature, user_request_timeout, user_max_tokens, user_api_base try: @@ -3062,7 +3060,6 @@ async def chat_completion( fastapi_response: Response, model: Optional[str] = None, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), - background_tasks: BackgroundTasks = BackgroundTasks(), ): global general_settings, user_debug, proxy_logging_obj, llm_model_list try: @@ -3299,7 +3296,6 @@ async def embeddings( request: Request, model: Optional[str] = None, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), - background_tasks: BackgroundTasks = BackgroundTasks(), ): global proxy_logging_obj try: @@ -3475,7 +3471,6 @@ async def embeddings( async def image_generation( request: Request, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), - background_tasks: BackgroundTasks = BackgroundTasks(), ): global proxy_logging_obj try: @@ -6158,7 +6153,7 @@ async def block_team( raise Exception("No DB Connected.") record = await prisma_client.db.litellm_teamtable.update( - where={"team_id": data.team_id}, data={"blocked": True} + where={"team_id": data.team_id}, data={"blocked": True} # type: ignore ) return record @@ -6180,7 +6175,7 @@ async def unblock_team( raise Exception("No DB Connected.") record = await prisma_client.db.litellm_teamtable.update( - where={"team_id": data.team_id}, data={"blocked": False} + where={"team_id": data.team_id}, data={"blocked": False} # type: ignore ) return record @@ -6783,7 +6778,6 @@ async def async_queue_request( request: Request, model: Optional[str] = None, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), - background_tasks: BackgroundTasks = BackgroundTasks(), ): global general_settings, user_debug, proxy_logging_obj """ From d1fa22f9ed11025c14de7fb8ec7c75bd8c87270a Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 27 Mar 2024 19:00:52 -0700 Subject: [PATCH 2/5] (fix) ci/cd google deps --- .circleci/config.yml | 8 ++++---- .circleci/requirements.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8084f1df..38b65099d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,8 +28,8 @@ jobs: pip install "pytest==7.3.1" pip install "pytest-asyncio==0.21.1" pip install mypy - pip install "google-generativeai>=0.3.2" - pip install "google-cloud-aiplatform>=1.38.0" + pip install "google-generativeai==0.3.2" + pip install "google-cloud-aiplatform==1.43.0" pip install "boto3>=1.28.57" pip install "aioboto3>=12.3.0" pip install langchain @@ -152,8 +152,8 @@ jobs: pip install "pytest-mock==3.12.0" pip install "pytest-asyncio==0.21.1" pip install mypy - pip install "google-generativeai>=0.3.2" - pip install "google-cloud-aiplatform>=1.38.0" + pip install "google-generativeai==0.3.2" + pip install "google-cloud-aiplatform==1.43.0" pip install "boto3>=1.28.57" pip install "aioboto3>=12.3.0" pip install langchain diff --git a/.circleci/requirements.txt b/.circleci/requirements.txt index 4730fc28b..e9a59b7aa 100644 --- a/.circleci/requirements.txt +++ b/.circleci/requirements.txt @@ -10,5 +10,5 @@ anthropic boto3 orjson pydantic -google-cloud-aiplatform +google-cloud-aiplatform==1.43.0 redisvl==0.0.7 # semantic caching \ No newline at end of file From 73db5b45f82a1b8b929793024ec887a2c5d8120e Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 27 Mar 2024 19:04:07 -0700 Subject: [PATCH 3/5] (ci/cd) run again --- litellm/tests/test_completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 6d579acc0..30cca38e2 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -74,7 +74,7 @@ def test_completion_claude(): print(response.usage) print(response.usage.completion_tokens) print(response["usage"]["completion_tokens"]) - # print("new cost tracking") + # print("new costtracking") except Exception as e: if "overloaded_error" in str(e): pass From 0c69c05c54ad70129c9fbabe81272bc7ba2a7db0 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 27 Mar 2024 19:14:25 -0700 Subject: [PATCH 4/5] (fix) google pip install pyarrow dep --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38b65099d..991ac28f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,7 @@ jobs: pip install mypy 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 langchain @@ -154,6 +155,7 @@ jobs: pip install mypy 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 langchain From 31383b18cbb9990d3200ce58815ced7f24a6ac65 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 27 Mar 2024 19:18:39 -0700 Subject: [PATCH 5/5] (fix) cost tracking --- litellm/tests/test_completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 30cca38e2..6d579acc0 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -74,7 +74,7 @@ def test_completion_claude(): print(response.usage) print(response.usage.completion_tokens) print(response["usage"]["completion_tokens"]) - # print("new costtracking") + # print("new cost tracking") except Exception as e: if "overloaded_error" in str(e): pass