Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shardnetwork_client-0.6.6-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file shardnetwork_client-0.6.6.tar.gz.

File metadata

  • Download URL: shardnetwork_client-0.6.6.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for shardnetwork_client-0.6.6.tar.gz
Algorithm Hash digest
SHA256 dc1471198ff0b891bb4ba198cf5131ead99250a944a48c41b796bd48b75612e6
MD5 3a528f7408ff7025c7ceb2095bfc36f0
BLAKE2b-256 df784287ffa7691dc90684307ee7f53d9c6f6257735bd2a41b1783826d93e848

See more details on using hashes here.

File details

Details for the file shardnetwork_client-0.6.6-py3-none-any.whl.

File metadata

File hashes

Hashes for shardnetwork_client-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0b38a8599ef6c08b45365b02371a48c2a68e41f7d6aa714e87111730fc6ef201
MD5 2900334b29aacc0f58ce806e99e3421e
BLAKE2b-256 3633a4a6cad8a35897652818857d964e9d82703011f00ae3bff33675dc936b89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page