[object Object]

← back to Exo

add all chat endpoints without v1 prefix to support ollama / openwebui. related: #175

394935711b3c49ab3467301188ab560b09bedd79 · 2024-08-26 16:59:07 +0100 · Alex Cheema

Files touched

Diff

commit 394935711b3c49ab3467301188ab560b09bedd79
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Mon Aug 26 16:59:07 2024 +0100

    add all chat endpoints without v1 prefix to support ollama / openwebui. related: #175
---
 exo/api/chatgpt_api.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/exo/api/chatgpt_api.py b/exo/api/chatgpt_api.py
index cb001f9b..b34589d2 100644
--- a/exo/api/chatgpt_api.py
+++ b/exo/api/chatgpt_api.py
@@ -169,8 +169,11 @@ class ChatGPTAPI:
       allow_headers="*",
       allow_methods="*",
     )
+    cors.add(self.app.router.add_get("/models", self.handle_get_models), {"*": cors_options})
     cors.add(self.app.router.add_get("/v1/models", self.handle_get_models), {"*": cors_options})
+    cors.add(self.app.router.add_post("/chat/token/encode", self.handle_post_chat_token_encode), {"*": cors_options})
     cors.add(self.app.router.add_post("/v1/chat/token/encode", self.handle_post_chat_token_encode), {"*": cors_options})
+    cors.add(self.app.router.add_post("/chat/completions", self.handle_post_chat_completions), {"*": cors_options})
     cors.add(self.app.router.add_post("/v1/chat/completions", self.handle_post_chat_completions), {"*": cors_options})
 
     self.static_dir = Path(__file__).parent.parent.parent/"tinychat/examples/tinychat"

← 70172d7c add /v1/models endpoint and change Content-Type of stremed r  ·  back to Exo  ·  script ot start openwebui ebff636a →