Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: readme intro; reworked registration instructions #470

Merged
merged 9 commits into from
Dec 7, 2024
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 tazlin
# SPDX-FileCopyrightText: 2024 Tazlin <tazlin[email protected]>
#
# SPDX-License-Identifier: CC0-1.0

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 Tazlin
# SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
# SPDX-FileCopyrightText: 2024 db0
#
# SPDX-License-Identifier: CC0-1.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 Tazlin
# SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
# SPDX-FileCopyrightText: 2024 ceruleandeep
#
# SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
152 changes: 125 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,153 @@
<!--
SPDX-FileCopyrightText: 2022 Konstantinos Thoukydidis <[email protected]>
SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>

SPDX-License-Identifier: AGPL-3.0-or-later
-->

# AI Horde
# AI-Horde: Community-Powered AI Generation

The AI Horde is an enterprise-level ML-Ops crowdsourced distributed inference cluster for AI Models. This middleware can support both Image and Text generation. It is infinitelly scalable and supports seamless drop-in/drop-out of compute resources.
The [Public version](https://aihorde.net) allows people without a powerful GPU to use Stable Diffusion or Large Language Models like Pygmalion/Llama by relying on spare/idle resources provided by the communit and also allows non-python clients, such as games and apps, to use AI-provided generations.
The [AI Horde](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#ai-horde) is a free community service that lets anyone create [AI-generated images](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#image-generation) and [text](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#text2text). In the spirit of projects like Folding@home (sharing compute for medical research) or SETI@home (sharing compute for the search for alien signals), AI Horde lets volunteers share their computer power through [workers](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#worker) to help others create AI art and writing.

The AI Horde middleware itself can also be run privately inside a closed environment within any enterprise. It can be installed within hours and can scale your ML solution within days of deployment.
When you make a [request](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#request) - like asking for "a painting of a sunset over mountains" - the AI Horde system finds available volunteer computers that can handle your [job](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#job). It's similar to how ride-sharing apps connect passengers with nearby drivers, but instead of rides, you're getting AI-generated content.

For more questions, check the [FAQ](FAQ.md)
The system uses "[kudos](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/kudos.md)" points to keep things fair. [Workers](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#worker) earn kudos when their computers help process requests, which they can use to get priority for their own requests or leave unspent to help others. Importantly, kudos can never be bought or sold - this is strictly against the [Terms of Service](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#terms-of-service). If you would like to learn more about kudos, see [our detailed explanation](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/kudos.md).

# Sponsors
What makes AI Horde special is that it's completely free and community-run, with a strong commitment to staying that way. The kudos system is specifically designed to ensure that access to these resources remains equitable. While [users](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#user) with more kudos get faster service, anyone can use it for free, even [anonymously](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#anonymous), and kudos never expire.

[![](assets/logo_nlnet.svg)](https://nlnet.nl/project/AI-Horde/)
The AI-Horde hopes to ensure that everyone gets a chance to use these exciting AI technologies, regardless of their financial means or technical resources. You can read more about why we do this in the [motivations document](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/why.md).

# Registering
## Sponsors

To use the horde you need to have a registered account, or use anonymous mode.
[![NLnet logo](assets/logo_nlnet.svg)](https://nlnet.nl/project/AI-Horde/)

To register an account, go to the AI Horde website:
* [AI Horde Registration](https://aihorde.net/register)
## Table of Contents

and login with one of the available services. Once you do you'll see a form where you can put a username. Add one in and it will automatically store a user object for you and provide an API key to identify you.
- [AI-Horde: Community-Powered AI Generation](#ai-horde-community-powered-ai-generation)
- [Table of Contents](#table-of-contents)
- [Sponsors](#sponsors)
- [Technical Introduction](#technical-introduction)
- [Key Features](#key-features)
- [Public Version](#public-version)
- [Private Deployment](#private-deployment)
- [Technologies Used](#technologies-used)
- [How It Works](#how-it-works)
- [Getting Started with AI Horde](#getting-started-with-ai-horde)
- [OAuth2 Registered Account (Recommended)](#oauth2-registered-account-recommended)
- [Pseudonymous Account](#pseudonymous-account)
- [Anonymous Usage](#anonymous-usage)
- [Why Register?](#why-register)
- [Contribute your GPU (Become a worker)](#contribute-your-gpu-become-a-worker)
- [Image](#image)
- [Text](#text)
- [Integrate with the AI-Horde](#integrate-with-the-ai-horde)
- [Community](#community)

Store this API key and use it for your client or bridge.
## Technical Introduction

By logging in first, you can change your username and API key at any time.
We don't store any identifiable information other than the ID string sent by the oauth for your user. We only use this for user uniqueness, and no other purpose.
The AI Horde is an enterprise-level ML-Ops crowd-sourced distributed inference cluster for AI Models. This middleware supports both image and text generation, making it highly versatile. It is designed to be highly scalable, allowing for seamless drop-in/drop-out of compute resources.

If you want, you can also create a pseudonymous account, without logging in with oauth. However *we will not maintain such accounts*. If you lose access to it, you'll have to make a new one. If someone copies your API Key, they can impersonate you. You cannot change the username or API key anymore etc. If you don't want these risks, login to one of the available services instead.
### Key Features

If you do not want to login even with a pseudonymous account, you can use this service anonymously by using '0000000000' as your API key. However your usage and contributions will be not be tracked. Be aware that if this service gets too overloaded, anonymous mode might be turned off!
- **Scalability**: The system can scale effortlessly to accommodate varying workloads, ensuring efficient use of available resources.
- **Flexibility**: Supports both image and text generation, catering to a wide range of AI applications.
- **Community-Powered**: Relies on spare/idle resources provided by the community, making advanced AI accessible to everyone.

The point of registering is to track your usage and your contributions. The more you contribute to the Horde, the more priority you have. [Read about this here](https://dbzer0.com/blog/the-kudos-based-economy-for-the-koboldai-horde/)
### Public Version

## Integration
The [public version](https://aihorde.net) allows individuals without powerful GPUs to use advanced AI models like Stable Diffusion or Large Language Models (LLMs) such as Pygmalion/Llama. This is achieved by leveraging the spare computing power provided by the community, running software we call '[workers](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/definitions.md#worker)'. Additionally, it supports clients, such as third party websites, games and apps, to utilize AI-generated content through a [REST API](https://aihorde.net/api/). You can see the public instance's performance and application statistics on [our grafana instance](https://grafana.aihorde.net/d/jSb16YLVk/performance?orgId=1).

If you want to build an integration to the AI Horde (Bot, application, scripts etc), please consult our [Integration Readme](README_integration.md)
### Private Deployment

# Community
The AI Horde middleware can also be deployed privately within any enterprise environment. It can be installed within hours and can scale your ML solution within days of deployment, providing a robust and flexible solution for enterprise-level AI needs.

If you have any questions or feedback, we have a vibrant community on [discord](https://discord.gg/3DxrhksKzn)
### Technologies Used

- **Python**: 3.9 or later
- **PostgreSQL**
- **Redis**: For caching
- **Docker** support for full containerization

### How It Works

For a high-level overview of how the AI Horde operates, including diagrams of the request/job lifecycle, see the [request/job lifecycle explanation](https://github.com/Haidra-Org/haidra-assets/blob/main/docs/workers.md).

There are also individual readmes for each specific mode supported by the AI Horde.

- [Image generation Readme](README_StableHorde.md)
- [Text generation Readme](README_KoboldAIHorde.md)
- [Docker Readme](README_docker.md)

For common questions, check the [FAQ](FAQ.md). If you'd like more details on features of the horde or the reasoning behind it, see the [documentation which goes greater into depth](https://github.com/Haidra-Org/haidra-assets/tree/main/docs).

# Getting Started with AI Horde

You can use any service powered by the AI Horde either with a registered account or anonymously. You can find a partial list of services powered by the AI-Horde on our [main website](https://aihorde.net/).

## OAuth2 Registered Account (Recommended)

> Note: The only information we store from your account is your unique ID. We do not use your id for any other purpose. See our [privacy policy](https://aihorde.net/privacy) for more details.

- Visit [AI Horde Registration](https://aihorde.net/register)
- Log in using one of the supported OAuth2 services
- Choose your username and receive your API key
- Benefits:
- Start with higher priority in generation queues
- Can change username or reset API key if needed
- Maintain and track your kudos balance
- Can recover account access through OAuth2 service
- Minimum kudos balance of 25

## Pseudonymous Account

- Visit [AI Horde Registration](https://aihorde.net/register)
- This method is the default if you do not log in with an OAuth2 service (google, github, discord, etc)
- **Important**: If you lose your API key, the account cannot be recovered
- Cannot change username or reset API key
- Still earns and maintains kudos
- Still better priority than anonymous users

# Horde-Specific Information
## Anonymous Usage

- Use API key '0000000000'
- Lowest priority in generation queues
- No kudos tracking
- No need to register
- Service may be restricted for anonymous users during high load

Please see the individual readmes for each specific mode supported by the AI Horde.
## Why Register?

* [Image generation Readme](README_StableHorde.md)
* [Text generation Readme](README_KoboldAIHorde.md)
* [Docker Readme](README_docker.md)
The main benefit of registration is participating in the kudos system. Kudos determine your priority in the queue - the more kudos you have, the faster your requests are processed. You can earn kudos by:

- Running a worker to help process other users' requests
- Receiving kudos as a thank-you for donations (though kudos cannot be directly bought or sold)
- Being online and available as a worker
- Participating in the kudos economy on the [official discord](https://discord.gg/3DxrhksKzn) by logging in with the bot. (Use the command `/login` in any channel, click the blue button and enter your API key at the popup).

Remember: AI Horde is committed to remaining free and accessible. While the kudos system provides priority benefits, it's designed to encourage community contribution rather than commercialization. All users, even anonymous ones, can access the service's core features. Read about this on the [official developer's blog.](https://dbzer0.com/blog/the-kudos-based-economy-for-the-koboldai-horde/)

## Contribute your GPU (Become a worker)

Be sure to [register](#getting-started-with-ai-horde) first.

### Image

The officially supported way to add your GPU for image generation is by running the worker software [horde-worker-reGen](https://github.com/Haidra-Org/horde-worker-reGen).

### Text

There are multiple ways to contribute your GPU for text generation:

- [AI-Horde-Worker](https://github.com/Haidra-Org/AI-Horde-Worker) can connect to inference backends and 'bridge' you to the AI-Horde
- [KoboldAI](https://github.com/henk717/KoboldAI)
- [KoboldCPP](https://github.com/lostruins/koboldcpp)
- [Aphrodite Engine](https://github.com/PygmalionAI/aphrodite-engine)
- ... and many others. Join the discussion in the #horde channel of the [KoboldAI Discord Server](https://discord.gg/XuQWadgU9k) to learn more.

## Integrate with the AI-Horde

If you want to build an integration to the AI Horde (Bot, application, scripts etc), please consult our [Integration Readme](README_integration.md)

## Community

If you have any questions or feedback, we have a vibrant community on [discord](https://discord.gg/3DxrhksKzn)
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 Tazlin
# SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
# SPDX-FileCopyrightText: 2024 ceruleandeep
#
# SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion horde/data/news.json.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2024 Tazlin
SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>

SPDX-License-Identifier: AGPL-3.0-or-later
2 changes: 1 addition & 1 deletion sql_statements/cron/schedule_cron_job.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
2 changes: 1 addition & 1 deletion sql_statements/stored_procedures/cron_jobs/cron_stats.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2024 Tazlin
-- SPDX-FileCopyrightText: 2024 Tazlin <[email protected]>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

Expand Down
Loading