Skip to content

Commit

Permalink
feat(ai): add contribution pages scaffold
Browse files Browse the repository at this point in the history
This commit adds a general scaffold for the contribution pages. It is a
quick draft and should not yet be published to the upstream docs.
  • Loading branch information
rickstaa committed Apr 26, 2024
1 parent c04efec commit 56cfebb
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 5 deletions.
21 changes: 21 additions & 0 deletions ai/contribute/developers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Develop the AI Subnet
---

Great that you decied to help us build the Livepeer AI Subnet and help us achieve our mission of building a decentralized AI ecosystem. Here are the steps to get started:

1. **Get familiar with our Developers Portal**: Go to https://livepeer.org/developers and read through our general documentation to get familiar with the Livepeer ecosystem.
2. **Join the Livepeer Discord**: Join the Livepeer Discord at https://discord.gg/7w2R6v and introduce yourself in the `ai-video` channel. Tell us about your background and what you are interested in building.
3. **Get familiar with the AI Subnet**: Read through the [AI Subnet documentation](ai/introduction) to understand the architecture and how it works.
4. **Follow the Developer Guides**: Read through the developer guides below to get started with building on the AI Subnet.

## Developer Guides

<CardGroup cols={2}>
<Card title="Add a new Model" icon="robot" iconType="duotone" href="/ai/guides/add-model">
Add support for a new diffusion model.
</Card>
<Card title="Add a new Pipeline" icon="wand-magic-sparkles" iconType="duotone" href="/ai/guides/add-pipeline">
Add a new pipeline to the AI Subnet.
</Card>
</CardGroup>
34 changes: 34 additions & 0 deletions ai/contribute/guides/add-model.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Add new Model
---

Adding support for a new model to the AI subnet is a great way to get started with contributing to the Livepeer AI Subnet. This guide will walk you through the steps to add a new model to the AI Subnet.

## Video Guide

In this video, one of our Lead Developers will walk you through the steps to add a new model to the AI Subnet.

<iframe
width="560"
height="315"
src="https://www.youtube.com/watch?v=aqz-KE-bpKQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

## Step-by-Step Guide

Adding a new model to the AI Subnet is relatively straightforward since each of our supported [pipelines](/ai/guides/add-pipeline) is designed to support multiple diffusion models in the respective diffusion pipeline. To add a new model, you will need to follow these steps:

