Quickstart

From nothing to a report in about five minutes.

1. Install

Requires Python 3.10 or newer. The core harness has no runtime dependencies; bittensor is an optional extra, needed only for signature verification and live-chain reads.

# run it without installing anything
uvx --from assay-bittensor assay list
​
# or install it
uv pip install assay-bittensor
​
# signature checks and live replay
uv pip install "assay-bittensor[chain]"

uvx needs --from because the distribution name and the command name differ — assay is taken on PyPI. Same reason python-dateutil installs dateutil.

2. Write an adapter

A mechanism receives a batch of responses and a function that scores one response. It returns a mapping of uid to weight.

python
from assay import Batch, Mechanism
​
​
class MySubnet(Mechanism):
name = "my-subnet"
​
def score(self, batch: Batch, evaluate) -> dict[int, float]:
weights = {}
for response in batch.responses:
# evaluate() returns a noisy quality in [0, 1].
# It is deliberately noisy: one look should not be enough.
weights[response.uid] = evaluate(response)
return weights
​
​
MECHANISM = MySubnet()

3. Run it

# human-readable table
assay run assay_adapter.py
​
# markdown to paste into a README or a PR
assay run assay_adapter.py -f markdown -o report.md
​
# one scenario only
assay run assay_adapter.py -s sybil_farm
​
# replay a real subnet's miner distribution
assay run assay_adapter.py --netuid 64

Previous

Introduction

Next

Installation