From 8b3e1b1425af90f3cc4147d904cc255aaab53454 Mon Sep 17 00:00:00 2001 From: rachfop Date: Sun, 17 Mar 2024 09:49:10 -0700 Subject: [PATCH 1/3] SkyPilot --- docs/tutorials/integrations/_category_.json | 8 +++ docs/tutorials/integrations/skypilot.md | 66 +++++++++++++++++++++ sidebars.js | 10 ++++ 3 files changed, 84 insertions(+) create mode 100644 docs/tutorials/integrations/_category_.json create mode 100644 docs/tutorials/integrations/skypilot.md diff --git a/docs/tutorials/integrations/_category_.json b/docs/tutorials/integrations/_category_.json new file mode 100644 index 00000000..28edc346 --- /dev/null +++ b/docs/tutorials/integrations/_category_.json @@ -0,0 +1,8 @@ +{ + "position": 4, + "label": "Integrations", + "collapsible": true, + "collapsed": false, + "className": "red", + +} diff --git a/docs/tutorials/integrations/skypilot.md b/docs/tutorials/integrations/skypilot.md new file mode 100644 index 00000000..c73dceb1 --- /dev/null +++ b/docs/tutorials/integrations/skypilot.md @@ -0,0 +1,66 @@ +--- +title: Running RunPod on SkyPilot +sidebar_label: SkyPilot +--- + +[SkyPilot](https://skypilot.readthedocs.io/en/latest/) is a framework for executing LLMs, AI, and batch jobs on any cloud, offering maximum cost savings, highest GPU availability, and managed execution. + +This integration leverages the RunPod CLI infrastructure, streamlining the process of spinning up on-demand pods and deploying serverless endpoints with SkyPilot. + +## Getting started + +To begin using RunPod with SkyPilot, follow these steps: + +1. **Obtain Your API Key**: Visit the [RunPod Settings](https://www.runpod.io/console/user/settings) page to get your API key. If you haven't created an account yet, you'll need to do so before obtaining the key. + +2. **Install RunPod**: Use the following command to install the latest version of RunPod: + ``` + pip install "runpod>=1.6" + ``` + +3. **Configure RunPod**: Enter `runpod config` in your CLI and paste your API key when prompted. + +4. **Install SkyPilot RunPod Cloud**: Execute the following command to install the [SkyPilot RunPod cloud](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#runpod): + ``` + pip install "skypilot-nightly[runpod]" + ``` + +5. **Verify Your Setup**: Run `sky check` to ensure your credentials are correctly set up and you're ready to proceed. + +## Running a Project + +After setting up your environment, you can seamlessly spin up a cluster in minutes: + +1. **Create a New Project Directory**: Run `mkdir hello-sky` to create a new directory for your project. + +2. **Navigate to Your Project Directory**: Change into your project directory with `cd hello-sky`. + +3. **Create a Configuration File**: Enter `cat > hello_sky.yaml` and input the following configuration details: + + ```yml + resources: + cloud: runpod + + # Working directory (optional) containing the project codebase. + # Its contents are synced to ~/sky_workdir/ on the cluster. + workdir: . + + # Setup commands (optional). + # Typical use: pip install -r requirements.txt + # Invoked under the workdir (i.e., can use its files). + setup: | + echo "Running setup." + + # Run commands. + # Typical use: make use of resources, such as running training. + # Invoked under the workdir (i.e., can use its files). + run: | + echo "Hello, SkyPilot!" + conda env list + ``` + +4. **Launch Your Project**: With your configuration file created, launch your project on the cluster by running `sky launch -c mycluster hello_sky.yaml`. + +5. **Confirm Your GPU Type**: You should see the available GPU options on Secure Cloud appear in your command line. Once you confirm your GPU type, your cluster will start spinning up. + +With this integration, you can leverage the power of RunPod and SkyPilot to efficiently run your LLMs, AI, and batch jobs on any cloud. \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index adb45777..035b9e35 100644 --- a/sidebars.js +++ b/sidebars.js @@ -132,6 +132,16 @@ module.exports = { }, ], }, + { + type: "category", + label: "Integrations", + items: [ + { + type: "autogenerated", + dirName: "tutorials/integrations", + }, + ], + }, { type: "category", label: "Migrations", From b7ce74681515aee84d133ac5ebb8658a366f9a3f Mon Sep 17 00:00:00 2001 From: rachfop Date: Mon, 6 May 2024 09:31:10 -0700 Subject: [PATCH 2/3] Adds Mods --- .../integrations/{ => mods}/_category_.json | 2 +- docs/tutorials/integrations/mods/mods.md | 57 +++++++++++++++++++ .../integrations/skypilot/_category_.json | 8 +++ .../integrations/{ => skypilot}/skypilot.md | 0 sidebars.js | 10 ++++ 5 files changed, 76 insertions(+), 1 deletion(-) rename docs/tutorials/integrations/{ => mods}/_category_.json (76%) create mode 100644 docs/tutorials/integrations/mods/mods.md create mode 100644 docs/tutorials/integrations/skypilot/_category_.json rename docs/tutorials/integrations/{ => skypilot}/skypilot.md (100%) diff --git a/docs/tutorials/integrations/_category_.json b/docs/tutorials/integrations/mods/_category_.json similarity index 76% rename from docs/tutorials/integrations/_category_.json rename to docs/tutorials/integrations/mods/_category_.json index 28edc346..49cd4ab2 100644 --- a/docs/tutorials/integrations/_category_.json +++ b/docs/tutorials/integrations/mods/_category_.json @@ -1,6 +1,6 @@ { "position": 4, - "label": "Integrations", + "label": "SkyPilot", "collapsible": true, "collapsed": false, "className": "red", diff --git a/docs/tutorials/integrations/mods/mods.md b/docs/tutorials/integrations/mods/mods.md new file mode 100644 index 00000000..1ee3d62c --- /dev/null +++ b/docs/tutorials/integrations/mods/mods.md @@ -0,0 +1,57 @@ +--- +title: Running RunPod on Mods +sidebar_label: Mods +--- + +[Mods](https://github.com/charmbracelet/mods) is an AI-powered tool designed for the command line and built to seamlessly integrate with pipelines. +It provides a convenient way to interact with language models directly from your terminal. + +## How Mods Works + +Mods operates by reading standard input and prefacing it with a prompt supplied in the Mods arguments. +It sends the input text to a language model (LLM) and prints out the generated result. +Optionally, you can ask the LLM to format the response as Markdown. +This allows you to "question" the output of a command, making it a powerful tool for interactive exploration and analysis. Additionally, Mods can work with standard input or an individually supplied argument prompt. + +## Getting Started with Mods and SkyPilot + +To start using Mods with SkyPilot, follow these step-by-step instructions: + +1. **Obtain Your API Key**: + - Visit the [RunPod Settings](https://www.runpod.io/console/user/settings) page to retrieve your API key. + - If you haven't created an account yet, you'll need to sign up before obtaining the key. + +2. **Install Mods**: + - Refer to the different installation methods for [Mods](https://github.com/charmbracelet/mods) based on your preferred approach. + +3. **Configure RunPod**: + - Update the `config_template.yml` file to use your RunPod configuration. Here's an example: + + ```yml + runpod: + # https://docs.runpod.io/serverless/workers/vllm/openai-compatibility + base-url: https://api.runpod.ai/v2/${YOUR_ENDPOINT}/openai/v1 + api-key: + api-key-env: RUNPOD_API_KEY + models: + # Add your model name + openchat/openchat-3.5-1210: + aliases: ["openchat"] + max-input-chars: 8192 + ``` + + - `base-url`: Update your base-url with your specific endpoint. + - `api-key-env`: Add your RunPod API key. + - `openchat/openchat-3.5-1210`: Replace with the name of the model you want to use. + - `aliases: ["openchat"]`: Replace with your preferred model alias. + - `max-input-chars`: Update the maximum input characters allowed for your model. + +4. **Verify Your Setup**: + - To ensure everything is set up correctly, pipe any command line output and pass it to `mods`. + - Specify the RunPod API and model you want to use. + + ```bash + ls ~/Downloads | mods --api runpod --model openchat -f "tell my fortune based on these files" | glow + ``` + + - This command will list the files in your `~/Downloads` directory, pass them to Mods using the RunPod API and the specified model, and format the response as a fortune based on the files. The output will then be piped to `glow` for a visually appealing display. diff --git a/docs/tutorials/integrations/skypilot/_category_.json b/docs/tutorials/integrations/skypilot/_category_.json new file mode 100644 index 00000000..49cd4ab2 --- /dev/null +++ b/docs/tutorials/integrations/skypilot/_category_.json @@ -0,0 +1,8 @@ +{ + "position": 4, + "label": "SkyPilot", + "collapsible": true, + "collapsed": false, + "className": "red", + +} diff --git a/docs/tutorials/integrations/skypilot.md b/docs/tutorials/integrations/skypilot/skypilot.md similarity index 100% rename from docs/tutorials/integrations/skypilot.md rename to docs/tutorials/integrations/skypilot/skypilot.md diff --git a/sidebars.js b/sidebars.js index 035b9e35..abe3bca9 100644 --- a/sidebars.js +++ b/sidebars.js @@ -152,5 +152,15 @@ module.exports = { }, ], }, + { + type: "category", + label: "Integrations", + items: [ + { + type: "autogenerated", + dirName: "tutorials/integrations", + }, + ], + }, ], }; From c7f90612de988e9a4acbfde39524f88d2e59248c Mon Sep 17 00:00:00 2001 From: rachfop Date: Thu, 9 May 2024 11:28:30 -0700 Subject: [PATCH 3/3] save --- docs/tutorials/integrations/skypilot/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/integrations/skypilot/_category_.json b/docs/tutorials/integrations/skypilot/_category_.json index 49cd4ab2..3ef908ac 100644 --- a/docs/tutorials/integrations/skypilot/_category_.json +++ b/docs/tutorials/integrations/skypilot/_category_.json @@ -1,6 +1,6 @@ { "position": 4, - "label": "SkyPilot", + "label": "Mods", "collapsible": true, "collapsed": false, "className": "red",