> For the complete documentation index, see [llms.txt](https://docs.hypertensor.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hypertensor.org/copy-of-subnet-template/introduction.md).

# Introduction

The subnet template is a P2P coordination layer to deploy clusters of nodes that communicate in a decentralized network. Your job is to build the distributed AI application logic on top of it.

There are three main facets for building a decentralized AI subnet:

## Application

This is the business logic for each peer and can be made to be role-isolated. Peers or roles have specific tasks; this is where that logic deploys from and lives. For example, a peer can be responsible for generating inference, validating trainer peers, etc.

The application logic is deployed from the [server](/copy-of-subnet-template/server.md) template. The template handles deploying **both the communication and consensus & scoring classes mentioned below**.

## Communication

This is how peers communicate with one another. There are two main features for peers to communicate with one another: **using a GossipSub or direct P2P communication** via custom protocols or the API protocol.

**Learn how to use the built-in communication templates, and build your own** [**here**](/copy-of-subnet-template/communication.md)**.**

## Consensus & Scoring

The consensus mechanism is for scoring peers. Each peer needs to know the scores of each other peer, whether there is one role or many roles. On each epoch, a validator from the subnet will be randomly elected for an attestation-based consensus mechanism, where this validator submits scores for each peer in the subnet. The other peers can vote on that proposal by attesting to it; not attesting to it counts as a non-vote. The subnet must reach a consensus of >66% to generate emissions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hypertensor.org/copy-of-subnet-template/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
