File size: 703 Bytes
c40c75a
7d17b48
 
c40c75a
7d17b48
 
 
 
 
 
 
 
c40c75a
7d17b48
 
 
 
c40c75a
 
7d17b48
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from fastapi import FastAPI
from litellm.proxy.proxy_server import ProxyServer
from litellm.proxy.config import ProxyConfig

app = FastAPI(
    title="LiteLLM Proxy",
    description="LiteLLM OpenAI-compatible proxy",
    version="1.0",
    docs_url="/proxy/docs",         # Swagger UI
    redoc_url="/proxy/redoc",       # Optional: ReDoc UI
    openapi_url="/proxy/openapi.json"
)

# Load LiteLLM Proxy
proxy_config = ProxyConfig()
proxy_server = ProxyServer(config=proxy_config)
proxy_server.add_routes(app)

@app.get("/")
async def root():
    return {"message": "LiteLLM is running. Visit /proxy/docs"}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=7860)