Spaces:
Paused
Paused
Simplify app.py to use proxy_app directly
Browse files
app.py
CHANGED
|
@@ -1,24 +1,13 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
from litellm.proxy.proxy_server import
|
| 3 |
-
from litellm.proxy.config import ProxyConfig
|
| 4 |
|
| 5 |
app = FastAPI(
|
| 6 |
-
title="LiteLLM
|
| 7 |
-
|
| 8 |
-
version="1.0",
|
| 9 |
-
docs_url="/proxy/docs", # Swagger UI
|
| 10 |
-
redoc_url="/proxy/redoc", # Optional: ReDoc UI
|
| 11 |
-
openapi_url="/proxy/openapi.json"
|
| 12 |
)
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
proxy_server = ProxyServer(config=proxy_config)
|
| 17 |
-
proxy_server.add_routes(app)
|
| 18 |
-
|
| 19 |
-
@app.get("/")
|
| 20 |
-
async def root():
|
| 21 |
-
return {"message": "LiteLLM is running. Visit /proxy/docs"}
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|
| 24 |
import uvicorn
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from litellm.proxy.proxy_server import app as proxy_app
|
|
|
|
| 3 |
|
| 4 |
app = FastAPI(
|
| 5 |
+
title="LiteLLM API",
|
| 6 |
+
version="1.0.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
+
# Use proxy app directly
|
| 10 |
+
app = proxy_app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
if __name__ == "__main__":
|
| 13 |
import uvicorn
|