Repository navigation
test(ci): fix six CircleCI test regressions on main #44429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2a6a671
test(ci): fix four CircleCI regressions on main
mateo-berri 1255582
test(ci): stop reloading auth_checks in unit tests
mateo-berri 334e52e
Merge remote-tracking branch 'origin/main' into litellm_circleci_heal…
mateo-berri a3bc661
test(constants): cover CLI JWT expiry env parsing
mateo-berri 33f74e6
test(gateway): restore proxy lifespan after importing gateway.main in…
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import json | ||
| import re | ||
| import threading | ||
|
|
||
2 changes: 2 additions & 0 deletions
2
tests/integration/providers/test_bedrock_runtime_chat_completions_chaos.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import asyncio | ||
| import base64 | ||
| import binascii | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,45 @@ | ||
| import os | ||
| from typing import Final | ||
|
|
||
| import uvicorn | ||
| from dotenv import load_dotenv | ||
| from fastapi import FastAPI, Request | ||
| from fastapi import FastAPI | ||
| from fastapi.middleware.cors import CORSMiddleware | ||
| from fastapi.responses import JSONResponse | ||
|
|
||
| load_dotenv() | ||
|
|
||
| # Set the SERVER_ROOT_PATH environment variable to match the custom mount path | ||
| os.environ["SERVER_ROOT_PATH"] = "/my-custom-path" | ||
| def build_app() -> FastAPI: | ||
| load_dotenv() | ||
| os.environ["SERVER_ROOT_PATH"] = "/my-custom-path" | ||
|
|
||
| from litellm.proxy.proxy_server import app as litellm_app | ||
| from litellm.proxy.proxy_server import proxy_startup_event | ||
| from litellm.proxy.proxy_server import app as litellm_app | ||
| from litellm.proxy.proxy_server import proxy_startup_event | ||
|
|
||
| # Create main FastAPI app | ||
| app = FastAPI(title="Custom LiteLLM Server", lifespan=proxy_startup_event) | ||
| app: Final = FastAPI(title="Custom LiteLLM Server", lifespan=proxy_startup_event) | ||
| custom_path: Final = "/my-custom-path" | ||
|
|
||
| # Add CORS middleware | ||
| app.add_middleware( | ||
| CORSMiddleware, | ||
| allow_origins=["*"], | ||
| allow_credentials=True, | ||
| allow_methods=["*"], | ||
| allow_headers=["*"], | ||
| ) | ||
| app.add_middleware( | ||
| CORSMiddleware, | ||
| allow_origins=["*"], | ||
| allow_credentials=True, | ||
| allow_methods=["*"], | ||
| allow_headers=["*"], | ||
| ) | ||
|
|
||
| custom_path = "/my-custom-path" | ||
| app.mount(custom_path, litellm_app) | ||
|
|
||
| # Mount LiteLLM app at /litellm | ||
| app.mount(custom_path, litellm_app) | ||
| @app.get("/") | ||
| async def root() -> dict[str, str]: | ||
| return { | ||
| "message": "Welcome to the API Gateway", | ||
| "litellm_endpoint": custom_path, | ||
| } | ||
|
|
||
| @app.get("/health") | ||
| async def health_check() -> dict[str, str]: | ||
| return {"status": "healthy"} | ||
|
|
||
| # Default route at / | ||
| @app.get("/") | ||
| async def root(): | ||
| return { | ||
| "message": "Welcome to the API Gateway", | ||
| "litellm_endpoint": f"{custom_path}", | ||
| } | ||
|
|
||
|
|
||
| # Health check endpoint | ||
| @app.get("/health") | ||
| async def health_check(): | ||
| return {"status": "healthy"} | ||
| return app | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| # Run the server on port 8000 | ||
| uvicorn.run(app, host="0.0.0.0", port=4000, log_level="info") | ||
| uvicorn.run(build_app(), host="0.0.0.0", port=4000, log_level="info") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.