Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/tutorials/integrations/mods/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"position": 4,
"label": "SkyPilot",
"collapsible": true,
"collapsed": false,
"className": "red",

}
57 changes: 57 additions & 0 deletions docs/tutorials/integrations/mods/mods.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions docs/tutorials/integrations/skypilot/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"position": 4,
"label": "Mods",
"collapsible": true,
"collapsed": false,
"className": "red",

}
66 changes: 66 additions & 0 deletions docs/tutorials/integrations/skypilot/skypilot.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,15 @@ module.exports = {
},
],
},
{
type: "category",
label: "Integrations",
items: [
{
type: "autogenerated",
dirName: "tutorials/integrations",
},
],
},
],
};