From 5f7d99071c94a348bdfde9a10246c901b585091d Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Sat, 17 Feb 2024 18:42:12 -0800 Subject: [PATCH 1/7] configuring cursor to ignore archive and other random files --- 01OS/.cursorignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 01OS/.cursorignore diff --git a/01OS/.cursorignore b/01OS/.cursorignore new file mode 100644 index 0000000..b494a46 --- /dev/null +++ b/01OS/.cursorignore @@ -0,0 +1,4 @@ +_archive +__pycache__ +.idea + From 21dc07026ad88e608aa8c779331b071ff1c4df30 Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Sat, 17 Feb 2024 21:23:36 -0800 Subject: [PATCH 2/7] Switching tunneling functionality from ngrok to localhost.run --- 01OS/.env.example | 13 +++++-------- 01OS/01OS/clients/base_device.py | 4 ++-- 01OS/01OS/server/server.py | 31 ++++++------------------------- 01OS/poetry.lock | 21 +-------------------- 01OS/pyproject.toml | 1 - 01OS/start.sh | 22 ++++++++++++++++++++-- 01OS/tunnel.sh | 8 ++++++++ 7 files changed, 42 insertions(+), 58 deletions(-) create mode 100755 01OS/tunnel.sh diff --git a/01OS/.env.example b/01OS/.env.example index d1749bd..dd48b0d 100644 --- a/01OS/.env.example +++ b/01OS/.env.example @@ -16,16 +16,16 @@ TEACH_MODE=False PIPER_VOICE_URL="https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/medium/" PIPER_VOICE_NAME="en_US-lessac-medium.onnx" -# Expose through Ngrok -# Uncomment following line with your Ngrok auth token (https://dashboard.ngrok.com/get-started/your-authtoken) -#NGROK_AUTHTOKEN="AUTH TOKEN" - # If SERVER_START, this is where we'll serve the server. # If CLIENT_START, this is where the client expects the server to be. -SERVER_URL=ws://localhost:8000/ +# SERVER_CONNECTION_URL=wss://localhost:8000/ +SERVER_CONNECTION_URL=wss://localhost:8000/ SERVER_START=True CLIENT_START=True +# The port to start the local server on +SERVER_LOCAL_PORT=8000 + # Explicitly set the client type (macos, rpi) CLIENT_TYPE=auto @@ -34,9 +34,6 @@ CODE_RUNNER=server TTS_RUNNER=server # If client, audio will be sent over websocket. STT_RUNNER=client # If server, audio will be sent over websocket. -# Will expose the server publically and display that URL. -SERVER_EXPOSE_PUBLICALLY=False - # Image capture settings CAMERA_ENABLED=True diff --git a/01OS/01OS/clients/base_device.py b/01OS/01OS/clients/base_device.py index 7e6945b..debdea0 100644 --- a/01OS/01OS/clients/base_device.py +++ b/01OS/01OS/clients/base_device.py @@ -291,9 +291,9 @@ class Device: async def start_async(self): # Configuration for WebSocket - WS_URL = os.getenv('SERVER_URL') + WS_URL = os.getenv('SERVER_CONNECTION_URL') if not WS_URL: - raise ValueError("The environment variable SERVER_URL is not set. Please set it to proceed.") + raise ValueError("The environment variable SERVER_CONNECTION_URL is not set. Please set it to proceed.") # Start the WebSocket communication asyncio.create_task(self.websocket_communication(WS_URL)) diff --git a/01OS/01OS/server/server.py b/01OS/01OS/server/server.py index 553ee27..24d88f0 100644 --- a/01OS/01OS/server/server.py +++ b/01OS/01OS/server/server.py @@ -18,7 +18,6 @@ import urllib.parse from .utils.kernel import put_kernel_messages_into_queue from .i import configure_interpreter from interpreter import interpreter -import ngrok from ..utils.accumulator import Accumulator from .teach import teach from .utils.logs import setup_logging @@ -31,6 +30,9 @@ app = FastAPI() conversation_history_path = Path(__file__).parent / 'conversations' / 'user.json' +SERVER_LOCAL_PORT = int(os.getenv('SERVER_LOCAL_PORT', 8000)) + + # This is so we only say() full sentences def is_full_sentence(text): return text.endswith(('.', '!', '?')) @@ -269,18 +271,6 @@ async def listener(): async def stream_tts_to_device(sentence): for chunk in stream_tts(sentence): await to_device.put(chunk) - -async def setup_ngrok(ngrok_auth_token, parsed_url): - # Set up Ngrok - logger.info("Setting up Ngrok") - ngrok_listener = await ngrok.forward(f"{parsed_url.hostname}:{parsed_url.port}", authtoken=ngrok_auth_token) - ngrok_parsed_url = urllib.parse.urlparse(ngrok_listener.url()) - - # Setup SERVER_URL environment variable for device to use - connection_url = f"wss://{ngrok_parsed_url.hostname}/" - logger.info(f"Ngrok established at {ngrok_parsed_url.geturl()}") - logger.info(f"\033[1mSERVER_CONNECTION_URL should be set to \"{connection_url}\"\033[0m") - from uvicorn import Config, Server @@ -297,20 +287,11 @@ if __name__ == "__main__": # Start watching the kernel if it's your job to do that if os.getenv('CODE_RUNNER') == "server": asyncio.create_task(put_kernel_messages_into_queue(from_computer)) - - server_url = os.getenv('SERVER_URL') - if not server_url: - raise ValueError("The environment variable SERVER_URL is not set. Please set it to proceed.") - parsed_url = urllib.parse.urlparse(server_url) - - # Set up Ngrok - ngrok_auth_token = os.getenv('NGROK_AUTHTOKEN') - if ngrok_auth_token is not None: - await setup_ngrok(ngrok_auth_token, parsed_url) - logger.info("Starting `server.py`...") + # Start the server + logger.info("Starting `server.py`... on wss://localhost:" + str(SERVER_LOCAL_PORT)) - config = Config(app, host=parsed_url.hostname, port=parsed_url.port, lifespan='on') + config = Config(app, host="localhost", port=SERVER_LOCAL_PORT, lifespan='on') server = Server(config) await server.serve() diff --git a/01OS/poetry.lock b/01OS/poetry.lock index 66ee052..75964e9 100644 --- a/01OS/poetry.lock +++ b/01OS/poetry.lock @@ -1766,25 +1766,6 @@ files = [ {file = "nest_asyncio-1.6.0.tar.gz", hash = "sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe"}, ] -[[package]] -name = "ngrok" -version = "1.0.0" -description = "The ngrok Agent SDK for Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "ngrok-1.0.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:0c01e3ae6d37b7faa6a23968a6caf12c50b5d1d2ffda2932fa904de4a418a50f"}, - {file = "ngrok-1.0.0-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:5a46dc024b23da2f3a424e3d877d3e8bb44937aa4304f3ebfb681644fb785575"}, - {file = "ngrok-1.0.0-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:c650c2c5c9adc81be824479a9dfdedefb21f3e9b2d9ca454728a0c76e47a7f63"}, - {file = "ngrok-1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d2a2176547919d2431023b9e2abed873db2d0a7f2a116585438a2ba33778455"}, - {file = "ngrok-1.0.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0a61acdbc378b82992e75abb9787437379a430c3ff44c38fb7c3dc498920ef86"}, - {file = "ngrok-1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aed49b00dc75ec8c6ca9ff0c88bad450df33c8d8972650848e5a3fd648b091a0"}, - {file = "ngrok-1.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b3cdcf75435c0f23695161c5892580a7b0e64d6d26ccdc9764878bfebfc93b7b"}, - {file = "ngrok-1.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:45d2652872fd33c6388dfe5fe02ca4eb70d2fef2199c25d476e90b818f725c45"}, - {file = "ngrok-1.0.0-cp37-abi3-win32.whl", hash = "sha256:92b253ec235321abc7d6d5fae08fbda3b854099ccc02c748402b517c53a4b39a"}, - {file = "ngrok-1.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:8a256b16be77bba45543e60dd1b4515a11fd1f43cde2a221ba0b360a51bfa980"}, -] - [[package]] name = "numpy" version = "1.26.4" @@ -3539,4 +3520,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "5c8d587b405e97c0dca454078950157106f9aea687cbecce5b7ae7effd2aeece" +content-hash = "f69adbb8a50c2b9efa5162a5c289ff3e887ce58c656338eb5ca52274c7d3b5a4" diff --git a/01OS/pyproject.toml b/01OS/pyproject.toml index 5f4d26c..dbb40fa 100644 --- a/01OS/pyproject.toml +++ b/01OS/pyproject.toml @@ -22,7 +22,6 @@ python-dotenv = "^1.0.1" ffmpeg-python = "^0.2.0" textual = "^0.50.1" pydub = "^0.25.1" -ngrok = "^1.0.0" open-interpreter = "^0.2.0" simpleaudio = "^1.0.4" opencv-python = "^4.9.0.80" diff --git a/01OS/start.sh b/01OS/start.sh index edbb9f7..de886e9 100755 --- a/01OS/start.sh +++ b/01OS/start.sh @@ -56,8 +56,7 @@ fi # Check if "--expose" is passed as an argument if [[ "$@" == *"--expose"* ]]; then - # If "--expose" is passed, set SERVER_EXPOSE_PUBLICALLY to True - export SERVER_EXPOSE_PUBLICALLY="True" + export TUNNEL_START="True" fi # Check if "--clear-local" is passed as an argument @@ -173,6 +172,14 @@ start_server() { echo "Server started as process $SERVER_PID" } +# Function to start tunnel service +start_tunnel() { + echo "Starting tunnel..." + ./tunnel.sh & + TUNNEL_PID=$! + echo "Tunnel started as process $TUNNEL_PID" +} + stop_processes() { if [[ -n $CLIENT_PID ]]; then echo "Stopping client..." @@ -182,6 +189,10 @@ stop_processes() { echo "Stopping server..." kill $SERVER_PID fi + if [[ -n $TUNNEL_PID ]]; then + echo "Stopping tunnel..." + kill $TUNNEL_PID + fi } # Trap SIGINT and SIGTERM to stop processes when the script is terminated @@ -199,9 +210,16 @@ if [[ "$CLIENT_START" == "True" ]]; then start_client fi +# TUNNEL +# Start tunnel if TUNNEL_START is True +if [[ "$TUNNEL_START" == "True" ]]; then + start_tunnel +fi + # Wait for client and server processes to exit wait $CLIENT_PID wait $SERVER_PID +wait $TUNNEL_PID # TTS, STT diff --git a/01OS/tunnel.sh b/01OS/tunnel.sh new file mode 100755 index 0000000..0f50c0d --- /dev/null +++ b/01OS/tunnel.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +echo "Starting up localhost.run tunnel..." +ssh -o StrictHostKeyChecking=no -R 80:localhost:8000 nokey@localhost.run 2>&1 | while IFS= read -r line; do + if [[ "$line" =~ https://([a-zA-Z0-9]+\.lhr\.life) ]]; then + echo "Your free localhost.run tunnel is now active. Please set your client SERVER_CONNECTION_URL env var to: \"wss://${BASH_REMATCH[1]}\"" + fi +done From a0cc46cfc00e11fdf7635f20fee3cf9989e42281 Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Sat, 17 Feb 2024 22:27:58 -0800 Subject: [PATCH 3/7] Adding localtunnel support --- 01OS/.env.example | 4 ++-- 01OS/01OS/server/server.py | 2 +- 01OS/README.md | 5 +++++ 01OS/start.sh | 7 ++++++- 01OS/tunnel.sh | 14 ++++++++++---- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/01OS/.env.example b/01OS/.env.example index dd48b0d..f6b726d 100644 --- a/01OS/.env.example +++ b/01OS/.env.example @@ -18,8 +18,8 @@ PIPER_VOICE_NAME="en_US-lessac-medium.onnx" # If SERVER_START, this is where we'll serve the server. # If CLIENT_START, this is where the client expects the server to be. -# SERVER_CONNECTION_URL=wss://localhost:8000/ -SERVER_CONNECTION_URL=wss://localhost:8000/ +# SERVER_CONNECTION_URL=ws://localhost:8000/ +SERVER_CONNECTION_URL=ws://localhost:8000/ SERVER_START=True CLIENT_START=True diff --git a/01OS/01OS/server/server.py b/01OS/01OS/server/server.py index 24d88f0..c6e128f 100644 --- a/01OS/01OS/server/server.py +++ b/01OS/01OS/server/server.py @@ -289,7 +289,7 @@ if __name__ == "__main__": asyncio.create_task(put_kernel_messages_into_queue(from_computer)) # Start the server - logger.info("Starting `server.py`... on wss://localhost:" + str(SERVER_LOCAL_PORT)) + logger.info("Starting `server.py`... on localhost:" + str(SERVER_LOCAL_PORT)) config = Config(app, host="localhost", port=SERVER_LOCAL_PORT, lifespan='on') server = Server(config) diff --git a/01OS/README.md b/01OS/README.md index 9b773c8..a16ccb3 100644 --- a/01OS/README.md +++ b/01OS/README.md @@ -11,6 +11,11 @@ pip install 01OS **Expose an 01 server publically:** +We are currently using localtunnel to handle the creation of public tunnel endpoints. + +Note: You will need to install Node and the localtunnel tool before this will work correctly: +```npm install -g localtunnel``` + ```bash 01 --server --expose # This will print a URL that a client can point to. ``` diff --git a/01OS/start.sh b/01OS/start.sh index de886e9..adcd852 100755 --- a/01OS/start.sh +++ b/01OS/start.sh @@ -56,7 +56,12 @@ fi # Check if "--expose" is passed as an argument if [[ "$@" == *"--expose"* ]]; then - export TUNNEL_START="True" + if [[ "$SERVER_START" != "True" ]]; then + echo "Error: Start script must be started with --serve for tunneling to work." + exit 1 + else + export TUNNEL_START="True" + fi fi # Check if "--clear-local" is passed as an argument diff --git a/01OS/tunnel.sh b/01OS/tunnel.sh index 0f50c0d..2c7138a 100755 --- a/01OS/tunnel.sh +++ b/01OS/tunnel.sh @@ -1,8 +1,14 @@ #!/usr/bin/env bash -echo "Starting up localhost.run tunnel..." -ssh -o StrictHostKeyChecking=no -R 80:localhost:8000 nokey@localhost.run 2>&1 | while IFS= read -r line; do - if [[ "$line" =~ https://([a-zA-Z0-9]+\.lhr\.life) ]]; then - echo "Your free localhost.run tunnel is now active. Please set your client SERVER_CONNECTION_URL env var to: \"wss://${BASH_REMATCH[1]}\"" +# Get the SERVER_PORT environment variable, but default to 8000 +SERVER_LOCAL_PORT=${SERVER_LOCAL_PORT:-8000} + +echo "Starting up localtunnel service for port $SERVER_LOCAL_PORT on localhost..." + +npx localtunnel --port $SERVER_LOCAL_PORT | while IFS= read -r line; do + if [[ "$line" == "your url is: https://"* ]]; then + echo "Tunnel is up!" + echo "Please set your client env variable for SERVER_CONNECTION_URL=wss://${line:21}" + break fi done From 2630b5addf5575719e73ef174b38079432e049ab Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Sat, 17 Feb 2024 22:34:17 -0800 Subject: [PATCH 4/7] Updating readme with more info about localtunnel --- 01OS/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01OS/README.md b/01OS/README.md index a16ccb3..1574673 100644 --- a/01OS/README.md +++ b/01OS/README.md @@ -11,9 +11,9 @@ pip install 01OS **Expose an 01 server publically:** -We are currently using localtunnel to handle the creation of public tunnel endpoints. +We are currently using localtunnel (https://github.com/localtunnel/localtunnel) to handle the creation of public tunnel endpoints. -Note: You will need to install Node and the localtunnel tool before this will work correctly: +Note: You will need to install Node and localtunnel before exposing the service will work correctly: ```npm install -g localtunnel``` ```bash From 298059b9c49c1bfe00acbebab165b0d40c5e4ae9 Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Thu, 22 Feb 2024 17:38:50 -0800 Subject: [PATCH 5/7] Adding support for tunneling with bore, localtunnel, and ngrok --- 01OS/README.md | 31 ++++++++++++++++++------ 01OS/start.sh | 10 ++++++++ 01OS/tunnel.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 92 insertions(+), 14 deletions(-) diff --git a/01OS/README.md b/01OS/README.md index 1574673..facf81a 100644 --- a/01OS/README.md +++ b/01OS/README.md @@ -11,14 +11,31 @@ pip install 01OS **Expose an 01 server publically:** -We are currently using localtunnel (https://github.com/localtunnel/localtunnel) to handle the creation of public tunnel endpoints. +We currently support exposing the 01 server publicly via a couple of different tunnel services: -Note: You will need to install Node and localtunnel before exposing the service will work correctly: -```npm install -g localtunnel``` +- bore.pub (https://github.com/ekzhang/bore) + Requirements: Ensure that rust is installed (https://www.rust-lang.org/tools/install), then run `cargo install bore-cli` + + ```bash + 01 --server --expose-with-bore + ``` + +- localtunnel (https://github.com/localtunnel/localtunnel) + Requirements: Ensure that Node is installed (https://nodejs.org/en/download), then run `npm install -g localtunnel` + + ```bash + 01 --server --expose-with-localtunnel + ``` + +- ngrok (https://ngrok.com/) + Requirements: Install ngrok (https://ngrok.com/docs/getting-started/), and set up an ngrok account. + Get your auth key from https://dashboard.ngrok.com/get-started/your-authtoken, then set it in + your local configuration by running `ngrok config add-authtoken your_auth_token_here` + + ```bash + 01 --server --expose-with-ngrok + ``` -```bash -01 --server --expose # This will print a URL that a client can point to. -``` **Run a specific client:** @@ -34,5 +51,5 @@ The `--local` flag will install and run the [whisper.cpp](https://github.com/gge ```bash 01 --local # Local client and server -01 --local --server --expose # Expose a local server +01 --local --server --expose-with-bore # Expose a local server ``` diff --git a/01OS/start.sh b/01OS/start.sh index 8212771..1a73fa7 100755 --- a/01OS/start.sh +++ b/01OS/start.sh @@ -61,6 +61,16 @@ if [[ "$@" == *"--expose"* ]]; then exit 1 else export TUNNEL_START="True" + + if [[ "$@" == *"--expose-with-bore"* ]]; then + export TUNNEL_METHOD="bore" + elif [[ "$@" == *"--expose-with-localtunnel"* ]]; then + export TUNNEL_METHOD="localtunnel" + elif [[ "$@" == *"--expose-with-ngrok"* ]]; then + export TUNNEL_METHOD="ngrok" + fi + + echo "exposing server" fi fi diff --git a/01OS/tunnel.sh b/01OS/tunnel.sh index 580049c..564acf9 100755 --- a/01OS/tunnel.sh +++ b/01OS/tunnel.sh @@ -1,14 +1,65 @@ #!/usr/bin/env bash +# Get tunnel method from TUNNEL_METHOD environment variable, but default to bore +# Possible options; +# - bore +# - localtunnel +# - ngrok +TUNNEL_METHOD=${TUNNEL_METHOD:-bore} + # Get the SERVER_PORT environment variable, but default to 8000 SERVER_LOCAL_PORT=${SERVER_LOCAL_PORT:-8000} -echo "Starting up localtunnel service for port $SERVER_LOCAL_PORT on localhost..." +echo "Using $TUNNEL_METHOD to expose port $SERVER_LOCAL_PORT on localhost..." + +# If the TUNNEL_METHOD is bore, then we need to check if the bore-cli is installed +if [[ "$TUNNEL_METHOD" == "bore" ]]; then + + if ! command -v bore &> /dev/null; then + echo "The bore-cli command is not available. Please run 'cargo install bore-cli'." + echo "For more information, see https://github.com/ekzhang/bore" + exit 1 + else + bore local $SERVER_LOCAL_PORT --to bore.pub | while IFS= read -r line; do + if [[ "$line" == *"listening at bore.pub:"* ]]; then + remote_port=$(echo "$line" | grep -o 'bore.pub:[0-9]*' | cut -d':' -f2) + echo "Please set your client env variable for SERVER_URL=ws://bore.pub:$remote_port" + break + fi + done + fi + +elif [[ "$TUNNEL_METHOD" == "localtunnel" ]]; then -npx localtunnel --port $SERVER_LOCAL_PORT | while IFS= read -r line; do - if [[ "$line" == "your url is: https://"* ]]; then - echo "Tunnel is up!" - echo "Please set your client env variable for SERVER_URL=wss://${line:21}" - break + if ! command -v lt &> /dev/null; then + echo "The 'lt' command is not available." + echo "Please ensure you have Node.js installed, then run 'npm install -g localtunnel'." + echo "For more information, see https://github.com/localtunnel/localtunnel" + exit 1 + else + npx localtunnel --port $SERVER_LOCAL_PORT | while IFS= read -r line; do + if [[ "$line" == *"your url is: https://"* ]]; then + remote_url=$(echo "$line" | grep -o 'https://[a-zA-Z0-9.-]*' | sed 's|https://||') + echo "Please set your client env variable for SERVER_URL=wss://$remote_url" + break + fi + done fi -done + +elif [[ "$TUNNEL_METHOD" == "ngrok" ]]; then + + if ! command -v ngrok &> /dev/null; then + echo "The ngrok command is not available." + echo "Please install ngrok using the instructions at https://ngrok.com/docs/getting-started/" + exit 1 + else + ngrok http $SERVER_LOCAL_PORT --log stdout | while IFS= read -r line; do + if [[ "$line" == *"started tunnel"* ]]; then + remote_url=$(echo "$line" | grep -o 'https://[a-zA-Z0-9.-]*' | sed 's|https://||') + echo "Please set your client env variable for SERVER_URL=wss://$remote_url" + break + fi + done + fi + +fi From a162675d375e060477a745fa28e6e7b0bd7eaa3d Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Thu, 22 Feb 2024 17:43:50 -0800 Subject: [PATCH 6/7] removing redundant readme and adding details about tunnel expose --- 01OS/README.md | 55 -------------------------------------------------- README.md | 30 +++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 59 deletions(-) delete mode 100644 01OS/README.md diff --git a/01OS/README.md b/01OS/README.md deleted file mode 100644 index facf81a..0000000 --- a/01OS/README.md +++ /dev/null @@ -1,55 +0,0 @@ -The open-source language model computer. - -```bash -pip install 01OS -``` - -```bash -01 # This will run a server + attempt to determine and run a client. -# (Behavior can be modified by changing the contents of `.env`) -``` - -**Expose an 01 server publically:** - -We currently support exposing the 01 server publicly via a couple of different tunnel services: - -- bore.pub (https://github.com/ekzhang/bore) - Requirements: Ensure that rust is installed (https://www.rust-lang.org/tools/install), then run `cargo install bore-cli` - - ```bash - 01 --server --expose-with-bore - ``` - -- localtunnel (https://github.com/localtunnel/localtunnel) - Requirements: Ensure that Node is installed (https://nodejs.org/en/download), then run `npm install -g localtunnel` - - ```bash - 01 --server --expose-with-localtunnel - ``` - -- ngrok (https://ngrok.com/) - Requirements: Install ngrok (https://ngrok.com/docs/getting-started/), and set up an ngrok account. - Get your auth key from https://dashboard.ngrok.com/get-started/your-authtoken, then set it in - your local configuration by running `ngrok config add-authtoken your_auth_token_here` - - ```bash - 01 --server --expose-with-ngrok - ``` - - -**Run a specific client:** - -```bash -01 --client macos # Options: macos, rpi -``` - -**Run locally:** - -The current default uses OpenAI's services. - -The `--local` flag will install and run the [whisper.cpp](https://github.com/ggerganov/whisper.cpp) STT and [Piper](https://github.com/rhasspy/piper) TTS models. - -```bash -01 --local # Local client and server -01 --local --server --expose-with-bore # Expose a local server -``` diff --git a/README.md b/README.md index fd5fdb3..0492de6 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,31 @@ pip install 01OS **Expose an 01 server publically:** -```bash -01 --server --expose # This will print a URL that a client can point to. -``` +We currently support exposing the 01 server publicly via a couple of different tunnel services: + +- bore.pub (https://github.com/ekzhang/bore) + Requirements: Ensure that rust is installed (https://www.rust-lang.org/tools/install), then run `cargo install bore-cli` + + ```bash + 01 --server --expose-with-bore + ``` + +- localtunnel (https://github.com/localtunnel/localtunnel) + Requirements: Ensure that Node is installed (https://nodejs.org/en/download), then run `npm install -g localtunnel` + + ```bash + 01 --server --expose-with-localtunnel + ``` + +- ngrok (https://ngrok.com/) + Requirements: Install ngrok (https://ngrok.com/docs/getting-started/), and set up an ngrok account. + Get your auth key from https://dashboard.ngrok.com/get-started/your-authtoken, then set it in + your local configuration by running `ngrok config add-authtoken your_auth_token_here` + + ```bash + 01 --server --expose-with-ngrok + ``` + **Run a specific client:** @@ -55,7 +77,7 @@ The `--local` flag will install and run the [whisper.cpp](https://github.com/gge ```bash 01 --local # Local client and server -01 --local --server --expose # Expose a local server +01 --local --server --expose-with-bore # Expose the local server with a public tunnel ``` **Teach Mode (experimental)** From dd702c0ad6e0b1c73b94b7c102990dec5bebd45e Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Thu, 22 Feb 2024 17:48:04 -0800 Subject: [PATCH 7/7] fixing formatting in readme for the expose tunnel section --- README.md | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0492de6..0b957cb 100644 --- a/README.md +++ b/README.md @@ -35,29 +35,36 @@ pip install 01OS # (Behavior can be modified by changing the contents of `.env`) ``` -**Expose an 01 server publically:** +**Expose an 01 Server Publicly** We currently support exposing the 01 server publicly via a couple of different tunnel services: -- bore.pub (https://github.com/ekzhang/bore) - Requirements: Ensure that rust is installed (https://www.rust-lang.org/tools/install), then run `cargo install bore-cli` - +- **bore.pub** ([GitHub](https://github.com/ekzhang/bore)) + - **Requirements:** Ensure that Rust is installed ([Rust Installation](https://www.rust-lang.org/tools/install)), then run: + ``` + cargo install bore-cli + ``` + - **To Expose:** ```bash 01 --server --expose-with-bore ``` -- localtunnel (https://github.com/localtunnel/localtunnel) - Requirements: Ensure that Node is installed (https://nodejs.org/en/download), then run `npm install -g localtunnel` - +- **localtunnel** ([GitHub](https://github.com/localtunnel/localtunnel)) + - **Requirements:** Ensure that Node.js is installed ([Node.js Download](https://nodejs.org/en/download)), then run: + ``` + npm install -g localtunnel + ``` + - **To Expose:** ```bash 01 --server --expose-with-localtunnel ``` -- ngrok (https://ngrok.com/) - Requirements: Install ngrok (https://ngrok.com/docs/getting-started/), and set up an ngrok account. - Get your auth key from https://dashboard.ngrok.com/get-started/your-authtoken, then set it in - your local configuration by running `ngrok config add-authtoken your_auth_token_here` - +- **ngrok** ([Website](https://ngrok.com/)) + - **Requirements:** Install ngrok ([Getting Started with ngrok](https://ngrok.com/docs/getting-started/)), and set up an ngrok account. Get your auth key from [ngrok dashboard](https://dashboard.ngrok.com/get-started/your-authtoken), then set it in your local configuration by running: + ``` + ngrok config add-authtoken your_auth_token_here + ``` + - **To Expose:** ```bash 01 --server --expose-with-ngrok ```