Merge pull request #590 from metaspartan/fix-models-api

Fix the /v1/models API to output proper OpenAI compatible endpoint
This commit is contained in:
Alex Cheema
2025-01-07 02:32:06 +00:00
committed by GitHub

View File

@@ -291,7 +291,8 @@ class ChatGPTAPI:
)
async def handle_get_models(self, request):
return web.json_response([{"id": model_name, "object": "model", "owned_by": "exo", "ready": True} for model_name, _ in model_cards.items()])
models_list = [{"id": model_name, "object": "model", "owned_by": "exo", "ready": True} for model_name, _ in model_cards.items()]
return web.json_response({"object": "list", "data": models_list})
async def handle_post_chat_token_encode(self, request):
data = await request.json()