### Install Dependencies and Run Development Server Source: https://github.com/gensyn-ai/rl-swarm/blob/main/modal-login/README.md After configuring environment variables, use these commands to install project dependencies and then start the local development server for the application. ```shell yarn install ``` ```shell yarn dev ``` -------------------------------- ### Start RL Swarm Web Services with Docker Compose Source: https://github.com/gensyn-ai/rl-swarm/blob/main/web/README.md This command starts the services defined in the `docker-compose.yml` file, bringing up the web server and OpenTelemetry containers. It automatically configures the initial peer environment variable for local testing, connecting the server to the seed node and enabling metric emission. ```Shell docker-compose up ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/gensyn-ai/rl-swarm/blob/main/modal-login/README.md Create a `.env` file in the root directory to set necessary environment variables for the project, including API keys and policy IDs. Replace the placeholder '...' with your actual values. ```shell NEXT_PUBLIC_ALCHEMY_API_KEY= ... NEXT_PUBLIC_PAYMASTER_POLICY_ID= ... ``` -------------------------------- ### Start RL Swarm with CPU Support via Docker Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Use this command to run the RL Swarm Docker container optimized for CPU-only machines, such as Macs or systems without a dedicated GPU. It builds the necessary Docker image and starts the swarm in a detached, interactive mode, ensuring a consistent setup. ```sh docker-compose run --rm --build -Pit swarm-cpu ``` -------------------------------- ### Install or Upgrade Node.js globally using npm Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Suggests installing or upgrading Node.js globally using `npm` to resolve general installation or `npm` related issues. This ensures the environment has the latest compatible Node.js version. ```Shell npm install -g node@latest ``` -------------------------------- ### RL Swarm Web Server Environment Variables Source: https://github.com/gensyn-ai/rl-swarm/blob/main/web/README.md This section details the configurable environment variables for the RL Swarm web server. These variables allow customization of the HTTP server port and the initial list of peer multiaddrs for network connectivity. ```APIDOC Environment Variables: SWARM_UI_PORT: Description: The port of the HTTP server. Default: 8000 INITIAL_PEERS: Description: A comma-separated list of multiaddrs. Default: "" ``` -------------------------------- ### Build RL Swarm Web UI Docker Image Independently Source: https://github.com/gensyn-ai/rl-swarm/blob/main/web/README.md This command builds a Docker image specifically for the RL Swarm web server UI using the `Dockerfile.webserver`. The `-t swarmui` flag tags the image as 'swarmui', and `-f` specifies the Dockerfile to use, allowing for independent deployment of just the UI component. ```Shell docker build -t swarmui -f Dockerfile.webserver . ``` -------------------------------- ### Start RL Swarm with GPU Support via Docker Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Execute this command to launch the RL Swarm Docker container on machines equipped with officially supported NVIDIA GPUs. This configuration leverages your GPU for accelerated training, building the image and running the swarm in a detached, interactive mode. ```sh docker-compose run --rm --build -Pit swarm-gpu ``` -------------------------------- ### Docker Compose Command Workaround for Ubuntu Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md If the `docker-compose` command (with a hyphen) fails, particularly on Ubuntu systems, try using `docker compose` (without the hyphen) as an alternative. This addresses common compatibility issues with different Docker Compose installation methods or versions. ```sh docker compose run --rm --build -Pit swarm-gpu ``` -------------------------------- ### Build RL Swarm Web Containers with Docker Compose Source: https://github.com/gensyn-ai/rl-swarm/blob/main/web/README.md This command builds the Docker images for the RL Swarm web server and OpenTelemetry containers. The `--no-cache` flag ensures that the images are built from scratch, ignoring any cached layers, which is useful for development to pick up recent changes. ```Shell docker-compose build --no-cache ``` -------------------------------- ### Access Login Screen on VM via SSH Port Forwarding Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Explains how to use SSH port forwarding to access the login screen (running on port 3000) of an RL Swarm instance hosted on a VM or VPS. This is crucial for headless environments where direct browser access is not possible. The example uses `gcloud compute ssh`. ```Shell gcloud compute ssh --zone "us-central1-a" [your-vm] --project [your-project] -- -L 3000:localhost:3000 ``` -------------------------------- ### Upgrade viem and related packages using Yarn Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Provides a terminal command sequence to navigate to the `modal-login` directory and upgrade `viem`, `next`, and other dependencies using `yarn`. This ensures all related packages are up-to-date, potentially resolving compatibility issues. ```Shell cd /root/rl-swarm/modal-login/ && yarn upgrade && yarn add next@latest && yarn add viem@latest ``` -------------------------------- ### Run RL Swarm in Experimental (Advanced) Mode Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md For advanced users who wish to experiment with the underlying GenRL-Swarm library and its configurable parameters, this sequence of commands sets up a Python virtual environment and executes the RL Swarm via a shell script. This method allows for greater customization and direct interaction with the framework's internal workings. ```sh python3 -m venv .venv source .venv/bin/activate ./run_rl_swarm.sh ``` -------------------------------- ### Clone the RL Swarm Repository Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md This command clones the RL Swarm GitHub repository to your local machine. It provides access to the project's source code and all necessary files for setting up and running the swarm. ```sh git clone https://github.com/gensyn-ai/rl-swarm ``` -------------------------------- ### Update viem package version in package.json Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Provides a fix for issues with the `viem` package by specifying a particular version (`2.25.0`) in the `modal-login/package.json` file. This is a direct modification to the project's dependency configuration. ```JSON "viem": "2.25.0" ``` -------------------------------- ### Delete swarm.pem file to resolve login issues Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Instructs users to delete the `swarm.pem` file from the root directory to resolve login issues when switching accounts. This file stores the peer-id from a previous registration, which can disrupt the training process if not removed. ```Shell sudo rm swarm.pem ``` -------------------------------- ### Increase PyTorch MPS Memory Ratio for MacBook OOM Errors Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md Provides an experimental fix for Out-Of-Memory (OOM) errors on MacBooks, particularly when using PyTorch with MPS (Metal Performance Shaders). Setting the `PYTORCH_MPS_HIGH_WATERMARK_RATIO` environment variable to `0.0` can help manage memory allocation more aggressively. ```Shell export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 ``` -------------------------------- ### Apply Basic Font Styles to Body Source: https://github.com/gensyn-ai/rl-swarm/blob/main/modal-login/app/public/fonts/AuxMono/Webfont/Aux Mono.html This CSS snippet sets the font size and font family for the `body` element. It uses `AuxMono` as the primary font and falls back to `Georgia`. ```CSS body { font-size: 42px; font-family: "AuxMono", Georgia; } ``` -------------------------------- ### Set PyTorch MPS High Watermark Ratio Fix Source: https://github.com/gensyn-ai/rl-swarm/blob/main/README.md This experimental fix sets the `PYTORCH_MPS_HIGH_WATERMARK_RATIO` environment variable to `0.0` before executing the `run_rl_swarm.sh` script. This is typically used to address potential memory management or performance issues when using PyTorch with Metal Performance Shaders (MPS). ```shell export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 && ./run_rl_swarm.sh ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.