mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-02 20:22:10 +00:00
* fix: initial commit of v2 parallel request limiter hook enables multi-instance rate limiting to work * fix: subsequent commit with additional refactors * fix(parallel_request_limiter_v2.py): cleanup initial call hook simplify it * fix(parallel_request_limiter_v2.py): working v2 parallel request limiter * fix: more updates - still not passing testing * fix(test_parallel_request_limiter_v2.py): update test + add conftest * fix: fix ruff checks * fix(parallel_request_limiter_v2.py): use pull via pattern method to load in keys instance wouldn't have seen yet Fixes issue where redis syncing was not pulling key until instance had seen it * test: update testing to cover tpm and rpm * fix(parallel_request_limiter_v2.py): fix ruff errors * fix(proxy/hooks/__init__.py): feature flag export * fix(proxy/hooks/__init_.py): fix linting error * ci(config.yml): add tests/enterprise to ci/cd * fix: fix ruff check * test: update testing
28 lines
773 B
Python
28 lines
773 B
Python
# this is an example endpoint to receive data from litellm
|
|
from fastapi import FastAPI, HTTPException, Request
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/log-event")
|
|
async def log_event(request: Request):
|
|
try:
|
|
print("Received /log-event request") # noqa
|
|
# Assuming the incoming request has JSON data
|
|
data = await request.json()
|
|
print("Received request data:") # noqa
|
|
print(data) # noqa
|
|
|
|
# Your additional logic can go here
|
|
# For now, just printing the received data
|
|
|
|
return {"message": "Request received successfully"}
|
|
except Exception:
|
|
raise HTTPException(status_code=500, detail="Internal Server Error")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
|
|
uvicorn.run(app, host="127.0.0.1", port=8000)
|