API: Add an /v1/internal/health endpoint

This commit is contained in:
oobabooga 2025-04-26 15:42:27 -07:00
parent bc55feaf3e
commit 35717a088c

View file

@ -250,6 +250,11 @@ async def handle_moderations(request: Request):
return JSONResponse(response)
@app.get("/v1/internal/health", dependencies=check_key)
async def handle_health_check():
return JSONResponse(content={"status": "ok"})
@app.post("/v1/internal/encode", response_model=EncodeResponse, dependencies=check_key)
async def handle_token_encode(request_data: EncodeRequest):
response = token_encode(request_data.text)