Shyamnath commited on
Commit
f075c85
·
1 Parent(s): 7d17b48

Simplify app.py to use proxy_app directly

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -1,24 +1,13 @@
1
  from fastapi import FastAPI
2
- from litellm.proxy.proxy_server import ProxyServer
3
- from litellm.proxy.config import ProxyConfig
4
 
5
  app = FastAPI(
6
- title="LiteLLM Proxy",
7
- description="LiteLLM OpenAI-compatible proxy",
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
- # Load LiteLLM Proxy
15
- proxy_config = ProxyConfig()
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