1. **Fork the AI Worker Repository**: Fork the [Livepeer AI Worker](https://github.com/livepeer/ai-worker) repository to your GitHub account.
2. **Clone the Repository**: Clone the forked repository to your local machine.
3. **Find a Model**: Find a diffusion model from [Hugging Face](https://huggingface.co/models?pipeline_tag=image-to-video) that you would like to add to the AI Subnet. Replace the `image-to-video` pipeline tag in the URL with the pipeline tag of your choice.
3. **Download the Model**: Update the [runner/dl_checkpoints.sh](https://github.com/livepeer/ai-worker/blob/main/runner/dl_checkpoints.sh#L73) script to download the model weights from Hugging Face.
4. **Set the MODEL_ID env variable**: Set the `MODEL_ID` environment variable to the hugging face identifier of the model you want to add.
5. **Run the AI Worker**: Run the AI Worker with the updated `runner/dl_checkpoints.sh` script to download the model weights.
6 **Test the Model**: Test the model by starting the AI Worker (see the [runner README](https://github.com/livepeer/ai-worker/tree/main/runner#readme)).
7. **Make the necessary changes**: If a model does not work natively with the AI worker, you may need to make changes to the repsectify pipeline the model is in.

<Tip>The best way to develop on the AI Worker is by using the [VScode Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) provided in the repository. This will allow you to debug and test your changes in a consistent environment. For more information see [the runner dev documentation](https://github.com/livepeer/ai-worker/blob/main/runner/dev/README.md).</Tip>
31 changes: 31 additions & 0 deletions ai/contribute/guides/add-pipeline.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Add new Pipeline
---

Adding support for a new model to the AI subnet offers the opportunity to expand the capabilities of the AI subnet and provide more options for developers to build on top of the Livepeer network. This guide will walk you through the steps to add a new model to the AI subnet.


## Video Guide

In this video, one of our Lead Developers will walk you through the steps to add a new pipeline to the AI Subnet.

<iframe
width="560"
height="315"
src="https://www.youtube.com/watch?v=aqz-KE-bpKQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

## Step-by-Step Guide

Adding a new pipeline to the AI Subnet is a bit more involved than [adding a new model](ai/contribute/guides), but it is still relatively straightforward. To add a new pipeline, you will need to follow these steps:

1. **Fork the AI Worker Repository**: Fork the [Livepeer AI Worker]() repository to your GitHub account.
2. **Clone the Repository**: Clone the forked repository to your local machine.
3. **Create a New Pipeline**: Create a new pipeline in the `runner/pipelines` directory. You can use the existing pipelines as a reference. You can use the template files in the `runner/examples` directory to get started.
4. **Create a New Route**: Create a new route in the `runner/routes` directory to handle the API requests for the new pipeline. You can use the template files in the `runner/examples` directory to get started.

<Tip>The best way to develop on the AI Worker is by using the [VScode Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) provided in the repository. This will allow you to debug and test your changes in a consistent environment. For more information see [the runner dev documentation](https://github.com/livepeer/ai-worker/blob/main/runner/dev/README.md).</Tip>
12 changes: 12 additions & 0 deletions ai/contribute/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Get Started
---

Amazing that you want to contribute to the Livepeer AI Subnet! There are many ways to contribute, and we are excited to have you join us in our mission to build a decentralized AI ecosystem ❤️. Here are a few ways you can get started:

- **Orchestrators**: If you have GPUs with at least 16GB of VRAM, you can contribute by setting up an AI Orchestrator and processing AI tasks on the AI Subnet. Check out the [Get Started](/ai/orchestrator/get_started) page to learn more.
- **Gateways**: If you have server hardware and want to connect customers to the AI Subnet, you can contribute by setting up an AI Gateway. Check out the [Setup AI Gateway](/ai/setup-gateway) page to learn more.
- **Founder**: If you are a Founder, you can contribute by building AI applications on the AI Subnet. Check out the [Build on the AI Subnet](/ai/builders) page to learn more.
- **Developers**: If you are a Open Source Developer, you can contribute by improving the AI Subnet codebase. Check out the guide on [Contributing to the AI Subnet](/ai/contribute-to-ai-subnet) to learn more.

If you have any questions or need help, feel free to reach out to us in the `ai-video` channel of the [Livepeer Discord](https://discord.gg/7w2R6v). We are here to help you get started and support you along the way. Let's build together! 🚀
4 changes: 4 additions & 0 deletions ai/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,31 @@ The AI Subnet is built on top of the existing Livepeer network, leveraging the s
href="/ai/orchestrator/get_started"
title="Setup AI Orchestrator"
icon="robot"
iconType="duotone"
>
Setup your AI Orchestrator and earn fees from AI tasks.
</Card>
<Card
href="/ai/setup-gateway"
title="Setup AI Gateway"
icon="play"
iconType="duotone"
>
Establish an AI Gateway to serve a broad customer base with AI tasks.
</Card>
<Card
href="/ai/builders"
title="Build your dApp"
icon="screwdriver-wrench"
iconType="duotone"
>
Develop your innovative dApp on the AI Subnet efficiently and at scale.
</Card>
<Card
href="/ai/api-reference"
title="AI API Reference"
icon="rectangle-terminal"
iconType="duotone"
>
Explore the AI Subnet API to integrate AI capabilities into your projects.
</Card>
Expand Down
Empty file removed ai/pipelines.mdx
Empty file.
4 changes: 2 additions & 2 deletions ai/pipelines/image-to-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The `image-to-image` pipeline of the AI subnet enables **advanced image manipula

```mermaid
graph LR
A[<img src="https://github.com/livepeer/docs/assets/17570430/43354272-de95-439e-a386-ce8ca8023354"/>] --> B[Gateway]
A[<img src="/images/ai/cool-cat.webp"/>] --> B[Gateway]
E["A hat"] --> B
B --> C[Orchestrator]
C --> B
B --> D[<img src="https://github.com/livepeer/docs/assets/17570430/4e179e7a-72dc-4eb8-a503-19fab262807d"/>]
B --> D[<img src="/images/ai/cool-cat-hat.png"/>]
```

## Models
Expand Down
4 changes: 2 additions & 2 deletions ai/pipelines/image-to-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ The `image-to-video` pipeline of the AI subnet allows you to generate animated *

```mermaid
graph LR
A[<img src="https://github.com/livepeer/docs/assets/17570430/4e179e7a-72dc-4eb8-a503-19fab262807d"/>] --> B[Gateway]
A[<img src="/images/ai/cool-cat.webp"/>] --> B[Gateway]
B --> C[Orchestrator]
C --> B
B --> D[<img src="https://github.com/livepeer/docs/assets/17570430/86d14b00-1ab1-4790-a262-18194633115d"/>]
B --> D[<img src="/images/ai/cool-cat-hat-moving.gif"/>]
```

## Models
Expand Down
2 changes: 1 addition & 1 deletion ai/pipelines/text-to-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ graph LR
A["A cool cat on the beach"] --> B[Gateway]
B --> C[Orchestrator]
C --> B
B --> D[<img src="https://github.com/livepeer/docs/assets/17570430/43354272-de95-439e-a386-ce8ca8023354"/>]
B --> D[<img src="/images/ai/cool-cat-hat.png"/>]
```

## Models
Expand Down
16 changes: 16 additions & 0 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,22 @@
},
"ai/setup-gateway",
"ai/builders",
{
"group": "How to Contribute",
"icon": "heart",
"iconType": "solid",
"pages": [
"ai/contribute/overview",
"ai/contribute/developers",
{
"group": "Guides",
"pages":[
"ai/contribute/guides/add-model",
"ai/contribute/guides/add-pipeline"
]
}
]
},
{
"group": "AI API Reference",
"icon": "rectangle-terminal",
Expand Down

0 comments on commit 56cfebb

Please sign in to comment.