From 50cc4a85950aedee2d622c388de914286ed8db1d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 Nov 2023 19:59:49 -0800 Subject: [PATCH] fix(proxy_server.py): have /health and /routes be router endpoints --- litellm/proxy/proxy_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index cc3b72c8e..420e93db3 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -902,7 +902,7 @@ async def retrieve_server_log(request: Request): async def test_endpoint(request: Request): return {"route": request.url.path} -@app.get("/health", description="Check the health of all the endpoints in config.yaml", tags=["health"]) +@router.get("/health", description="Check the health of all the endpoints in config.yaml", tags=["health"]) async def health_endpoint(request: Request, model: Optional[str] = fastapi.Query(None, description="Specify the model name (optional)")): global llm_model_list healthy_endpoints = [] @@ -946,7 +946,7 @@ async def health_endpoint(request: Request, model: Optional[str] = fastapi.Query async def home(request: Request): return "LiteLLM: RUNNING" -@app.get("/routes") +@router.get("/routes") async def get_routes(): """ Get a list of available routes in the FastAPI application.