change chatgpt api port from 8000 to 52415

This commit is contained in:
Alex Cheema
2024-11-16 10:58:55 +04:00
parent f1eec9fa64
commit f2d5beee08
7 changed files with 11 additions and 11 deletions

View File

@@ -121,14 +121,14 @@ exo
That's it! No configuration required - exo will automatically discover the other device(s). 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: #### Llama 3.2 3B:
```sh ```sh
curl http://localhost:8000/v1/chat/completions \ curl http://localhost:52415/v1/chat/completions \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"model": "llama-3.2-3b", "model": "llama-3.2-3b",
@@ -140,7 +140,7 @@ curl http://localhost:8000/v1/chat/completions \
#### Llama 3.1 405B: #### Llama 3.1 405B:
```sh ```sh
curl http://localhost:8000/v1/chat/completions \ curl http://localhost:52415/v1/chat/completions \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"model": "llama-3.1-405b", "model": "llama-3.1-405b",
@@ -152,7 +152,7 @@ curl http://localhost:8000/v1/chat/completions \
#### Llava 1.5 7B (Vision Language Model): #### Llava 1.5 7B (Vision Language Model):
```sh ```sh
curl http://localhost:8000/v1/chat/completions \ curl http://localhost:52415/v1/chat/completions \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"model": "llava-1.5-7b-hf", "model": "llava-1.5-7b-hf",

View File

@@ -148,7 +148,7 @@ struct ContentView: View {
@State private var voiceActivityThreshold: Float = 0.40 @State private var voiceActivityThreshold: Float = 0.40
@State private var silenceTimeThreshold = 1.0 @State private var silenceTimeThreshold = 1.0
@State private var debugText = "" @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 audioBuffer: [Float] = []
@State private var bufferDuration: Double = 0.5 // 0.5 seconds buffer @State private var bufferDuration: Double = 0.5 // 0.5 seconds buffer
@State private var isInitialTranscription = true @State private var isInitialTranscription = true

View File

@@ -3,7 +3,7 @@
# This works the same in a single-node set up and in a multi-node setup. # 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`. # 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" MODEL="llama-3.1-8b"
PROMPT="What is the meaning of exo?" PROMPT="What is the meaning of exo?"
TEMPERATURE=0.7 TEMPERATURE=0.7

View File

@@ -372,7 +372,7 @@ class ChatGPTAPI:
deregistered_callback = self.node.on_token.deregister(callback_id) deregistered_callback = self.node.on_token.deregister(callback_id)
if DEBUG >= 2: print(f"Deregister {callback_id=} {deregistered_callback=}") 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) runner = web.AppRunner(self.app)
await runner.setup() await runner.setup()
site = web.TCPSite(runner, host, port) site = web.TCPSite(runner, host, port)

View File

@@ -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-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("--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("--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("--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("--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)") parser.add_argument("--inference-engine", type=str, default=None, help="Inference engine to use (mlx, tinygrad, or dummy)")

View File

@@ -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}" 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 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

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
echo "Starting node 1" 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=$! PID1=$!
echo "Started node 1 PID: $PID1" echo "Started node 1 PID: $PID1"
echo "Starting node 2" echo "Starting node 2"