From f2d5beee0885b756d202acfb9b1ad57ee3694f91 Mon Sep 17 00:00:00 2001 From: Alex Cheema Date: Sat, 16 Nov 2024 10:58:55 +0400 Subject: [PATCH] change chatgpt api port from 8000 to 52415 --- README.md | 10 +++++----- examples/astra/astra/ContentView.swift | 2 +- examples/chatgpt_api.sh | 2 +- exo/api/chatgpt_api.py | 2 +- exo/main.py | 2 +- extra/start_openwebui.sh | 2 +- test/reconnect.sh | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 392ef297..550b81a6 100644 --- a/README.md +++ b/README.md @@ -121,14 +121,14 @@ exo That's it! No configuration required - exo will automatically discover the other device(s). -exo starts a ChatGPT-like WebUI (powered by [tinygrad tinychat](https://github.com/tinygrad/tinygrad/tree/master/examples/tinychat)) on http://localhost:8000 +exo starts a ChatGPT-like WebUI (powered by [tinygrad tinychat](https://github.com/tinygrad/tinygrad/tree/master/examples/tinychat)) on http://localhost:52415 -For developers, exo also starts a ChatGPT-compatible API endpoint on http://localhost:8000/v1/chat/completions. Examples with curl: +For developers, exo also starts a ChatGPT-compatible API endpoint on http://localhost:52415/v1/chat/completions. Examples with curl: #### Llama 3.2 3B: ```sh -curl http://localhost:8000/v1/chat/completions \ +curl http://localhost:52415/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "llama-3.2-3b", @@ -140,7 +140,7 @@ curl http://localhost:8000/v1/chat/completions \ #### Llama 3.1 405B: ```sh -curl http://localhost:8000/v1/chat/completions \ +curl http://localhost:52415/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "llama-3.1-405b", @@ -152,7 +152,7 @@ curl http://localhost:8000/v1/chat/completions \ #### Llava 1.5 7B (Vision Language Model): ```sh -curl http://localhost:8000/v1/chat/completions \ +curl http://localhost:52415/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "llava-1.5-7b-hf", diff --git a/examples/astra/astra/ContentView.swift b/examples/astra/astra/ContentView.swift index 3ae6f1ce..52327fc2 100644 --- a/examples/astra/astra/ContentView.swift +++ b/examples/astra/astra/ContentView.swift @@ -148,7 +148,7 @@ struct ContentView: View { @State private var voiceActivityThreshold: Float = 0.40 @State private var silenceTimeThreshold = 1.0 @State private var debugText = "" - @State private var apiEndpoint = "http://192.168.212.74:8000/v1/chat/completions" + @State private var apiEndpoint = "http://192.168.212.74:52415/v1/chat/completions" @State private var audioBuffer: [Float] = [] @State private var bufferDuration: Double = 0.5 // 0.5 seconds buffer @State private var isInitialTranscription = true diff --git a/examples/chatgpt_api.sh b/examples/chatgpt_api.sh index 2fc0e2be..44401836 100755 --- a/examples/chatgpt_api.sh +++ b/examples/chatgpt_api.sh @@ -3,7 +3,7 @@ # This works the same in a single-node set up and in a multi-node setup. # You need to start exo before running this by running `python3 main.py`. -API_ENDPOINT="http://${API_ENDPOINT:-$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -n 1):8000}" +API_ENDPOINT="http://${API_ENDPOINT:-$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -n 1):52415}" MODEL="llama-3.1-8b" PROMPT="What is the meaning of exo?" TEMPERATURE=0.7 diff --git a/exo/api/chatgpt_api.py b/exo/api/chatgpt_api.py index 26951d73..7c22a38c 100644 --- a/exo/api/chatgpt_api.py +++ b/exo/api/chatgpt_api.py @@ -372,7 +372,7 @@ class ChatGPTAPI: deregistered_callback = self.node.on_token.deregister(callback_id) if DEBUG >= 2: print(f"Deregister {callback_id=} {deregistered_callback=}") - async def run(self, host: str = "0.0.0.0", port: int = 8000): + async def run(self, host: str = "0.0.0.0", port: int = 52415): runner = web.AppRunner(self.app) await runner.setup() site = web.TCPSite(runner, host, port) diff --git a/exo/main.py b/exo/main.py index 6a70e3f2..d24f9db3 100644 --- a/exo/main.py +++ b/exo/main.py @@ -42,7 +42,7 @@ parser.add_argument("--discovery-module", type=str, choices=["udp", "tailscale", parser.add_argument("--discovery-timeout", type=int, default=30, help="Discovery timeout in seconds") parser.add_argument("--discovery-config-path", type=str, default=None, help="Path to discovery config json file") parser.add_argument("--wait-for-peers", type=int, default=0, help="Number of peers to wait to connect to before starting") -parser.add_argument("--chatgpt-api-port", type=int, default=8000, help="ChatGPT API port") +parser.add_argument("--chatgpt-api-port", type=int, default=52415, help="ChatGPT API port") parser.add_argument("--chatgpt-api-response-timeout", type=int, default=90, help="ChatGPT API response timeout in seconds") parser.add_argument("--max-generate-tokens", type=int, default=10000, help="Max tokens to generate in each request") parser.add_argument("--inference-engine", type=str, default=None, help="Inference engine to use (mlx, tinygrad, or dummy)") diff --git a/extra/start_openwebui.sh b/extra/start_openwebui.sh index a5f3ca4d..2cf3d66a 100755 --- a/extra/start_openwebui.sh +++ b/extra/start_openwebui.sh @@ -1,3 +1,3 @@ -API_ENDPOINT="http://${API_ENDPOINT:-$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -n 1):8000}" +API_ENDPOINT="http://${API_ENDPOINT:-$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -n 1):52415}" echo "Using API_ENDPOINT=${API_ENDPOINT}" docker run -d -p 3000:8080 -e OPENAI_API_BASE_URL="${API_ENDPOINT}" -e OPENAI_API_KEY=your_secret_key -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main diff --git a/test/reconnect.sh b/test/reconnect.sh index 537f9ac3..7921d4e7 100755 --- a/test/reconnect.sh +++ b/test/reconnect.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Starting node 1" -DEBUG_DISCOVERY=7 DEBUG=7 python3 main.py --node-id "node1" --listen-port 5678 --broadcast-port 5679 --chatgpt-api-port 8000 --chatgpt-api-response-timeout 900 > output1.log 2>&1 & +DEBUG_DISCOVERY=7 DEBUG=7 python3 main.py --node-id "node1" --listen-port 5678 --broadcast-port 5679 --chatgpt-api-port 52415 --chatgpt-api-response-timeout 900 > output1.log 2>&1 & PID1=$! echo "Started node 1 PID: $PID1" echo "Starting node 2"