Add /v1/internal/model-info endpoint

This commit is contained in:
oobabooga 2023-11-07 18:59:02 -08:00
parent 6e2e0317af
commit f6ca9cfcdc
3 changed files with 19 additions and 0 deletions

View file

@ -27,6 +27,7 @@ from .typing import (
ChatCompletionResponse,
CompletionRequest,
CompletionResponse,
ModelInfoResponse,
to_dict
)
@ -234,6 +235,12 @@ async def handle_stop_generation(request: Request):
return JSONResponse(content="OK")
@app.get("/v1/internal/model-info", response_model=ModelInfoResponse)
async def handle_model_info():
payload = OAImodels.get_current_model_info()
return JSONResponse(content=payload)
def run_server():
server_addr = '0.0.0.0' if shared.args.listen else '127.0.0.1'
port = int(os.environ.get('OPENEDAI_PORT', shared.args.api_port))