Python SDK for the Shard distributed inference network
Project description
shardnetwork-client
Python SDK for the Shard distributed inference network.
Install
pip install shardnetwork-client
Quickstart
from shard import ShardClient
with ShardClient(base_url="http://localhost:9091") as client:
print(client.node.status())
print(client.metrics.summary())
Programmatic Contribution
The SDK can also register a contributor against the daemon's signed control-plane endpoints.
from shard import ShardClient
with ShardClient(base_url="http://localhost:9091") as client:
contributor = client.contribution.create_session()
print("public key:", contributor.public_key_hex)
contributor.set_participation(True)
contributor.register_node(role="verifier", capacity=1)
contributor.heartbeat(
role="verifier",
queue_depth=0,
node_latency_ms=24,
uptime_seconds=12,
capability_tier="gpu_fast",
gpu_available=True,
public_api=True,
)
contributor.report_metrics(
role="verifier",
queue_depth=1,
node_latency_ms=32,
uptime_seconds=30,
capability_tier="gpu_fast",
gpu_available=True,
public_api=True,
)
contributor.deregister_node(role="verifier")
Persist the generated seed_hex if you want to keep the same contributor identity across runs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shardnetwork_client-0.6.6.tar.gz
(11.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters