Skip to content

Commit

Permalink
Merge pull request #590 from metaspartan/fix-models-api
Browse files Browse the repository at this point in the history
Fix the /v1/models API to output proper OpenAI compatible endpoint
  • Loading branch information
AlexCheema authored Jan 7, 2025
2 parents d9a836f + 627bfca commit 3c9efe1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exo/api/chatgpt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ async def process_model(model_name, pretty):
)

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()
Expand Down

0 comments on commit 3c9efe1

Please sign in to comment.