SubnetsSubnet Template

Commune Subnet Template

Subnet Template

Look at the Github Subnet template, to learn how to build a subnet.

View More

Template TL;DR

To make things easier for subnet builders. Commune AI provides a subnet template that you can get started off of.


The whole subnet template is built on top of the CommuneX library / SDK. Which is truly the only essential dependency.

Although in order to make the template more explicit we also provide additional libraries. You can find the whole dependency list we used in the requirements.txt file.

communex typer uvicorn keylimiter pydantic-settings


From the root of your project, you can just call comx module serve. For example:

comx module serve commune-subnet-template.subnet.miner.model.Miner <name-of-your-com-key> [--subnets-whitelist <your-subnet-netuid>] \ [--ip <text>] [--port <number>]


To run the validator, just call the file in which you are executing validator.validate_loop(). For example:

python3 -m commune-subnet-template.subnet.cli <name-of-your-com-key>