[object Object]

← back to Exo

healthcheck

fd867256e0c1f450964b200a8e7a439b47e21771 · 2024-11-14 11:09:18 +0400 · Alex Cheema

Files touched

Diff

commit fd867256e0c1f450964b200a8e7a439b47e21771
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Thu Nov 14 11:09:18 2024 +0400

    healthcheck
---
 exo/api/chatgpt_api.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/exo/api/chatgpt_api.py b/exo/api/chatgpt_api.py
index 3d5127d5..26951d73 100644
--- a/exo/api/chatgpt_api.py
+++ b/exo/api/chatgpt_api.py
@@ -173,6 +173,7 @@ class ChatGPTAPI:
     cors.add(self.app.router.add_post("/v1/chat/completions", self.handle_post_chat_completions), {"*": cors_options})
     cors.add(self.app.router.add_get("/v1/download/progress", self.handle_get_download_progress), {"*": cors_options})
     cors.add(self.app.router.add_get("/modelpool", self.handle_model_support), {"*": cors_options})
+    cors.add(self.app.router.add_get("/healthcheck", self.handle_healthcheck), {"*": cors_options})
 
     self.static_dir = Path(__file__).parent.parent/"tinychat"
     self.app.router.add_get("/", self.handle_root)
@@ -200,6 +201,9 @@ class ChatGPTAPI:
   async def handle_root(self, request):
     return web.FileResponse(self.static_dir/"index.html")
 
+  async def handle_healthcheck(self, request):
+    return web.json_response({"status": "ok"})
+
   async def handle_model_support(self, request):
     return web.json_response({
       "model pool": {

← cbeb1b33 fix safari issue  ·  back to Exo  ·  qwen-2.5-0.5b f1eec9fa →